From 395c9258500a2011ec5a7e8b02401b7e3a054b47 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 19:57:26 +0900 Subject: [PATCH 01/23] =?UTF-8?q?=5FWIN32=5FWINNT=E3=82=92=5FWIN32=5FWINNT?= =?UTF-8?q?=5FWIN7=E3=81=AB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit プロジェクト設定が widows 2000 向けになっていたのを win7 向けに更新します。 --- sakura/sakura.vcxproj | 8 ++++---- sakura_core/Makefile | 2 +- sakura_lang_en_US/Makefile | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sakura/sakura.vcxproj b/sakura/sakura.vcxproj index 28e76f162f..97b16c30d5 100644 --- a/sakura/sakura.vcxproj +++ b/sakura/sakura.vcxproj @@ -93,7 +93,7 @@ MinSpace OnlyExplicitInline ..\sakura_core;%(AdditionalIncludeDirectories) - WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;NDEBUG;%(PreprocessorDefinitions) + WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;NDEBUG;%(PreprocessorDefinitions) true MultiThreaded true @@ -136,7 +136,7 @@ MinSpace OnlyExplicitInline ..\sakura_core;%(AdditionalIncludeDirectories) - WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;NDEBUG;%(PreprocessorDefinitions) + WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;NDEBUG;%(PreprocessorDefinitions) true MultiThreaded true @@ -176,7 +176,7 @@ Disabled ..\sakura_core;%(AdditionalIncludeDirectories) - WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;_DEBUG;%(PreprocessorDefinitions) + WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;_DEBUG;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug true @@ -216,7 +216,7 @@ Disabled ..\sakura_core;%(AdditionalIncludeDirectories) - WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;_DEBUG;%(PreprocessorDefinitions) + WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;_DEBUG;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug true diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 6e12fdb266..126324042f 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -24,7 +24,7 @@ RM= cmd /c $(CURDIR)/../sakura/mingw32-del.bat DEFINES= \ -DWIN32 \ - -D_WIN32_WINNT=_WIN32_WINNT_WIN2K \ + -D_WIN32_WINNT=_WIN32_WINNT_WIN7 \ -D_UNICODE \ -DUNICODE \ $(MYDEFINES) diff --git a/sakura_lang_en_US/Makefile b/sakura_lang_en_US/Makefile index a2c952a2ef..1c1c917fe5 100644 --- a/sakura_lang_en_US/Makefile +++ b/sakura_lang_en_US/Makefile @@ -24,7 +24,7 @@ RM= cmd /c $(CURDIR)/../sakura/mingw32-del.bat DEFINES= \ -DWIN32 \ - -D_WIN32_WINNT=_WIN32_WINNT_WIN2K \ + -D_WIN32_WINNT=_WIN32_WINNT_WIN7 \ -D_UNICODE \ -DUNICODE \ -DNDEBUG From 6667abaa893685eadd2e1bc0f9e41c815dc63834 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 20:23:24 +0900 Subject: [PATCH 02/23] =?UTF-8?q?vista=E4=BB=A5=E9=99=8D=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AE=E6=96=B9=E6=B3=95=E3=82=92=E4=BB=96?= =?UTF-8?q?=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ここだけ COsVersionInfoクラス を使っていたのでグローバル関数を呼ぶように修正します。 --- sakura_core/CSelectLang.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sakura_core/CSelectLang.cpp b/sakura_core/CSelectLang.cpp index 849e8fc640..c70e745ad0 100644 --- a/sakura_core/CSelectLang.cpp +++ b/sakura_core/CSelectLang.cpp @@ -405,7 +405,7 @@ HINSTANCE CSelectLang::ChangeLang( UINT nIndex ) // ロケールを設定 // SetThreadUILanguageの呼び出しを試みる bool isSuccess = false; - if( COsVersionInfo()._IsWinVista_or_later() ) { + if( IsWinVista_or_later() ) { HMODULE hDll = LoadLibrary( _T("kernel32") ); if ( hDll ) { typedef short (CALLBACK* SetThreadUILanguageType)(LANGID); From ccb49112b610f2f713f928580a352889eb7a08e3 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 20:25:08 +0900 Subject: [PATCH 03/23] =?UTF-8?q?=E5=AE=9F=E5=8A=B9=E6=80=A7=E3=81=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 処理を簡単に記述するために暗黙動的リンクを採用するので、 動作対象外OSではそもそも起動できなくなったため、チェックをする意味がなくなりました。 シグニチャ訂正をすると他に影響が出るので、一旦内部を空っぽにする対処を行います。 --- sakura_core/_main/CProcessFactory.cpp | 48 ++------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/sakura_core/_main/CProcessFactory.cpp b/sakura_core/_main/CProcessFactory.cpp index ca75bfa118..32b2d41d94 100644 --- a/sakura_core/_main/CProcessFactory.cpp +++ b/sakura_core/_main/CProcessFactory.cpp @@ -134,52 +134,8 @@ bool CProcessFactory::ProfileSelect( HINSTANCE hInstance, LPCTSTR lpCmdLine ) */ bool CProcessFactory::IsValidVersion() { - /* Windowsバージョンのチェック */ - COsVersionInfo cOsVer(true); // 初期化を行う - if( cOsVer.GetVersion() ){ - if( !cOsVer.OsIsEnableVersion() ){ - InfoMessage( NULL, - _T("このアプリケーションを実行するには、\n") -#if (WINVER >= _WIN32_WINNT_WIN7) - _T("Windows7以降のOSが必要です。\n") -#elif (WINVER >= _WIN32_WINNT_VISTA) - _T("WindowsVista以降 または WindowsServer2008以降のOSが必要です。\n") -#elif (WINVER >= _WIN32_WINNT_WIN2K) - _T("Windows2000以降のOSが必要です。\n") -#else - _T("Windows95以上 または WindowsNT4.0以上のOSが必要です。\n") -#endif - _T("アプリケーションを終了します。") - ); - return false; - } - }else{ - InfoMessage( NULL, _T("OSのバージョンが取得できません。\nアプリケーションを終了します。") ); - return false; - } - - /* 拡張命令セットのチェック */ -#ifdef USE_SSE2 - if ( cOsVer._SupportSSE2() ) { - } else { - InfoMessage( NULL, - _T("このアプリケーションを実行するには、\n") - _T("SSE2命令セットをサポートしたCPUが必要です。\n") - _T("アプリケーションを終了します。") - ); - return false; - } -#endif - -#if (WINVER < _WIN32_WINNT_WIN2K) - /* システムリソースのチェック */ - // Jul. 5, 2001 shoji masami NTではリソースチェックを行わない - if( !IsWin32NT() ){ - if( !CheckSystemResources( GSTR_APPNAME ) ){ - return false; - } - } -#endif + // Windowsバージョンは廃止。 + // 動作可能バージョン(=windows7以降)でなければ起動できない。 return true; } From b0fd56c607fa496fbaf2c41cd4e14e7e040ee8f2 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 20:27:50 +0900 Subject: [PATCH 04/23] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E7=A2=BA=E8=AA=8D=E9=96=A2=E6=95=B0=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 実際に利用されている関数を残して未使用処理を除去。 --- sakura_core/_os/COsVersionInfo.cpp | 40 ----- sakura_core/_os/COsVersionInfo.h | 243 +++-------------------------- 2 files changed, 18 insertions(+), 265 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.cpp b/sakura_core/_os/COsVersionInfo.cpp index 0b1812d592..ff21fdcf02 100644 --- a/sakura_core/_os/COsVersionInfo.cpp +++ b/sakura_core/_os/COsVersionInfo.cpp @@ -27,43 +27,3 @@ #include "StdAfx.h" #include "_os/COsVersionInfo.h" -#include "util/RegKey.h" -#include "util/window.h" - -// COsVersionInfoの内部static変数の定義 -// 初期化はIsValidVersion()で行う -BOOL COsVersionInfo::m_bSuccess; -OSVERSIONINFO COsVersionInfo::m_cOsVersionInfo; -#ifdef USE_SSE2 -bool COsVersionInfo::m_bSSE2; -#endif -bool COsVersionInfo::m_bWine; - -/*! - 初期化を行う(引数はダミー) - 呼出は基本1回のみ -*/ -COsVersionInfo::COsVersionInfo( bool pbStart ) -{ - memset_raw( &m_cOsVersionInfo, 0, sizeof( m_cOsVersionInfo ) ); - m_cOsVersionInfo.dwOSVersionInfoSize = sizeof( m_cOsVersionInfo ); - m_bSuccess = ::GetVersionEx( &m_cOsVersionInfo ); - -#ifdef USE_SSE2 - int data[4]; -#ifdef __MINGW32__ - __cpuid(1, data[0], data[1], data[2], data[3]); -#else - __cpuid(data, 1); -#endif - m_bSSE2 = (data[3] & (1<<26)) != 0; -#endif - - CRegKey reg; - if( ERROR_SUCCESS == reg.Open(HKEY_CURRENT_USER, _T("Software\\Wine\\Debug"), KEY_READ) ){ - m_bWine = true; - }else{ - m_bWine = false; - } -} - diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 0c7b11627c..742ecf2b14 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -51,233 +51,26 @@ #define _WIN32_WINNT_WIN7 0x0601 #endif -#ifdef USE_SSE2 -#ifdef __MINGW32__ -#include -#else -#include -#endif -#endif - -class COsVersionInfo { -public: - // 初期化を行う(引数はダミー) - // 呼出は基本1回のみ - COsVersionInfo( bool pbStart ); - - // 通常のコンストラクタ - // 何もしない - COsVersionInfo() {} - - /* OsVersionが取得できたか? */ - BOOL GetVersion(){ - return m_bSuccess; - } - - /* 使用しているOS(Windows)が、動作対象か確認する */ - bool OsIsEnableVersion(){ -#if (WINVER >= _WIN32_WINNT_WIN7) - return ( _IsWin32NT() && - (m_cOsVersionInfo.dwMajorVersion >= 7 || - (m_cOsVersionInfo.dwMajorVersion == 6 && m_cOsVersionInfo.dwMinorVersion >= 1)) ); -#elif (WINVER >= _WIN32_WINNT_VISTA) - return ( _IsWin32NT() && (m_cOsVersionInfo.dwMajorVersion >= 6) ); -#elif (WINVER >= _WIN32_WINNT_WIN2K) - return ( _IsWin32NT() && (m_cOsVersionInfo.dwMajorVersion >= 5) ); -#else - return ( m_cOsVersionInfo.dwMajorVersion >= 4 ); -#endif - } - - - // From Here Jul. 5, 2001 shoji masami - /*! NTプラットフォームかどうか調べる - - @retval true NT platform - @retval false non-NT platform - */ - bool _IsWin32NT(){ - return (m_cOsVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT); - } - - // 2005.10.31 ryoji - /*! Windowsプラットフォームかどうか調べる - - @retval true Windows platform - @retval false non-Windows platform - */ - bool IsWin32Windows(){ - return (m_cOsVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS); - } - - /* ::WinHelp( hwnd, lpszHelp, HELP_COMMAND, (ULONG_PTR)"CONTENTS()" ); - が使用できないバージョンなら、true - 使用できるバージョンなら、false - */ - bool _HasWinHelpContentsProblem(){ - return ( _IsWin32NT() && (m_cOsVersionInfo.dwMajorVersion <= 4)); - } - - /* 再変換がOS標準で提供されていないか。 - 提供されていないなら、false。 - 提供されているなら、true。 - - Windows95 or WindowsNTなら、FASLE(提供されていない) - それ以外のOSなら、true(提供されている) - */ - bool _OsSupportReconvert(){ - return !((4 == m_cOsVersionInfo.dwMajorVersion) && ( 0 == m_cOsVersionInfo.dwMinorVersion )); - } - - // 2005.10.29 ryoji - // Windows 2000 version of OPENFILENAME. - // The new version has three extra members. - // See CommDlg.h - bool _IsWinV5forOfn() { - return (_IsWin2000_or_later() || _IsWinMe()); - } - - /*! Windows Vista以上か調べる - - @retval true Windows Vista or later - - @date 2007.05.19 ryoji - */ - bool _IsWinVista_or_later() - { - return ( 6 <= m_cOsVersionInfo.dwMajorVersion ); - } - - /*! Windows XP以上か調べる - - @retval true Windows XP or later - - @date 2003.09.06 genta - */ - bool _IsWinXP_or_later(){ - return ( m_cOsVersionInfo.dwMajorVersion >= 6 || // 2006.06.17 ryoji Ver 6.0, 7.0,...も含める - (m_cOsVersionInfo.dwMajorVersion >= 5 && m_cOsVersionInfo.dwMinorVersion >= 1) ); - } - - /*! Windows 2000以上か調べる - - @retval true Windows 2000 or later - - @date 2005.10.26 ryoji - */ - bool _IsWin2000_or_later(){ - return ( _IsWin32NT() && (5 <= m_cOsVersionInfo.dwMajorVersion) ); - } - - /*! Windows Meか調べる - - @retval true Windows Me - @date 2005.10.26 ryoji - */ - bool _IsWinMe(){ - return ( IsWin32Windows() && (4 == m_cOsVersionInfo.dwMajorVersion) && ( 90 == m_cOsVersionInfo.dwMinorVersion ) ); - } - -#ifdef USE_SSE2 - /*! SSE2サポートかを調べる - - @retval true support SSE2 - */ - bool _SupportSSE2(){ - return m_bSSE2; - } -#endif - - /*! Wine上で実行されているかを調べる - - @retval true run in Wine - - @date 2013.10.19 novice - */ - bool _IsWine(){ - return m_bWine; - } - -protected: - // Classはstatic(全クラス共有)変数以外持たない - static BOOL m_bSuccess; - static OSVERSIONINFO m_cOsVersionInfo; -#ifdef USE_SSE2 - static bool m_bSSE2; -#endif - static bool m_bWine; -}; - - - -inline bool IsWin32NT() { -#if (WINVER >= _WIN32_WINNT_WIN2K) - return true; -#else - return COsVersionInfo()._IsWin32NT(); -#endif -} - -inline bool HasWinHelpContentsProblem() { -#if (WINVER >= _WIN32_WINNT_WIN2K) - return false; -#else - return COsVersionInfo()._HasWinHelpContentsProblem(); -#endif -} - -inline bool OsSupportReconvert() { -#if (WINVER >= _WIN32_WINNT_WIN2K) - return true; -#else - return COsVersionInfo()._OsSupportReconvert(); -#endif -} - -inline bool IsWinV5forOfn() { -#if (WINVER >= _WIN32_WINNT_WIN2K) - return true; -#else - return COsVersionInfo()._IsWinV5forOfn(); -#endif -} - -inline bool IsWinVista_or_later() { -#if (WINVER >= _WIN32_WINNT_VISTA) - return true; -#else - return COsVersionInfo()._IsWinVista_or_later(); -#endif -} - -inline bool IsWinXP_or_later() { -#if (WINVER >= _WIN32_WINNT_WINXP) - return true; -#else - return COsVersionInfo()._IsWinXP_or_later(); -#endif -} - -inline bool IsWin2000_or_later() { -#if (WINVER >= _WIN32_WINNT_WIN2K) - return true; -#else - return COsVersionInfo()._IsWin2000_or_later(); -#endif -} - -inline bool IsWinMe() { -#if (WINVER >= _WIN32_WINNT_WIN2K) - return false; -#else - return COsVersionInfo()._IsWinMe(); -#endif -} +// 稼働中のOSはNT系か?=常に真。 +inline bool IsWin32NT() { return true; } +// 稼働中のOSはWinHelpに不具合のあるバージョンか?=常に偽。 +inline bool HasWinHelpContentsProblem() { return false; } +// 稼働中のOSはIMEの再変換コマンドに対応しているか?=常に真。 +inline bool OsSupportReconvert() { return true; } +// 稼働中のOSはWindows2000の新ファイルダイアログを使えるか?=常に真。 +inline bool IsWinV5forOfn() { return true; } +// 稼働中のOSはvista以降か?=常に真。 +inline bool IsWinVista_or_later() { return true; } +// 稼働中のOSはxp以降か?=常に真。 +inline bool IsWinXP_or_later() { return true; } +// 稼働中のOSはw2k以降か?=常に真。 +inline bool IsWin2000_or_later() { return true; } +// 稼働中のOSはwindows Meか?=常に偽。 +inline bool IsWinMe() { return false; } +// 稼働中のOSはWineか?=常に真。 +inline bool IsWine() { return true; } -inline bool IsWine() { - return COsVersionInfo()._IsWine(); -} #endif From 8409397de9fd0508f1537f76c056caabbcd352f0 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 21:10:49 +0900 Subject: [PATCH 05/23] =?UTF-8?q?SDK=E3=81=AE=E5=AE=9A=E6=95=B0=E3=82=92?= =?UTF-8?q?=E7=8B=AC=E8=87=AA=E5=AE=9A=E7=BE=A9=E3=81=99=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=82=92=E3=82=84=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/_main/WinMain.cpp | 4 +- sakura_core/_os/COsVersionInfo.h | 13 ----- sakura_core/apiwrap/StdApi.h | 50 ------------------- sakura_core/basis/primitive.h | 23 --------- .../cmd/CViewCommander_Edit_advanced.cpp | 5 -- sakura_core/config/system_constants.h | 24 --------- sakura_core/dlg/CDlgFavorite.cpp | 7 --- sakura_core/func/Funccode.h | 6 --- sakura_core/uiparts/CMenuDrawer.h | 9 ---- sakura_core/uiparts/HandCursor.h | 3 -- sakura_core/util/os.h | 41 --------------- sakura_core/util/std_macro.h | 13 ----- sakura_core/util/window.h | 5 -- sakura_core/view/CEditView.cpp | 3 -- sakura_core/view/CEditView_Mouse.cpp | 5 -- sakura_core/window/CEditWnd.cpp | 11 ---- 16 files changed, 1 insertion(+), 221 deletions(-) diff --git a/sakura_core/_main/WinMain.cpp b/sakura_core/_main/WinMain.cpp index c0da604e73..abd2551cf3 100644 --- a/sakura_core/_main/WinMain.cpp +++ b/sakura_core/_main/WinMain.cpp @@ -71,9 +71,7 @@ int WINAPI _tWinMain( typedef BOOL (WINAPI* Proc_pfnSetSearchPathMode)(DWORD); Proc_pfnSetSearchPathMode pfnSetSearchPathMode = (Proc_pfnSetSearchPathMode)GetProcAddress( kernel32, "SetSearchPathMode" ); if( pfnSetSearchPathMode ){ - const DWORD dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE = 1; - const DWORD dwBASE_SEARCH_PATH_PERMANENT = 0x8000; - pfnSetSearchPathMode( dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | dwBASE_SEARCH_PATH_PERMANENT ); + pfnSetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); } } // 2010.08.28 Moca DLLインジェクション対策 diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 742ecf2b14..0ce60cc482 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -38,19 +38,6 @@ #ifndef _COSVERSIONINFO_H_ #define _COSVERSIONINFO_H_ -#ifndef _WIN32_WINNT_WIN2K -#define _WIN32_WINNT_WIN2K 0x0500 -#endif -#ifndef _WIN32_WINNT_WINXP -#define _WIN32_WINNT_WINXP 0x0501 -#endif -#ifndef _WIN32_WINNT_VISTA -#define _WIN32_WINNT_VISTA 0x0600 -#endif -#ifndef _WIN32_WINNT_WIN7 -#define _WIN32_WINNT_WIN7 0x0601 -#endif - // 稼働中のOSはNT系か?=常に真。 inline bool IsWin32NT() { return true; } diff --git a/sakura_core/apiwrap/StdApi.h b/sakura_core/apiwrap/StdApi.h index 9ca1e3b2a4..2bf0ff7415 100644 --- a/sakura_core/apiwrap/StdApi.h +++ b/sakura_core/apiwrap/StdApi.h @@ -228,55 +228,5 @@ namespace ApiWrap using namespace ApiWrap; - - -// Sep. 22, 2003 MIK -// 古いSDK対策.新しいSDKでは不要 -#ifndef _WIN64 -#ifndef DWORD_PTR -#define DWORD_PTR DWORD -#endif -#ifndef ULONG_PTR -#define ULONG_PTR ULONG -#endif -#ifndef LONG_PTR -#define LONG_PTR LONG -#endif -#ifndef UINT_PTR -#define UINT_PTR UINT -#endif -#ifndef INT_PTR -#define INT_PTR INT -#endif -#ifndef SetWindowLongPtr -#define SetWindowLongPtr SetWindowLong -#endif -#ifndef GetWindowLongPtr -#define GetWindowLongPtr GetWindowLong -#endif -#ifndef DWLP_USER -#define DWLP_USER DWL_USER -#endif -#ifndef GWLP_WNDPROC -#define GWLP_WNDPROC GWL_WNDPROC -#endif -#ifndef GWLP_USERDATA -#define GWLP_USERDATA GWL_USERDATA -#endif -#ifndef GWLP_HINSTANCE -#define GWLP_HINSTANCE GWL_HINSTANCE -#endif -#ifndef DWLP_MSGRESULT -#define DWLP_MSGRESULT DWL_MSGRESULT -#endif -#endif //_WIN64 - -#ifndef COLOR_MENUHILIGHT -#define COLOR_MENUHILIGHT 29 -#endif -#ifndef COLOR_MENUBAR -#define COLOR_MENUBAR 30 -#endif - #endif /* SAKURA_STDAPI_85471C2C_6AEE_410D_BD09_A59056A5BA68_H_ */ /*[EOF]*/ diff --git a/sakura_core/basis/primitive.h b/sakura_core/basis/primitive.h index b50d10602d..63e3cb8069 100644 --- a/sakura_core/basis/primitive.h +++ b/sakura_core/basis/primitive.h @@ -24,29 +24,6 @@ #ifndef SAKURA_PRIMITIVE_0AE619F1_2A04_42A0_92F6_72C9B845799E_H_ #define SAKURA_PRIMITIVE_0AE619F1_2A04_42A0_92F6_72C9B845799E_H_ -// -- -- -- -- 論理型 -- -- -- -- // - -// novice 2002/09/14 -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef BOOL -#define BOOL int -#endif - - -// -- -- -- -- 定数 -- -- -- -- // - -#ifndef NULL -#define NULL 0 -#endif - - // -- -- -- -- 文字 -- -- -- -- // //char,wchar_t の変わりに、別名の ACHAR,WCHAR を使うと、ソース整形がしやすいケースがある。 diff --git a/sakura_core/cmd/CViewCommander_Edit_advanced.cpp b/sakura_core/cmd/CViewCommander_Edit_advanced.cpp index 8ff27acb9b..874817f710 100644 --- a/sakura_core/cmd/CViewCommander_Edit_advanced.cpp +++ b/sakura_core/cmd/CViewCommander_Edit_advanced.cpp @@ -37,11 +37,6 @@ using namespace std; // 2002/2/3 aroka to here #ifndef FID_RECONVERT_VERSION // 2002.04.10 minfu #define FID_RECONVERT_VERSION 0x10000000 #endif -#ifndef SCS_CAP_SETRECONVERTSTRING -#define SCS_CAP_SETRECONVERTSTRING 0x00000004 -#define SCS_QUERYRECONVERTSTRING 0x00020000 -#define SCS_SETRECONVERTSTRING 0x00010000 -#endif /* インデント ver1 */ diff --git a/sakura_core/config/system_constants.h b/sakura_core/config/system_constants.h index b190d30585..5a51e24288 100644 --- a/sakura_core/config/system_constants.h +++ b/sakura_core/config/system_constants.h @@ -752,34 +752,10 @@ enum e_PM_SETCARETPOS_SELECTSTATE { #define MYWM_DLGWINLIST (WM_APP+225) /* 再変換対応 */ // 20020331 aroka -#ifndef WM_IME_REQUEST -#define MYWM_IME_REQUEST 0x288 // ==WM_IME_REQUEST -#else #define MYWM_IME_REQUEST WM_IME_REQUEST -#endif #define MSGNAME_ATOK_RECONVERT TEXT("Atok Message for ReconvertString") #define RWM_RECONVERT TEXT("MSIMEReconvert") -#ifndef VK_XBUTTON1 -#define VK_XBUTTON1 0x05 // マウスサイドボタン1(Windows2000以降で使用可能) // 2009.01.17 nasukoji -#define VK_XBUTTON2 0x06 // マウスサイドボタン2(Windows2000以降で使用可能) // 2009.01.17 nasukoji -#endif - -#ifndef WM_MOUSEHWHEEL -#define WM_MOUSEHWHEEL 0x020E -#endif - - - - - -#ifndef PBM_SETMARQUEE -#define PBM_SETMARQUEE (WM_USER+10) -#endif - -#ifndef PBS_MARQUEE -#define PBS_MARQUEE 0x08 -#endif #endif /* SAKURA_SYSTEM_CONSTANTS_608BC31D_86C2_4526_B749_70DBD090752A_H_ */ /*[EOF]*/ diff --git a/sakura_core/dlg/CDlgFavorite.cpp b/sakura_core/dlg/CDlgFavorite.cpp index 2092059238..5b7e72b886 100644 --- a/sakura_core/dlg/CDlgFavorite.cpp +++ b/sakura_core/dlg/CDlgFavorite.cpp @@ -82,13 +82,6 @@ static const SAnchorList anchorList[] = { {IDC_STATIC_FAVORITE_MSG, ANCHOR_BOTTOM}, }; -//SDKにしか定義されていない。 -#ifndef ListView_SetCheckState -//#if (_WIN32_IE >= 0x0300) -#define ListView_SetCheckState(hwndLV, i, fCheck) \ - ListView_SetItemState(hwndLV, i, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), LVIS_STATEIMAGEMASK) -//#endif -#endif static int FormatFavoriteColumn( TCHAR*, int, int , bool ); static int ListView_GetLParamInt( HWND, int ); diff --git a/sakura_core/func/Funccode.h b/sakura_core/func/Funccode.h index 3baea8d58c..b308622370 100644 --- a/sakura_core/func/Funccode.h +++ b/sakura_core/func/Funccode.h @@ -162,12 +162,6 @@ //2007.09.30 kobake 機能番号定数を列挙型に変更。(デバッグをしやすくするため) #include "Funccode_enum.h" -#ifndef UINT16 -#define UINT16 WORD -#endif -#ifndef uint16_t -typedef UINT16 uint16_t; -#endif // 機能一覧に関するデータ宣言 namespace nsFuncCode{ diff --git a/sakura_core/uiparts/CMenuDrawer.h b/sakura_core/uiparts/CMenuDrawer.h index 5e32fd5071..67a1c0c218 100644 --- a/sakura_core/uiparts/CMenuDrawer.h +++ b/sakura_core/uiparts/CMenuDrawer.h @@ -33,15 +33,6 @@ struct DLLSHAREDATA; //ツールバーの拡張 //@@@ 2002.06.15 MIK #define TBSTYLE_COMBOBOX ((BYTE)0x40) //ツールバーにコンボボックス -#ifndef TBSTYLE_DROPDOWN //IE3以上 - #define TBSTYLE_DROPDOWN 0x0008 -#endif -#ifndef TB_SETEXTENDEDSTYLE //IE4以上 - #define TB_SETEXTENDEDSTYLE (WM_USER + 84) // For TBSTYLE_EX_* -#endif -#ifndef TBSTYLE_EX_DRAWDDARROWS //IE4以上 - #define TBSTYLE_EX_DRAWDDARROWS 0x00000001 -#endif /*----------------------------------------------------------------------- クラスの宣言 diff --git a/sakura_core/uiparts/HandCursor.h b/sakura_core/uiparts/HandCursor.h index 99797ea889..40702cfdca 100644 --- a/sakura_core/uiparts/HandCursor.h +++ b/sakura_core/uiparts/HandCursor.h @@ -34,9 +34,6 @@ #include "_os/COsVersionInfo.h" #include "sakura_rc.h" -#ifndef IDC_HAND -#define IDC_HAND MAKEINTRESOURCE(32649) -#endif inline void SetHandCursor () { diff --git a/sakura_core/util/os.h b/sakura_core/util/os.h index adda821009..6df30a6b75 100644 --- a/sakura_core/util/os.h +++ b/sakura_core/util/os.h @@ -67,46 +67,5 @@ class CCurrentDirectoryBackupPoint{ }; - -// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // -// メッセージ定数 // -// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // - -// -- -- マウス -- -- // - -#ifndef WM_MOUSEWHEEL - #define WM_MOUSEWHEEL 0x020A -#endif -// novice 2004/10/10 マウスサイドボタン対応 -#ifndef WM_XBUTTONDOWN - #define WM_XBUTTONDOWN 0x020B - #define WM_XBUTTONUP 0x020C - #define WM_XBUTTONDBLCLK 0x020D -#endif -#ifndef XBUTTON1 - #define XBUTTON1 0x0001 - #define XBUTTON2 0x0002 -#endif - - -// -- -- テーマ -- -- // - -// 2006.06.17 ryoji WM_THEMECHANGED -#ifndef WM_THEMECHANGED -#define WM_THEMECHANGED 0x031A -#endif - - -// -- -- IME (imm.h) -- -- // - -#ifndef IMR_RECONVERTSTRING -#define IMR_RECONVERTSTRING 0x0004 -#endif // IMR_RECONVERTSTRING - -/* 2002.04.09 minfu 再変換調整 */ -#ifndef IMR_CONFIRMRECONVERTSTRING -#define IMR_CONFIRMRECONVERTSTRING 0x0005 -#endif // IMR_CONFIRMRECONVERTSTRING - #endif /* SAKURA_OS_4EAF837F_94E1_4B90_BF99_5AC3DEC630E79_H_ */ /*[EOF]*/ diff --git a/sakura_core/util/std_macro.h b/sakura_core/util/std_macro.h index db9e03185e..783f27aa08 100644 --- a/sakura_core/util/std_macro.h +++ b/sakura_core/util/std_macro.h @@ -66,19 +66,6 @@ T t_unit(T t) } -/* - 2007.10.19 kobake - _countofマクロ。_countofが使えない古いコンパイラ用。 - - ただし、他の場所でテンプレートごりごり使っているので、 - どっちにしろ古い環境でビルドは通らない予感。 -*/ - -#ifndef _countof -#define _countof(A) (sizeof(A)/sizeof(A[0])) -#endif - -//sizeof #define sizeof_raw(V) sizeof(V) #define sizeof_type(V) sizeof(V) diff --git a/sakura_core/util/window.h b/sakura_core/util/window.h index f06b3eb4d2..d368bcbc62 100644 --- a/sakura_core/util/window.h +++ b/sakura_core/util/window.h @@ -86,11 +86,6 @@ void ActivateFrameWindow(HWND hwnd); /* アクティブにする */ BOOL BlockingHook( HWND hwndDlgCancel ); -#ifndef GA_PARENT -#define GA_PARENT 1 -#define GA_ROOT 2 -#define GA_ROOTOWNER 3 -#endif #define GA_ROOTOWNER2 100 diff --git a/sakura_core/view/CEditView.cpp b/sakura_core/view/CEditView.cpp index 58a4287978..9358c24ecb 100644 --- a/sakura_core/view/CEditView.cpp +++ b/sakura_core/view/CEditView.cpp @@ -62,9 +62,6 @@ #include "util/module.h" #include "debug/CRunningTimer.h" -#ifndef IMR_DOCUMENTFEED -#define IMR_DOCUMENTFEED 0x0007 -#endif LRESULT CALLBACK EditViewWndProc( HWND, UINT, WPARAM, LPARAM ); VOID CALLBACK EditViewTimerProc( HWND, UINT, UINT_PTR, DWORD ); diff --git a/sakura_core/view/CEditView_Mouse.cpp b/sakura_core/view/CEditView_Mouse.cpp index 4d54d2ca22..daa72c2745 100644 --- a/sakura_core/view/CEditView_Mouse.cpp +++ b/sakura_core/view/CEditView_Mouse.cpp @@ -1285,11 +1285,6 @@ void CEditView::OnMOUSEMOVE( WPARAM fwKeys, int xPos_, int yPos_ ) //m_dwTipTimerm_dwTipTimerm_dwTipTimer -#ifndef SPI_GETWHEELSCROLLCHARS -#define SPI_GETWHEELSCROLLCHARS 0x006C -#endif - - /* マウスホイールのメッセージ処理 2009.01.17 nasukoji ホイールスクロールを利用したページスクロール・横スクロール対応 2011.11.16 Moca スクロール変化量への対応 diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index 528c01e0de..e6a9cfca75 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -76,17 +76,6 @@ //@@@ 2002.01.14 YAZAKI 印刷プレビューをCPrintPreviewに独立させたので // 定義を削除 -#ifndef TBSTYLE_ALTDRAG - #define TBSTYLE_ALTDRAG 0x0400 -#endif -#ifndef TBSTYLE_FLAT - #define TBSTYLE_FLAT 0x0800 -#endif -#ifndef TBSTYLE_LIST - #define TBSTYLE_LIST 0x1000 -#endif - - #define YOHAKU_X 4 /* ウィンドウ内の枠と紙の隙間最小値 */ #define YOHAKU_Y 4 /* ウィンドウ内の枠と紙の隙間最小値 */ From abf3ab18e37e7f240529982252608b67fdad1b90 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 21:17:22 +0900 Subject: [PATCH 06/23] =?UTF-8?q?IsWin32NT=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/_os/COsVersionInfo.h | 2 -- sakura_core/cmd/CViewCommander_TagJump.cpp | 13 ------------- sakura_core/dlg/CDlgOpenFile.cpp | 9 +-------- sakura_core/view/CEditView_ExecCmd.cpp | 8 ++------ 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 0ce60cc482..361de1bbb1 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはNT系か?=常に真。 -inline bool IsWin32NT() { return true; } // 稼働中のOSはWinHelpに不具合のあるバージョンか?=常に偽。 inline bool HasWinHelpContentsProblem() { return false; } // 稼働中のOSはIMEの再変換コマンドに対応しているか?=常に真。 diff --git a/sakura_core/cmd/CViewCommander_TagJump.cpp b/sakura_core/cmd/CViewCommander_TagJump.cpp index b4faa4a655..a20375ce4f 100644 --- a/sakura_core/cmd/CViewCommander_TagJump.cpp +++ b/sakura_core/cmd/CViewCommander_TagJump.cpp @@ -473,7 +473,6 @@ bool CViewCommander::Command_TagsMake( void ) _tcscat( options, _T(" *") ); //配下のすべてのファイル //コマンドライン文字列作成(MAX:1024) - if (IsWin32NT()) { // 2010.08.28 Moca システムディレクトリ付加 TCHAR szCmdDir[_MAX_PATH]; @@ -486,18 +485,6 @@ bool CViewCommander::Command_TagsMake( void ) options //ctagsオプション ); } - else - { - // 2010.08.28 Moca システムディレクトリ付加 - TCHAR szCmdDir[_MAX_PATH]; - ::GetWindowsDirectory(szCmdDir, _countof(szCmdDir)); - auto_sprintf( cmdline, _T("\"%ts\\command.com\" /C \"%ts\\%ts\" %ts"), - szCmdDir, - szExeFolder, //sakura.exeパス - CTAGS_COMMAND, //ctags.exe - options //ctagsオプション - ); - } //コマンドライン実行 BOOL bProcessResult = CreateProcess( diff --git a/sakura_core/dlg/CDlgOpenFile.cpp b/sakura_core/dlg/CDlgOpenFile.cpp index 7dd871d615..cca3aa5ff5 100644 --- a/sakura_core/dlg/CDlgOpenFile.cpp +++ b/sakura_core/dlg/CDlgOpenFile.cpp @@ -479,14 +479,7 @@ UINT_PTR CALLBACK OFNHookProc( case CDN_SELCHANGE : { CDlgOpenFileData* pData = (CDlgOpenFileData*)::GetWindowLongPtr(hdlg, DWLP_USER); - // OFNの再設定はNT系ではUnicode版APIのみ有効 - if( pData->m_ofn.Flags & OFN_ALLOWMULTISELECT && -#ifdef _UNICODE - IsWin32NT() -#else - !IsWin32NT() -#endif - ){ + if( pData->m_ofn.Flags & OFN_ALLOWMULTISELECT ){ DWORD nLength = CommDlg_OpenSave_GetSpec( pData->m_hwndOpenDlg, NULL, 0 ); nLength += _MAX_PATH + 2; if( pData->m_ofn.nMaxFile < nLength ){ diff --git a/sakura_core/view/CEditView_ExecCmd.cpp b/sakura_core/view/CEditView_ExecCmd.cpp index 9f60a52402..988d149c30 100644 --- a/sakura_core/view/CEditView_ExecCmd.cpp +++ b/sakura_core/view/CEditView_ExecCmd.cpp @@ -243,18 +243,14 @@ bool CEditView::ExecCmd( const TCHAR* pszCmd, int nFlgOpt, const TCHAR* pszCurDi // 2010.08.27 Moca システムディレクトリ付加 TCHAR szCmdDir[_MAX_PATH]; - if( IsWin32NT() ){ - ::GetSystemDirectory(szCmdDir, _countof(szCmdDir)); - }else{ - ::GetWindowsDirectory(szCmdDir, _countof(szCmdDir)); - } + ::GetSystemDirectory(szCmdDir, _countof(szCmdDir)); //コマンドライン文字列作成 auto_sprintf( cmdline, _T("\"%ts\\%ts\" %ts%ts%ts"), szCmdDir, - ( IsWin32NT() ? _T("cmd.exe") : _T("command.com") ), + _T("cmd.exe"), ( outputEncoding == CODE_UNICODE ? _T("/U") : _T("") ), // Unicdeモードでコマンド実行 2008/6/17 Uchi ( bGetStdout ? _T("/C ") : _T("/K ") ), pszCmd From 3707b82de10437fb1827cc48d98d2eadca32c6b5 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 21:19:04 +0900 Subject: [PATCH 07/23] =?UTF-8?q?HasWinHelpContentsProblem=E9=99=A4?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/_os/COsVersionInfo.h | 2 -- sakura_core/util/shell.cpp | 5 ----- 2 files changed, 7 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 361de1bbb1..13d1530bb3 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはWinHelpに不具合のあるバージョンか?=常に偽。 -inline bool HasWinHelpContentsProblem() { return false; } // 稼働中のOSはIMEの再変換コマンドに対応しているか?=常に真。 inline bool OsSupportReconvert() { return true; } // 稼働中のOSはWindows2000の新ファイルダイアログを使えるか?=常に真。 diff --git a/sakura_core/util/shell.cpp b/sakura_core/util/shell.cpp index f5f7aa86b2..0a853f426f 100644 --- a/sakura_core/util/shell.cpp +++ b/sakura_core/util/shell.cpp @@ -308,11 +308,6 @@ INT_PTR MyPropertySheet( LPPROPSHEETHEADER lppsph ) */ void ShowWinHelpContents( HWND hwnd ) { - if ( HasWinHelpContentsProblem() ){ - /* 目次ページを表示する */ - MyWinHelp( hwnd, HELP_CONTENTS , 0 ); // 2006.10.10 ryoji MyWinHelpに変更 - return; - } /* 目次タブを表示する */ MyWinHelp( hwnd, HELP_COMMAND, (ULONG_PTR)"CONTENTS()" ); // 2006.10.10 ryoji MyWinHelpに変更 return; From 9c013c8f7e384f59a15f0a64676ee3acd42a3f81 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 21:28:26 +0900 Subject: [PATCH 08/23] =?UTF-8?q?OsSupportReconvert=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/_os/COsVersionInfo.h | 2 - .../cmd/CViewCommander_Edit_advanced.cpp | 44 ++--------------- sakura_core/config/system_constants.h | 5 -- sakura_core/view/CEditView.cpp | 49 ++----------------- sakura_core/view/CEditView.h | 10 ---- sakura_core/window/CEditWnd.cpp | 2 - sakura_core/window/CEditWnd.h | 4 -- 7 files changed, 6 insertions(+), 110 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 13d1530bb3..36adea636c 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはIMEの再変換コマンドに対応しているか?=常に真。 -inline bool OsSupportReconvert() { return true; } // 稼働中のOSはWindows2000の新ファイルダイアログを使えるか?=常に真。 inline bool IsWinV5forOfn() { return true; } // 稼働中のOSはvista以降か?=常に真。 diff --git a/sakura_core/cmd/CViewCommander_Edit_advanced.cpp b/sakura_core/cmd/CViewCommander_Edit_advanced.cpp index 874817f710..7b272b35c8 100644 --- a/sakura_core/cmd/CViewCommander_Edit_advanced.cpp +++ b/sakura_core/cmd/CViewCommander_Edit_advanced.cpp @@ -34,10 +34,6 @@ using namespace std; // 2002/2/3 aroka to here -#ifndef FID_RECONVERT_VERSION // 2002.04.10 minfu -#define FID_RECONVERT_VERSION 0x10000000 -#endif - /* インデント ver1 */ void CViewCommander::Command_INDENT( wchar_t wcChar, EIndentType eIndent ) @@ -974,26 +970,7 @@ void CViewCommander::Command_Reconvert(void) return ; bool bUseUnicodeATOK = false; - //バージョンチェック - if( !OsSupportReconvert() ){ - - // MSIMEかどうか - HWND hWnd = ImmGetDefaultIMEWnd(m_pCommanderView->GetHwnd()); - if (SendMessage(hWnd, m_pCommanderView->m_uWM_MSIME_RECONVERTREQUEST, FID_RECONVERT_VERSION, 0)){ - SendMessage(hWnd, m_pCommanderView->m_uWM_MSIME_RECONVERTREQUEST, 0, (LPARAM)m_pCommanderView->GetHwnd()); - return ; - } - - // ATOKが使えるかどうか - TCHAR sz[256]; - ImmGetDescription(GetKeyboardLayout(0),sz,_countof(sz)); //説明の取得 - if ( (_tcsncmp(sz,_T("ATOK"),4) == 0) && (NULL != m_pCommanderView->m_AT_ImmSetReconvertString) ){ - bUseUnicodeATOK = true; - }else{ - //対応IMEなし - return; - } - }else{ + { //現在のIMEが対応しているかどうか //IMEのプロパティ if ( !(ImmGetProperty(GetKeyboardLayout(0),IGP_SETCOMPSTR) & SCS_CAP_SETRECONVERTSTRING) ){ @@ -1002,13 +979,6 @@ void CViewCommander::Command_Reconvert(void) } } - //サイズ取得し直し - if (!UNICODE_BOOL && bUseUnicodeATOK) { - nSize = m_pCommanderView->SetReconvertStruct(NULL,UNICODE_BOOL || bUseUnicodeATOK); - if( 0 == nSize ) // サイズ0の時は何もしない - return ; - } - //IMEのコンテキスト取得 HIMC hIMC = ::ImmGetContext( m_pCommanderView->GetHwnd() ); @@ -1026,21 +996,13 @@ void CViewCommander::Command_Reconvert(void) m_pCommanderView->SetReconvertStruct( pReconv, UNICODE_BOOL || bUseUnicodeATOK); //変換範囲の調整 - if(bUseUnicodeATOK){ - (*m_pCommanderView->m_AT_ImmSetReconvertString)(hIMC, ATRECONVERTSTRING_SET, pReconv, pReconv->dwSize); - }else{ - ::ImmSetCompositionString(hIMC, SCS_QUERYRECONVERTSTRING, pReconv, pReconv->dwSize, NULL,0); - } + ::ImmSetCompositionString(hIMC, SCS_QUERYRECONVERTSTRING, pReconv, pReconv->dwSize, NULL,0); //調整した変換範囲を選択する m_pCommanderView->SetSelectionFromReonvert(pReconv, UNICODE_BOOL || bUseUnicodeATOK); //再変換実行 - if(bUseUnicodeATOK){ - (*m_pCommanderView->m_AT_ImmSetReconvertString)(hIMC, ATRECONVERTSTRING_SET, pReconv, pReconv->dwSize); - }else{ - ::ImmSetCompositionString(hIMC, SCS_SETRECONVERTSTRING, pReconv, pReconv->dwSize, NULL, 0); - } + ::ImmSetCompositionString(hIMC, SCS_SETRECONVERTSTRING, pReconv, pReconv->dwSize, NULL, 0); //領域解放 ::HeapFree(GetProcessHeap(),0,(LPVOID)pReconv); diff --git a/sakura_core/config/system_constants.h b/sakura_core/config/system_constants.h index 5a51e24288..ed4ec922b2 100644 --- a/sakura_core/config/system_constants.h +++ b/sakura_core/config/system_constants.h @@ -751,11 +751,6 @@ enum e_PM_SETCARETPOS_SELECTSTATE { //! ウィンドウ一覧表示 #define MYWM_DLGWINLIST (WM_APP+225) -/* 再変換対応 */ // 20020331 aroka -#define MYWM_IME_REQUEST WM_IME_REQUEST -#define MSGNAME_ATOK_RECONVERT TEXT("Atok Message for ReconvertString") -#define RWM_RECONVERT TEXT("MSIMEReconvert") - #endif /* SAKURA_SYSTEM_CONSTANTS_608BC31D_86C2_4526_B749_70DBD090752A_H_ */ /*[EOF]*/ diff --git a/sakura_core/view/CEditView.cpp b/sakura_core/view/CEditView.cpp index 9358c24ecb..216158e716 100644 --- a/sakura_core/view/CEditView.cpp +++ b/sakura_core/view/CEditView.cpp @@ -154,10 +154,8 @@ CEditView::CEditView(CEditWnd* pcEditWnd) , m_eWheelScroll(F_0) , m_nMousePouse(0) , m_nAutoScrollMode(0) -, m_AT_ImmSetReconvertString(NULL) , m_cHistory(NULL) , m_cRegexKeyword(NULL) -, m_hAtokModule(NULL) { } @@ -253,28 +251,6 @@ BOOL CEditView::Create( // Aug. 31, 2000 genta m_cHistory->SetMax( 30 ); - // from here 2002.04.09 minfu OSによって再変換の方式を変える - // YAZAKI COsVersionInfoのカプセル化は守りましょ。 - if( !OsSupportReconvert() ){ - // 95 or NTならば - m_uMSIMEReconvertMsg = ::RegisterWindowMessage( RWM_RECONVERT ); - m_uATOKReconvertMsg = ::RegisterWindowMessage( MSGNAME_ATOK_RECONVERT ) ; - m_uWM_MSIME_RECONVERTREQUEST = ::RegisterWindowMessage(_T("MSIMEReconvertRequest")); - - m_hAtokModule = LoadLibraryExedir(_T("ATOK10WC.DLL")); - m_AT_ImmSetReconvertString = NULL; - if ( NULL != m_hAtokModule ) { - m_AT_ImmSetReconvertString =(BOOL (WINAPI *)( HIMC , int ,PRECONVERTSTRING , DWORD ) ) GetProcAddress(m_hAtokModule,"AT_ImmSetReconvertString"); - } - } - else{ - // それ以外のOSのときはOS標準を使用する - m_uMSIMEReconvertMsg = 0; - m_uATOKReconvertMsg = 0 ; - m_hAtokModule = 0; //@@@ 2002.04.14 MIK - } - // to here 2002.04.10 minfu - //2004.10.23 isearch m_nISearchMode = SEARCH_NONE; m_pcmigemo = NULL; @@ -440,10 +416,6 @@ void CEditView::Close() delete m_cRegexKeyword; //@@@ 2001.11.17 add MIK m_cRegexKeyword = NULL; - //再変換 2002.04.10 minfu - if(m_hAtokModule) - FreeLibrary(m_hAtokModule); - delete m_pcTextArea; m_pcTextArea = NULL; delete m_pcCaret; @@ -851,7 +823,7 @@ LRESULT CEditView::DispatchEvent( ::PostMessageAny( m_hwndParent, MYWM_SETACTIVEPANE, (WPARAM)m_nMyIndex, 0 ); return 0L; - case MYWM_IME_REQUEST: /* 再変換 by minfu 2002.03.27 */ // 20020331 aroka + case WM_IME_REQUEST: /* 再変換 by minfu 2002.03.27 */ // 20020331 aroka // 2002.04.09 switch case に変更 minfu switch ( wParam ){ @@ -865,7 +837,8 @@ LRESULT CEditView::DispatchEvent( case IMR_DOCUMENTFEED: return SetReconvertStruct((PRECONVERTSTRING)lParam, UNICODE_BOOL, true); - //default: + default: + break; } // 2010.03.16 0LではなくTSFが何かするかもしれないのでDefにまかせる return ::DefWindowProc( hwnd, uMsg, wParam, lParam ); @@ -939,22 +912,6 @@ LRESULT CEditView::DispatchEvent( } default: -// << 20020331 aroka 再変換対応 for 95/NT - if( (m_uMSIMEReconvertMsg && (uMsg == m_uMSIMEReconvertMsg)) - || (m_uATOKReconvertMsg && (uMsg == m_uATOKReconvertMsg))){ - // 2002.04.08 switch case に変更 minfu - switch ( wParam ){ - case IMR_RECONVERTSTRING: - return SetReconvertStruct((PRECONVERTSTRING)lParam, true); - - case IMR_CONFIRMRECONVERTSTRING: - return SetSelectionFromReonvert((PRECONVERTSTRING)lParam, true); - - } - return 0L; - } -// >> by aroka - return DefWindowProc( hwnd, uMsg, wParam, lParam ); } } diff --git a/sakura_core/view/CEditView.h b/sakura_core/view/CEditView.h index baa83e2a15..b85e8f4997 100644 --- a/sakura_core/view/CEditView.h +++ b/sakura_core/view/CEditView.h @@ -729,21 +729,11 @@ class CEditView TCHAR m_szComposition[512]; // IMR_DOCUMENTFEED用入力中文字列データ // IME -private: - UINT m_uMSIMEReconvertMsg; - UINT m_uATOKReconvertMsg; -public: - UINT m_uWM_MSIME_RECONVERTREQUEST; private: int m_nLastReconvLine; //2002.04.09 minfu 再変換情報保存用; int m_nLastReconvIndex; //2002.04.09 minfu 再変換情報保存用; public: - //ATOK専用再変換のAPI - typedef BOOL (WINAPI *FP_ATOK_RECONV)( HIMC , int ,PRECONVERTSTRING , DWORD ); - HMODULE m_hAtokModule; - FP_ATOK_RECONV m_AT_ImmSetReconvertString; - // その他 CAutoMarkMgr* m_cHistory; // Jump履歴 CRegexKeyword* m_cRegexKeyword; //@@@ 2001.11.17 add MIK diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index e6a9cfca75..5a2154c136 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -201,8 +201,6 @@ CEditWnd::CEditWnd() , m_nActivePaneIndex( 0 ) , m_nEditViewCount( 1 ) , m_nEditViewMaxCount( _countof(m_pcEditViewArr) ) // 今のところ最大値は固定 -, m_uMSIMEReconvertMsg( ::RegisterWindowMessage( RWM_RECONVERT ) ) // 20020331 aroka 再変換対応 for 95/NT -, m_uATOKReconvertMsg( ::RegisterWindowMessage( MSGNAME_ATOK_RECONVERT ) ) , m_bIsActiveApp( false ) , m_pszLastCaption( NULL ) , m_pszMenubarMessage( new TCHAR[MENUBAR_MESSAGE_MAX_LEN] ) diff --git a/sakura_core/window/CEditWnd.h b/sakura_core/window/CEditWnd.h index b82c02b710..4c0751bfab 100644 --- a/sakura_core/window/CEditWnd.h +++ b/sakura_core/window/CEditWnd.h @@ -394,10 +394,6 @@ class CEditWnd //ヘルパ CMenuDrawer m_cMenuDrawer; - //メッセージID - UINT m_uMSIMEReconvertMsg; - UINT m_uATOKReconvertMsg; - //状態 bool m_bIsActiveApp; //!< 自アプリがアクティブかどうか // 2007.03.08 ryoji LPTSTR m_pszLastCaption; From 1beb197905b68618d817fa29abc4e9c6be730ede Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 21:49:17 +0900 Subject: [PATCH 09/23] =?UTF-8?q?IsWinV5forOfn=E3=82=92=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OPENFILENAMEZの廃止により、利用していた箇所は除去済み。 --- sakura_core/_os/COsVersionInfo.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 36adea636c..6099ca6235 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはWindows2000の新ファイルダイアログを使えるか?=常に真。 -inline bool IsWinV5forOfn() { return true; } // 稼働中のOSはvista以降か?=常に真。 inline bool IsWinVista_or_later() { return true; } // 稼働中のOSはxp以降か?=常に真。 From 53274ea2d588005cb8724221cf15587947d8a33d Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 21:58:19 +0900 Subject: [PATCH 10/23] =?UTF-8?q?IsWinVista=5For=5Flater=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/CSelectLang.cpp | 16 +--------------- sakura_core/_os/COsVersionInfo.h | 2 -- sakura_core/apiwrap/StdApi.cpp | 10 +++++----- sakura_core/uiparts/CMenuDrawer.cpp | 4 ++-- sakura_core/window/CEditWnd.cpp | 15 +-------------- 5 files changed, 9 insertions(+), 38 deletions(-) diff --git a/sakura_core/CSelectLang.cpp b/sakura_core/CSelectLang.cpp index c70e745ad0..1b0f7ec4b7 100644 --- a/sakura_core/CSelectLang.cpp +++ b/sakura_core/CSelectLang.cpp @@ -403,21 +403,7 @@ HINSTANCE CSelectLang::ChangeLang( UINT nIndex ) m_psLangInfo = psLangInfo; // ロケールを設定 - // SetThreadUILanguageの呼び出しを試みる - bool isSuccess = false; - if( IsWinVista_or_later() ) { - HMODULE hDll = LoadLibrary( _T("kernel32") ); - if ( hDll ) { - typedef short (CALLBACK* SetThreadUILanguageType)(LANGID); - SetThreadUILanguageType _SetThreadUILanguage = (SetThreadUILanguageType) - GetProcAddress(hDll, "SetThreadUILanguage"); - isSuccess = _SetThreadUILanguage && _SetThreadUILanguage( m_psLangInfo->wLangId ); - FreeLibrary( hDll ); - } - } - if ( !isSuccess ) { - SetThreadLocale(MAKELCID( m_psLangInfo->wLangId, SORT_DEFAULT )); - } + ::SetThreadUILanguage( m_psLangInfo->wLangId ); return m_psLangInfo->hInstance; } diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 6099ca6235..e47e852d62 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはvista以降か?=常に真。 -inline bool IsWinVista_or_later() { return true; } // 稼働中のOSはxp以降か?=常に真。 inline bool IsWinXP_or_later() { return true; } // 稼働中のOSはw2k以降か?=常に真。 diff --git a/sakura_core/apiwrap/StdApi.cpp b/sakura_core/apiwrap/StdApi.cpp index af2a0eafe5..853cbfad19 100644 --- a/sakura_core/apiwrap/StdApi.cpp +++ b/sakura_core/apiwrap/StdApi.cpp @@ -276,14 +276,14 @@ namespace ApiWrap{ 参考:http://forums.microsoft.com/MSDN-JA/ShowPost.aspx?PostID=3228018&SiteID=7 > Vista で Aero を OFF にすると SetPixel がうまく動かないそうです。 > しかも、SP1 でも修正されていないとか。 + + 一旦はvista以降向けの「不具合」対策をそのまま残します。 + vista前後でGDIの考え方が変わってるので、デバッグのやり方を考え直すべきと思います。 + by berryzplus 2018/10/13記す。 */ void SetPixelSurely(HDC hdc,int x,int y,COLORREF c) { - if (!IsWinVista_or_later()) { - //Vistaより前:SetPixel直呼び出し - ::SetPixel(hdc,x,y,c); - } - else { + { //Vista以降:SetPixelエミュレート static HPEN hPen = NULL; static COLORREF clrPen = 0; diff --git a/sakura_core/uiparts/CMenuDrawer.cpp b/sakura_core/uiparts/CMenuDrawer.cpp index f7e21aa6c7..3dbf88a20d 100644 --- a/sakura_core/uiparts/CMenuDrawer.cpp +++ b/sakura_core/uiparts/CMenuDrawer.cpp @@ -844,7 +844,7 @@ void CMenuDrawer::MyAppendMenu( // メニュー項目をオーナー描画にして、アイコンを表示する // 2010.03.29 アクセスキーの分を詰めるためいつもオーナードローにする。ただしVista未満限定 // Vista以上ではメニューもテーマが適用されるので、オーナードローにすると見た目がXP風になってしまう。 - if( m_pShareData->m_Common.m_sWindow.m_bMenuIcon || !IsWinVista_or_later() ){ + if( m_pShareData->m_Common.m_sWindow.m_bMenuIcon ){ nFlagAdd = MF_OWNERDRAW; } /* 機能のビットマップの情報を覚えておく */ @@ -855,7 +855,7 @@ void CMenuDrawer::MyAppendMenu( #ifdef DRAW_MENU_ICON_BACKGROUND_3DFACE // セパレータかサブメニュー if( nFlag & (MF_SEPARATOR | MF_POPUP) ){ - if( m_pShareData->m_Common.m_sWindow.m_bMenuIcon || !IsWinVista_or_later() ){ + if( m_pShareData->m_Common.m_sWindow.m_bMenuIcon ){ nFlagAdd = MF_OWNERDRAW; } } diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index 5a2154c136..982bb06a8d 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -493,19 +493,6 @@ void CEditWnd::_AdjustInMonitor(const STabGroupInfo& sTabGroupInfo) ::SetWindowPos( GetHwnd(), (dwExStyle & WS_EX_TOPMOST)? HWND_TOPMOST: HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); //タブウインドウ時は現状を維持 - /* ウィンドウサイズ継承 */ - // Vista 以降の初回表示アニメーション効果を抑止する - if( !IsWinVista_or_later() ){ - if( sTabGroupInfo.wpTop.showCmd == SW_SHOWMAXIMIZED ) - { - ::ShowWindow( GetHwnd(), SW_SHOWMAXIMIZED ); - } - else - { - ::ShowWindow( GetHwnd(), SW_SHOW ); - } - } - else { // 初回表示のアニメーション効果を抑止する @@ -743,7 +730,7 @@ HWND CEditWnd::Create( m_bIsActiveApp = ( ::GetActiveWindow() == GetHwnd() ); // 2007.03.08 ryoji // エディタ-トレイ間でのUI特権分離の確認(Vista UIPI機能) 2007.06.07 ryoji - if( IsWinVista_or_later() ){ + { m_bUIPI = FALSE; ::SendMessage( m_pShareData->m_sHandles.m_hwndTray, MYWM_UIPI_CHECK, (WPARAM)0, (LPARAM)GetHwnd() ); if( !m_bUIPI ){ // 返事が返らない From e14801a9193b0317c4747e7a39e38320b92d2017 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 22:49:19 +0900 Subject: [PATCH 11/23] =?UTF-8?q?IsWinXP=5For=5Flater=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/_os/COsVersionInfo.h | 2 -- sakura_core/window/CEditWnd.cpp | 31 ++++++++++++++++++++----------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index e47e852d62..ef81179ca5 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはxp以降か?=常に真。 -inline bool IsWinXP_or_later() { return true; } // 稼働中のOSはw2k以降か?=常に真。 inline bool IsWin2000_or_later() { return true; } // 稼働中のOSはwindows Meか?=常に偽。 diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index 982bb06a8d..02a93652e0 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -4043,17 +4043,26 @@ void CEditWnd::PrintMenubarMessage( const TCHAR* msg ) rc.top = po.y - m_nCaretPosInfoCharHeight - 2; rc.bottom = rc.top + m_nCaretPosInfoCharHeight; ::SetTextColor( hdc, ::GetSysColor( COLOR_MENUTEXT ) ); - // Sep. 6, 2003 genta Windows XP(Luna)の場合にはCOLOR_MENUBARを使わなくてはならない - COLORREF bkColor = - ::GetSysColor( IsWinXP_or_later() ? COLOR_MENUBAR : COLOR_MENU ); - ::SetBkColor( hdc, bkColor ); - /* - int m_pnCaretPosInfoDx[64]; // 文字列描画用文字幅配列 - for( i = 0; i < _countof( m_pnCaretPosInfoDx ); ++i ){ - m_pnCaretPosInfoDx[i] = ( m_nCaretPosInfoCharWidth ); - } - */ - ::ExtTextOut( hdc,rc.left,rc.top,ETO_CLIPPED | ETO_OPAQUE,&rc,m_pszMenubarMessage,nStrLen,NULL/*m_pnCaretPosInfoDx*/); //2007.10.17 kobake めんどいので今のところは文字間隔配列を使わない。 + ::SetBkColor( hdc, ::GetSysColor( COLOR_MENUBAR ) ); + { + const WCHAR* pchText = m_pszMenubarMessage; + const ULONG cchText = nStrLen; + const INT nMaxExtent = rc.right - rc.left; + const DWORD dwFlags = ::GetFontLanguageInfo(hdc); + std::vector vDx(cchText, 0); + std::wstring strGlyphs(::MulDiv(cchText, 3, 2) + 16, '\0'); + + GCP_RESULTS results = { sizeof(GCP_RESULTS) }; + results.lpDx = vDx.data(); + results.lpGlyphs = &*strGlyphs.begin(); + results.nGlyphs = strGlyphs.size(); + results.nMaxFit = cchText; + auto placement = ::GetCharacterPlacement(hdc, pchText, cchText, nMaxExtent, &results, dwFlags); + + if (placement != NULL) { + ::ExtTextOut(hdc, rc.left, rc.top, ETO_CLIPPED | ETO_OPAQUE, &rc, m_pszMenubarMessage, nStrLen, &*vDx.begin()); + } + } ::SelectObject( hdc, hFontOld ); ::ReleaseDC( GetHwnd(), hdc ); } From 0ba38d48a6e9264a9c2a640a334300f41840ee51 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 22:54:24 +0900 Subject: [PATCH 12/23] =?UTF-8?q?IsWin2000=5For=5Flater=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/_os/COsVersionInfo.h | 2 -- sakura_core/env/CFileNameManager.cpp | 2 +- sakura_core/print/CPrintPreview.cpp | 12 ++---------- sakura_core/sakura_rc.rc | 3 --- sakura_core/uiparts/HandCursor.h | 10 +--------- sakura_lang_en_US/sakura_lang_rc.rc | 3 --- 6 files changed, 4 insertions(+), 28 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index ef81179ca5..fb6009123f 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはw2k以降か?=常に真。 -inline bool IsWin2000_or_later() { return true; } // 稼働中のOSはwindows Meか?=常に偽。 inline bool IsWinMe() { return false; } // 稼働中のOSはWineか?=常に真。 diff --git a/sakura_core/env/CFileNameManager.cpp b/sakura_core/env/CFileNameManager.cpp index 11c52353ba..df97954cd6 100644 --- a/sakura_core/env/CFileNameManager.cpp +++ b/sakura_core/env/CFileNameManager.cpp @@ -525,7 +525,7 @@ void CFileNameManager::GetIniFileNameDirect( LPTSTR pszPrivateIniFile, LPTSTR ps // exeと同じフォルダに置かれたマルチユーザ構成設定ファイル(sakura.exe.ini)の内容 // に従ってマルチユーザ用のiniファイルパスを決める pszPrivateIniFile[0] = _T('\0'); - if( IsWin2000_or_later() ){ + { auto_snprintf_s( szPath, _MAX_PATH - 1, _T("%ts%ts%ts%ts"), szDrive, szDir, szFname, _T(".exe.ini") ); int nEnable = ::GetPrivateProfileInt(_T("Settings"), _T("MultiUser"), 0, szPath ); if( nEnable ){ diff --git a/sakura_core/print/CPrintPreview.cpp b/sakura_core/print/CPrintPreview.cpp index f92bba71db..e494a91791 100644 --- a/sakura_core/print/CPrintPreview.cpp +++ b/sakura_core/print/CPrintPreview.cpp @@ -402,8 +402,7 @@ LRESULT CPrintPreview::OnSize( WPARAM wParam, LPARAM lParam ) // 2007.02.11 Moca プレビューを滑らかにする // Win9xでは 巨大なBMPは作成できないことと // StretchBltでSTRETCH_HALFTONEが未サポートであるので Win2K 以上のみで有効にする。 - if( BST_CHECKED == ::IsDlgButtonChecked( m_hwndPrintPreviewBar, IDC_CHECK_ANTIALIAS ) && - IsWin2000_or_later() ){ + if( BST_CHECKED == ::IsDlgButtonChecked( m_hwndPrintPreviewBar, IDC_CHECK_ANTIALIAS ) ){ m_nbmpCompatScale = COMPAT_BMP_SCALE; }else{ // Win9x: BASE = SCALE で 1:1 @@ -2128,14 +2127,7 @@ INT_PTR CPrintPreview::DispatchEvent_PPB( switch( uMsg ){ case WM_INITDIALOG: - // 2007.02.11 Moca DWLP_USER設定は不要 - //// Modified by KEITA for WIN64 2003.9.6 - //::SetWindowLongPtr( hwndDlg, DWLP_USER, lParam ); - { - if( IsWin2000_or_later() ){ - ::EnableWindow( ::GetDlgItem(hwndDlg, IDC_CHECK_ANTIALIAS), TRUE ); - } - } + ::EnableWindow( ::GetDlgItem(hwndDlg, IDC_CHECK_ANTIALIAS), TRUE ); return TRUE; case WM_COMMAND: wNotifyCode = HIWORD(wParam); /* 通知コード */ diff --git a/sakura_core/sakura_rc.rc b/sakura_core/sakura_rc.rc index 96070a9670..46f6e7cb6e 100644 --- a/sakura_core/sakura_rc.rc +++ b/sakura_core/sakura_rc.rc @@ -2168,9 +2168,6 @@ IDI_PRINTER ICON DISCARDABLE "../resource/printer.ico" // IDC_CURSOR_COPYARROW CURSOR DISCARDABLE "../resource/cursor_copy.cur" -#ifdef IDC_CURSOR_HAND -IDC_CURSOR_HAND CURSOR DISCARDABLE "../resource/cursor_hand.cur" -#endif IDC_CURSOR_MOVEARROW CURSOR DISCARDABLE "../resource/cursor_move.cur" IDC_CURSOR_RVARROW CURSOR DISCARDABLE "../resource/cursor_rvarrow.cur" IDC_CURSOR_ISEARCH_F CURSOR DISCARDABLE "../resource/cursor_isf.cur" diff --git a/sakura_core/uiparts/HandCursor.h b/sakura_core/uiparts/HandCursor.h index 40702cfdca..cd6b77eca7 100644 --- a/sakura_core/uiparts/HandCursor.h +++ b/sakura_core/uiparts/HandCursor.h @@ -37,15 +37,7 @@ inline void SetHandCursor () { -#ifdef IDC_CURSOR_HAND - if (!IsWin2000_or_later()) { - SetCursor( LoadCursor( GetModuleHandle( NULL ), MAKEINTRESOURCE( IDC_CURSOR_HAND ) ) ); - } - else -#endif - { - SetCursor( LoadCursor( NULL, IDC_HAND ) ); - } + SetCursor( LoadCursor( NULL, IDC_HAND ) ); } #endif // SAKURA_HANDCURSOR_A545F10D_9F24_4AB5_889F_13732FC0150B_H_ diff --git a/sakura_lang_en_US/sakura_lang_rc.rc b/sakura_lang_en_US/sakura_lang_rc.rc index 5ab2657a19..b80a749702 100644 --- a/sakura_lang_en_US/sakura_lang_rc.rc +++ b/sakura_lang_en_US/sakura_lang_rc.rc @@ -2173,9 +2173,6 @@ IDI_PRINTER ICON DISCARDABLE "../resource/printer.ico" // IDC_CURSOR_COPYARROW CURSOR DISCARDABLE "../resource/cursor_copy.cur" -#ifdef IDC_CURSOR_HAND -IDC_CURSOR_HAND CURSOR DISCARDABLE "../resource/cursor_hand.cur" -#endif IDC_CURSOR_MOVEARROW CURSOR DISCARDABLE "../resource/cursor_move.cur" IDC_CURSOR_RVARROW CURSOR DISCARDABLE "../resource/cursor_rvarrow.cur" IDC_CURSOR_ISEARCH_F CURSOR DISCARDABLE "../resource/cursor_isf.cur" From b726762c901acfb5f4f455654a7f3eca2bc1e165 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 22:55:27 +0900 Subject: [PATCH 13/23] =?UTF-8?q?IsWinMe=E3=82=92=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 未使用関数のため影響なし。 --- sakura_core/_os/COsVersionInfo.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index fb6009123f..2b4ceb4214 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,8 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはwindows Meか?=常に偽。 -inline bool IsWinMe() { return false; } // 稼働中のOSはWineか?=常に真。 inline bool IsWine() { return true; } From 17db5f659e7591917487b5cece618c023d34fb32 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 23:08:13 +0900 Subject: [PATCH 14/23] =?UTF-8?q?IsWine=E3=82=92=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IsWine関数は実際には「プロセス毎にキーボードアクセラレータを作る必要があるか?」の判定に使われていた。 アクセラレータはプロセス毎に管理するものなので共有しないほうが正しいように思われる。 判定文を除去し、常に自プロセスのアクセラレータテーブルを作成するように変更する。 --- sakura_core/_os/COsVersionInfo.h | 4 ---- sakura_core/window/CEditWnd.cpp | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h index 2b4ceb4214..04fbba5a4b 100644 --- a/sakura_core/_os/COsVersionInfo.h +++ b/sakura_core/_os/COsVersionInfo.h @@ -39,10 +39,6 @@ #define _COSVERSIONINFO_H_ -// 稼働中のOSはWineか?=常に真。 -inline bool IsWine() { return true; } - - #endif diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index 02a93652e0..d9a010c891 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -4868,7 +4868,7 @@ void CEditWnd::ClearMouseState( void ) */ void CEditWnd::CreateAccelTbl( void ) { - if( IsWine() ){ + { m_hAccelWine = CKeyBind::CreateAccerelator( m_pShareData->m_Common.m_sKeyBind.m_nKeyNameArrNum, m_pShareData->m_Common.m_sKeyBind.m_pKeyNameArr @@ -4882,7 +4882,7 @@ void CEditWnd::CreateAccelTbl( void ) } } - m_hAccel = m_hAccelWine ? m_hAccelWine : m_pShareData->m_sHandles.m_hAccel; + m_hAccel = m_hAccelWine; } /*! ウィンドウ毎に作成したアクセラレータテーブルを破棄する From 46a149a12bd8b37a586933eca20c42a263762989 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 14 Oct 2018 00:03:01 +0900 Subject: [PATCH 15/23] =?UTF-8?q?COsVersionInfo.h=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=AB=E3=83=BC=E3=83=89=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/CSelectLang.cpp | 1 - sakura_core/_main/CProcessFactory.cpp | 1 - sakura_core/apiwrap/StdApi.cpp | 1 - sakura_core/cmd/CViewCommander_Edit_advanced.cpp | 2 -- sakura_core/cmd/CViewCommander_TagJump.cpp | 1 - sakura_core/dlg/CDlgOpenFile.cpp | 1 - sakura_core/env/CFileNameManager.cpp | 1 - sakura_core/uiparts/CMenuDrawer.cpp | 1 - sakura_core/uiparts/HandCursor.h | 3 --- sakura_core/util/shell.cpp | 1 - sakura_core/view/CEditView.cpp | 1 - sakura_core/view/CEditView_Diff.cpp | 1 - sakura_core/view/CEditView_ExecCmd.cpp | 1 - sakura_core/window/CEditWnd.cpp | 1 - sakura_core/window/CTabWnd.cpp | 1 - 15 files changed, 18 deletions(-) diff --git a/sakura_core/CSelectLang.cpp b/sakura_core/CSelectLang.cpp index 1b0f7ec4b7..60dd20ea3b 100644 --- a/sakura_core/CSelectLang.cpp +++ b/sakura_core/CSelectLang.cpp @@ -15,7 +15,6 @@ #include "CSelectLang.h" #include "util/os.h" #include "util/module.h" -#include "_os/COsVersionInfo.h" #include diff --git a/sakura_core/_main/CProcessFactory.cpp b/sakura_core/_main/CProcessFactory.cpp index 32b2d41d94..52629b43b5 100644 --- a/sakura_core/_main/CProcessFactory.cpp +++ b/sakura_core/_main/CProcessFactory.cpp @@ -22,7 +22,6 @@ #include "CNormalProcess.h" #include "CCommandLine.h" #include "CControlTray.h" -#include "_os/COsVersionInfo.h" #include "dlg/CDlgProfileMgr.h" #include "debug/CRunningTimer.h" #include "util/os.h" diff --git a/sakura_core/apiwrap/StdApi.cpp b/sakura_core/apiwrap/StdApi.cpp index 853cbfad19..38cbe4b161 100644 --- a/sakura_core/apiwrap/StdApi.cpp +++ b/sakura_core/apiwrap/StdApi.cpp @@ -2,7 +2,6 @@ #include #include "StdApi.h" #include "charset/charcode.h" -#include "_os/COsVersionInfo.h" using namespace std; diff --git a/sakura_core/cmd/CViewCommander_Edit_advanced.cpp b/sakura_core/cmd/CViewCommander_Edit_advanced.cpp index 7b272b35c8..4201adef8d 100644 --- a/sakura_core/cmd/CViewCommander_Edit_advanced.cpp +++ b/sakura_core/cmd/CViewCommander_Edit_advanced.cpp @@ -29,7 +29,6 @@ #include "uiparts/CWaitCursor.h" #include "mem/CMemoryIterator.h" // @@@ 2002.09.28 YAZAKI -#include "_os/COsVersionInfo.h" using namespace std; // 2002/2/3 aroka to here @@ -956,7 +955,6 @@ void CViewCommander::Command_MERGE(void) // from CViewCommander_New.cpp /* メニューからの再変換対応 minfu 2002.04.09 - @date 2002.04.11 YAZAKI COsVersionInfoのカプセル化を守りましょう。 @date 2010.03.17 ATOK用はSCS_SETRECONVERTSTRING => ATRECONVERTSTRING_SETに変更 2002.11.20 Stoneeさんの情報 */ diff --git a/sakura_core/cmd/CViewCommander_TagJump.cpp b/sakura_core/cmd/CViewCommander_TagJump.cpp index a20375ce4f..1b42148af8 100644 --- a/sakura_core/cmd/CViewCommander_TagJump.cpp +++ b/sakura_core/cmd/CViewCommander_TagJump.cpp @@ -29,7 +29,6 @@ #include "dlg/CDlgTagJumpList.h" #include "dlg/CDlgTagsMake.h" //@@@ 2003.05.12 MIK #include "CEditApp.h" -#include "_os/COsVersionInfo.h" #include "util/window.h" #include "util/module.h" #include "util/string_ex2.h" diff --git a/sakura_core/dlg/CDlgOpenFile.cpp b/sakura_core/dlg/CDlgOpenFile.cpp index cca3aa5ff5..6f5060f8be 100644 --- a/sakura_core/dlg/CDlgOpenFile.cpp +++ b/sakura_core/dlg/CDlgOpenFile.cpp @@ -29,7 +29,6 @@ #include "charset/CCodePage.h" #include "doc/CDocListener.h" #include "recent/CRecent.h" -#include "_os/COsVersionInfo.h" #include "dlg/CDialog.h" #include "util/window.h" #include "util/shell.h" diff --git a/sakura_core/env/CFileNameManager.cpp b/sakura_core/env/CFileNameManager.cpp index df97954cd6..6d0353b916 100644 --- a/sakura_core/env/CFileNameManager.cpp +++ b/sakura_core/env/CFileNameManager.cpp @@ -38,7 +38,6 @@ #include "util/file.h" #include "util/window.h" #include "_main/CCommandLine.h" -#include "_os/COsVersionInfo.h" // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // // ファイル名管理 // diff --git a/sakura_core/uiparts/CMenuDrawer.cpp b/sakura_core/uiparts/CMenuDrawer.cpp index 3dbf88a20d..f64c5905b3 100644 --- a/sakura_core/uiparts/CMenuDrawer.cpp +++ b/sakura_core/uiparts/CMenuDrawer.cpp @@ -25,7 +25,6 @@ #include "window/CSplitBoxWnd.h" #include "CImageListMgr.h" #include "func/CKeyBind.h" -#include "_os/COSVersionInfo.h" #include "util/window.h" // メニューアイコンの背景をボタンの色にする diff --git a/sakura_core/uiparts/HandCursor.h b/sakura_core/uiparts/HandCursor.h index cd6b77eca7..c5df9a0131 100644 --- a/sakura_core/uiparts/HandCursor.h +++ b/sakura_core/uiparts/HandCursor.h @@ -31,9 +31,6 @@ #ifndef SAKURA_HANDCURSOR_A545F10D_9F24_4AB5_889F_13732FC0150B_H_ #define SAKURA_HANDCURSOR_A545F10D_9F24_4AB5_889F_13732FC0150B_H_ -#include "_os/COsVersionInfo.h" -#include "sakura_rc.h" - inline void SetHandCursor () { diff --git a/sakura_core/util/shell.cpp b/sakura_core/util/shell.cpp index 0a853f426f..7812820c46 100644 --- a/sakura_core/util/shell.cpp +++ b/sakura_core/util/shell.cpp @@ -32,7 +32,6 @@ #include "util/file.h" #include "util/os.h" #include "util/module.h" -#include "_os/COsVersionInfo.h" #include "env/CShareData.h" #include "env/DLLSHAREDATA.h" #include "extmodule/CHtmlHelp.h" diff --git a/sakura_core/view/CEditView.cpp b/sakura_core/view/CEditView.cpp index 216158e716..e662300809 100644 --- a/sakura_core/view/CEditView.cpp +++ b/sakura_core/view/CEditView.cpp @@ -51,7 +51,6 @@ #include "cmd/CViewCommander_inline.h" #include "_os/CDropTarget.h"/// #include "_os/CClipboard.h" -#include "_os/COsVersionInfo.h" #include "CMarkMgr.h"/// #include "types/CTypeSupport.h" #include "convert/CConvert.h" diff --git a/sakura_core/view/CEditView_Diff.cpp b/sakura_core/view/CEditView_Diff.cpp index eefb83a0b2..e95df8e195 100644 --- a/sakura_core/view/CEditView_Diff.cpp +++ b/sakura_core/view/CEditView_Diff.cpp @@ -47,7 +47,6 @@ #include "doc/logic/CDocLine.h" #include "doc/logic/CDocLineMgr.h" #include "uiparts/CWaitCursor.h" -#include "_os/COsVersionInfo.h" #include "env/CShareData.h" #include "env/CSakuraEnvironment.h" #include "util/module.h" diff --git a/sakura_core/view/CEditView_ExecCmd.cpp b/sakura_core/view/CEditView_ExecCmd.cpp index 988d149c30..9897273ae6 100644 --- a/sakura_core/view/CEditView_ExecCmd.cpp +++ b/sakura_core/view/CEditView_ExecCmd.cpp @@ -23,7 +23,6 @@ #include "StdAfx.h" #include "CEditView.h" #include "_main/CAppMode.h" -#include "_os/COsVersionInfo.h" #include "env/CShareData.h" #include "env/DLLSHAREDATA.h" #include "env/CFormatManager.h" diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index d9a010c891..f1619967dc 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -48,7 +48,6 @@ #include "_main/CCommandLine.h" /// 2003/1/26 aroka #include "_main/CAppMode.h" #include "_os/CDropTarget.h" -#include "_os/COsVersionInfo.h" #include "dlg/CDlgAbout.h" #include "dlg/CDlgPrintSetting.h" #include "env/CShareData.h" diff --git a/sakura_core/window/CTabWnd.cpp b/sakura_core/window/CTabWnd.cpp index e428996452..4a7b5d6551 100644 --- a/sakura_core/window/CTabWnd.cpp +++ b/sakura_core/window/CTabWnd.cpp @@ -41,7 +41,6 @@ #include "CTabWnd.h" #include "window/CEditWnd.h" #include "_main/global.h" -#include "_os/COSVersionInfo.h" #include "charset/charcode.h" #include "extmodule/CUxTheme.h" #include "env/CShareData.h" From 66bffd0a61d8737bab24461c24d03d6d23303084 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 14 Oct 2018 00:11:18 +0900 Subject: [PATCH 16/23] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=A8=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/cursor_hand.cur | Bin 326 -> 0 bytes sakura/sakura.vcxproj | 3 -- sakura/sakura.vcxproj.filters | 9 ------ sakura_core/Makefile | 1 - sakura_core/_os/COsVersionInfo.cpp | 29 ------------------- sakura_core/_os/COsVersionInfo.h | 44 ----------------------------- 6 files changed, 86 deletions(-) delete mode 100644 resource/cursor_hand.cur delete mode 100644 sakura_core/_os/COsVersionInfo.cpp delete mode 100644 sakura_core/_os/COsVersionInfo.h diff --git a/resource/cursor_hand.cur b/resource/cursor_hand.cur deleted file mode 100644 index f0aa6f8cdafd52b35bd91c6e8d0abc5354c3f0be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcma*hu?@m75QX7)xJW@kM?*nMN+e1O7=-~~2D@Y|MqvcX6o$)hCsGuu*!ukJlh3lW zlBsQ_hCG_Im2?0lU17{R#uyIM>h9BF;m&?iC}?dwRU2}R9nLs?lft9m-W@ma{y$3M i4~s`O_e@7uMgQnhy~*N*G - @@ -588,7 +587,6 @@ - @@ -976,7 +974,6 @@ - diff --git a/sakura/sakura.vcxproj.filters b/sakura/sakura.vcxproj.filters index 328d858b5e..eadbd2a7c7 100644 --- a/sakura/sakura.vcxproj.filters +++ b/sakura/sakura.vcxproj.filters @@ -970,9 +970,6 @@ Cpp Source Files\_os - - Cpp Source Files\_os - Cpp Source Files\_os @@ -1126,9 +1123,6 @@ Resource Files - - Resource Files - Resource Files @@ -2096,9 +2090,6 @@ Cpp Source Files\_os - - Cpp Source Files\_os - Cpp Source Files\outline diff --git a/sakura_core/Makefile b/sakura_core/Makefile index 126324042f..d60cacf28f 100644 --- a/sakura_core/Makefile +++ b/sakura_core/Makefile @@ -417,7 +417,6 @@ _main/global.o \ _main/WinMain.o \ _os/CClipboard.o \ _os/CDropTarget.o \ -_os/COsVersionInfo.o \ sakura_rc.o \ GENERATED_FILES= \ diff --git a/sakura_core/_os/COsVersionInfo.cpp b/sakura_core/_os/COsVersionInfo.cpp deleted file mode 100644 index ff21fdcf02..0000000000 --- a/sakura_core/_os/COsVersionInfo.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/*! @file - @brief COsVersionInfo -*/ -/* - Copyright (C) 2013, novice - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; - you must not claim that you wrote the original software. - If you use this software in a product, an acknowledgment - in the product documentation would be appreciated but is - not required. - - 2. Altered source versions must be plainly marked as such, - and must not be misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*/ - -#include "StdAfx.h" -#include "_os/COsVersionInfo.h" diff --git a/sakura_core/_os/COsVersionInfo.h b/sakura_core/_os/COsVersionInfo.h deleted file mode 100644 index 04fbba5a4b..0000000000 --- a/sakura_core/_os/COsVersionInfo.h +++ /dev/null @@ -1,44 +0,0 @@ -/*! @file - @brief COsVersionInfo - - OSVERSIONINFOをラッピング - - @author YAZAKI - @date 2002年3月3日 -*/ -/* - Copyright (C) 2001, YAZAKI, shoji masami - Copyright (C) 2002, YAZAKI, minfu - Copyright (C) 2003, genta - Copyright (C) 2005, ryoji - Copyright (C) 2006, ryoji - Copyright (C) 2007, ryoji - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; - you must not claim that you wrote the original software. - If you use this software in a product, an acknowledgment - in the product documentation would be appreciated but is - not required. - - 2. Altered source versions must be plainly marked as such, - and must not be misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*/ - -#ifndef _COSVERSIONINFO_H_ -#define _COSVERSIONINFO_H_ - - -#endif - - From 1b81d4655bf940415d33143de0800acf85467fd3 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 23:29:08 +0900 Subject: [PATCH 17/23] =?UTF-8?q?=E8=A6=81=E3=82=89=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=9FGetProcAddress=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 対象OSをwin7に上げたことで不要になったGetProcAddressを除去します。 --- sakura_core/_main/WinMain.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/sakura_core/_main/WinMain.cpp b/sakura_core/_main/WinMain.cpp index abd2551cf3..93629731f8 100644 --- a/sakura_core/_main/WinMain.cpp +++ b/sakura_core/_main/WinMain.cpp @@ -61,19 +61,9 @@ int WINAPI _tWinMain( MY_RUNNINGTIMER(cRunningTimer, "WinMain" ); { // 2014.04.24 DLLの検索パスからカレントディレクトリを削除する - HMODULE kernel32 = GetModuleHandleA( "KERNEL32" ); - if( kernel32 ){ - typedef BOOL (WINAPI* Proc_pfnSetDllDirectoryW)(LPCWSTR); - Proc_pfnSetDllDirectoryW pfnSetDllDirectoryW = (Proc_pfnSetDllDirectoryW)GetProcAddress( kernel32, "SetDllDirectoryW" ); - if( pfnSetDllDirectoryW ){ - pfnSetDllDirectoryW( L"" ); - } - typedef BOOL (WINAPI* Proc_pfnSetSearchPathMode)(DWORD); - Proc_pfnSetSearchPathMode pfnSetSearchPathMode = (Proc_pfnSetSearchPathMode)GetProcAddress( kernel32, "SetSearchPathMode" ); - if( pfnSetSearchPathMode ){ - pfnSetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); - } - } + ::SetDllDirectory( _T("") ); + ::SetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); + // 2010.08.28 Moca DLLインジェクション対策 CCurrentDirectoryBackupPoint dirBack; ChangeCurrentDirectoryToExeDir(); From 24d519fdd364bc17444c4313e5f25a7e751ac77c Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 23:32:10 +0900 Subject: [PATCH 18/23] =?UTF-8?q?=E5=AE=9F=E5=8A=B9=E6=80=A7=E3=81=AE?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RAIIクラスを使ったパス移動は、無名スコープを抜ける際に解除されるので意味がありません。 カレントディレクトリに変更は比較的重たいので無駄と分かって残しておく意味はないと思われます。 --- sakura_core/_main/WinMain.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sakura_core/_main/WinMain.cpp b/sakura_core/_main/WinMain.cpp index 93629731f8..bbe6de62e2 100644 --- a/sakura_core/_main/WinMain.cpp +++ b/sakura_core/_main/WinMain.cpp @@ -64,10 +64,6 @@ int WINAPI _tWinMain( ::SetDllDirectory( _T("") ); ::SetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); - // 2010.08.28 Moca DLLインジェクション対策 - CCurrentDirectoryBackupPoint dirBack; - ChangeCurrentDirectoryToExeDir(); - setlocale( LC_ALL, "Japanese" ); //2007.08.16 kobake 追加 ::OleInitialize( NULL ); // 2009.01.07 ryoji 追加 } From 05f6df45da884c6dabf8040b51fdb3d1107d8e24 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sat, 13 Oct 2018 23:43:54 +0900 Subject: [PATCH 19/23] =?UTF-8?q?CHtmlHelp=E3=82=92=E4=BB=96=E5=AE=9F?= =?UTF-8?q?=E8=A3=85=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 他のCDllImp派生クラスと実装が異なっていた。 HtmlHelpはwindows SDKに定義がある特殊な外部関数なので、 windows SDKの定義とCDllImp実装の両方の特性を活かせるように実装し直します。 --- sakura_core/extmodule/CHtmlHelp.cpp | 21 ++++++++++++--------- sakura_core/extmodule/CHtmlHelp.h | 21 +++++++++++++++++---- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/sakura_core/extmodule/CHtmlHelp.cpp b/sakura_core/extmodule/CHtmlHelp.cpp index 2f081c2b54..b866a14270 100644 --- a/sakura_core/extmodule/CHtmlHelp.cpp +++ b/sakura_core/extmodule/CHtmlHelp.cpp @@ -33,8 +33,10 @@ #include "StdAfx.h" #include "CHtmlHelp.h" -CHtmlHelp::~CHtmlHelp(void) -{} +CHtmlHelp::CHtmlHelp(void) noexcept + : m_pfnHtmlHelp(nullptr) +{ +} /*! HTML Help のファイル名を渡す @@ -46,14 +48,15 @@ LPCTSTR CHtmlHelp::GetDllNameImp(int nIndex) bool CHtmlHelp::InitDllImp() { - if((HtmlHelp = (Proc_HtmlHelp)::GetProcAddress(GetInstance(), -#ifdef _UNICODE - "HtmlHelpW" -#else - "HtmlHelpA" -#endif - )) == NULL ) + //DLL内関数名リスト + const ImportTable table[] = { + { m_pfnHtmlHelp, "HtmlHelpW" }, + { NULL, 0 } + }; + + if (!RegisterEntries(table)) { return false; + } return true; } diff --git a/sakura_core/extmodule/CHtmlHelp.h b/sakura_core/extmodule/CHtmlHelp.h index 8977986268..6915ad69fe 100644 --- a/sakura_core/extmodule/CHtmlHelp.h +++ b/sakura_core/extmodule/CHtmlHelp.h @@ -43,12 +43,25 @@ */ class CHtmlHelp : public CDllImp { public: - CHtmlHelp(){} - virtual ~CHtmlHelp(); + CHtmlHelp() noexcept; + virtual ~CHtmlHelp() noexcept = default; +protected: // HtmlHelp のEntry Point - typedef HWND (WINAPI* Proc_HtmlHelp)(HWND, LPCTSTR, UINT, DWORD_PTR); - Proc_HtmlHelp HtmlHelp; + typedef decltype(::HtmlHelp)* FnPtr_HtmlHelp; + + FnPtr_HtmlHelp m_pfnHtmlHelp; + +public: + inline HWND WINAPI HtmlHelp( + _In_opt_ HWND hwndCaller, + _In_ LPCWSTR pszFile, + _In_ UINT uCommand, + _In_ DWORD_PTR dwData + ) const noexcept + { + return m_pfnHtmlHelp(hwndCaller, pszFile, uCommand, dwData); + } protected: virtual bool InitDllImp(); From 1094464e6e0aaafa95c56cbf9875ef9928bffdb3 Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 14 Oct 2018 13:14:46 +0900 Subject: [PATCH 20/23] =?UTF-8?q?=E5=8F=A4=E3=81=84OS=E5=90=91=E3=81=91?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 単にチェックの有無で倍率設定を切り替える処理となっている。 --- sakura_core/print/CPrintPreview.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/sakura_core/print/CPrintPreview.cpp b/sakura_core/print/CPrintPreview.cpp index e494a91791..aef6c9f853 100644 --- a/sakura_core/print/CPrintPreview.cpp +++ b/sakura_core/print/CPrintPreview.cpp @@ -400,8 +400,6 @@ LRESULT CPrintPreview::OnSize( WPARAM wParam, LPARAM lParam ) ::DeleteObject( m_hbmpCompatBMP ); } // 2007.02.11 Moca プレビューを滑らかにする - // Win9xでは 巨大なBMPは作成できないことと - // StretchBltでSTRETCH_HALFTONEが未サポートであるので Win2K 以上のみで有効にする。 if( BST_CHECKED == ::IsDlgButtonChecked( m_hwndPrintPreviewBar, IDC_CHECK_ANTIALIAS ) ){ m_nbmpCompatScale = COMPAT_BMP_SCALE; }else{ From 185e68efe2ecdcb436f133c7f3cdbd46ba3db17b Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 14 Oct 2018 13:23:26 +0900 Subject: [PATCH 21/23] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E9=85=8D=E5=88=97?= =?UTF-8?q?=E3=81=ABstd::vector=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E3=82=84=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dx配列の導出用にstd::vectorを使っていたが、ここの処理では文字列長が固定なので動的サイズ変更しなくてよかった。 --- sakura_core/window/CEditWnd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index f1619967dc..b48c99474b 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -4048,18 +4048,18 @@ void CEditWnd::PrintMenubarMessage( const TCHAR* msg ) const ULONG cchText = nStrLen; const INT nMaxExtent = rc.right - rc.left; const DWORD dwFlags = ::GetFontLanguageInfo(hdc); - std::vector vDx(cchText, 0); + INT vDx[MENUBAR_MESSAGE_MAX_LEN] = { 0 }; std::wstring strGlyphs(::MulDiv(cchText, 3, 2) + 16, '\0'); GCP_RESULTS results = { sizeof(GCP_RESULTS) }; - results.lpDx = vDx.data(); + results.lpDx = vDx; results.lpGlyphs = &*strGlyphs.begin(); results.nGlyphs = strGlyphs.size(); results.nMaxFit = cchText; auto placement = ::GetCharacterPlacement(hdc, pchText, cchText, nMaxExtent, &results, dwFlags); if (placement != NULL) { - ::ExtTextOut(hdc, rc.left, rc.top, ETO_CLIPPED | ETO_OPAQUE, &rc, m_pszMenubarMessage, nStrLen, &*vDx.begin()); + ::ExtTextOut(hdc, rc.left, rc.top, ETO_CLIPPED | ETO_OPAQUE, &rc, m_pszMenubarMessage, nStrLen, vDx); } } ::SelectObject( hdc, hFontOld ); From 3e54587e17e2be7209356effec7eb4b61edc056e Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 14 Oct 2018 19:10:48 +0900 Subject: [PATCH 22/23] =?UTF-8?q?std::wstring=E3=82=92std::unique=5Fptr?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit グリフインデックスの受取バッファにstd::wstringを使っていたが、stringの機能は全く使わないので単なるバッファに変更する。 --- sakura_core/window/CEditWnd.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index b48c99474b..ec4d6703d1 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -4003,7 +4003,7 @@ void CEditWnd::InitMenubarMessageFont(void) @brief メニューバーにメッセージを表示する 事前にメニューバー表示用フォントが初期化されていなくてはならない. - 指定できる文字数は最大30バイト.それ以上の場合はうち切って表示する. + 指定できる文字数は最大30文字.それ以上の場合はうち切って表示する. @author genta @date 2002.12.04 @@ -4049,12 +4049,13 @@ void CEditWnd::PrintMenubarMessage( const TCHAR* msg ) const INT nMaxExtent = rc.right - rc.left; const DWORD dwFlags = ::GetFontLanguageInfo(hdc); INT vDx[MENUBAR_MESSAGE_MAX_LEN] = { 0 }; - std::wstring strGlyphs(::MulDiv(cchText, 3, 2) + 16, '\0'); + const ULONG cchGlyphs = ::MulDiv(cchText, 3, 2) + 16; + auto pchGlyphs = std::make_unique( cchGlyphs ); // エラーグリフの増分を加味した領域を確保 GCP_RESULTS results = { sizeof(GCP_RESULTS) }; results.lpDx = vDx; - results.lpGlyphs = &*strGlyphs.begin(); - results.nGlyphs = strGlyphs.size(); + results.lpGlyphs = pchGlyphs.get(); + results.nGlyphs = cchGlyphs; results.nMaxFit = cchText; auto placement = ::GetCharacterPlacement(hdc, pchText, cchText, nMaxExtent, &results, dwFlags); From 8ca781977db3218bc11867d066fc57bb61e9844e Mon Sep 17 00:00:00 2001 From: berryplus Date: Sun, 14 Oct 2018 21:49:05 +0900 Subject: [PATCH 23/23] =?UTF-8?q?std::unique=5Fptr=E3=82=92=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E9=85=8D=E5=88=97=E3=81=AB=E5=A4=89=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 確保量が毎回同じで、かつ、小さいのでスタックに積んで動的確保のコストを削る。 --- sakura_core/window/CEditWnd.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sakura_core/window/CEditWnd.cpp b/sakura_core/window/CEditWnd.cpp index ec4d6703d1..5b655caed9 100644 --- a/sakura_core/window/CEditWnd.cpp +++ b/sakura_core/window/CEditWnd.cpp @@ -4049,13 +4049,12 @@ void CEditWnd::PrintMenubarMessage( const TCHAR* msg ) const INT nMaxExtent = rc.right - rc.left; const DWORD dwFlags = ::GetFontLanguageInfo(hdc); INT vDx[MENUBAR_MESSAGE_MAX_LEN] = { 0 }; - const ULONG cchGlyphs = ::MulDiv(cchText, 3, 2) + 16; - auto pchGlyphs = std::make_unique( cchGlyphs ); // エラーグリフの増分を加味した領域を確保 + WCHAR vGlyphs[(MENUBAR_MESSAGE_MAX_LEN * 3 / 2) + 16]; // エラーグリフの増分を加味した領域を確保 GCP_RESULTS results = { sizeof(GCP_RESULTS) }; results.lpDx = vDx; - results.lpGlyphs = pchGlyphs.get(); - results.nGlyphs = cchGlyphs; + results.lpGlyphs = vGlyphs; + results.nGlyphs = _countof(vGlyphs); results.nMaxFit = cchText; auto placement = ::GetCharacterPlacement(hdc, pchText, cchText, nMaxExtent, &results, dwFlags);