diff --git a/resource/cursor_hand.cur b/resource/cursor_hand.cur deleted file mode 100644 index f0aa6f8cda..0000000000 Binary files a/resource/cursor_hand.cur and /dev/null differ diff --git a/sakura/sakura.vcxproj b/sakura/sakura.vcxproj index 28e76f162f..e6c92bd23e 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 @@ -572,7 +572,6 @@ - @@ -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/CSelectLang.cpp b/sakura_core/CSelectLang.cpp index 849e8fc640..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 @@ -403,21 +402,7 @@ HINSTANCE CSelectLang::ChangeLang( UINT nIndex ) m_psLangInfo = psLangInfo; // ロケールを設定 - // SetThreadUILanguageの呼び出しを試みる - bool isSuccess = false; - if( COsVersionInfo()._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/Makefile b/sakura_core/Makefile index 6e12fdb266..d60cacf28f 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) @@ -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/_main/CProcessFactory.cpp b/sakura_core/_main/CProcessFactory.cpp index ca75bfa118..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" @@ -134,52 +133,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; } diff --git a/sakura_core/_main/WinMain.cpp b/sakura_core/_main/WinMain.cpp index c0da604e73..bbe6de62e2 100644 --- a/sakura_core/_main/WinMain.cpp +++ b/sakura_core/_main/WinMain.cpp @@ -61,24 +61,8 @@ 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 ){ - 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 ); - } - } - // 2010.08.28 Moca DLLインジェクション対策 - CCurrentDirectoryBackupPoint dirBack; - ChangeCurrentDirectoryToExeDir(); + ::SetDllDirectory( _T("") ); + ::SetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); setlocale( LC_ALL, "Japanese" ); //2007.08.16 kobake 追加 ::OleInitialize( NULL ); // 2009.01.07 ryoji 追加 diff --git a/sakura_core/_os/COsVersionInfo.cpp b/sakura_core/_os/COsVersionInfo.cpp deleted file mode 100644 index 0b1812d592..0000000000 --- a/sakura_core/_os/COsVersionInfo.cpp +++ /dev/null @@ -1,69 +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" -#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 deleted file mode 100644 index 0c7b11627c..0000000000 --- a/sakura_core/_os/COsVersionInfo.h +++ /dev/null @@ -1,284 +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_ - -#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 - -#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 -} - -inline bool IsWine() { - return COsVersionInfo()._IsWine(); -} - -#endif - - diff --git a/sakura_core/apiwrap/StdApi.cpp b/sakura_core/apiwrap/StdApi.cpp index af2a0eafe5..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; @@ -276,14 +275,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/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..4201adef8d 100644 --- a/sakura_core/cmd/CViewCommander_Edit_advanced.cpp +++ b/sakura_core/cmd/CViewCommander_Edit_advanced.cpp @@ -29,20 +29,10 @@ #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 -#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 */ void CViewCommander::Command_INDENT( wchar_t wcChar, EIndentType eIndent ) @@ -965,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さんの情報 */ @@ -979,26 +968,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) ){ @@ -1007,13 +977,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() ); @@ -1031,21 +994,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/cmd/CViewCommander_TagJump.cpp b/sakura_core/cmd/CViewCommander_TagJump.cpp index b4faa4a655..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" @@ -473,7 +472,6 @@ bool CViewCommander::Command_TagsMake( void ) _tcscat( options, _T(" *") ); //配下のすべてのファイル //コマンドライン文字列作成(MAX:1024) - if (IsWin32NT()) { // 2010.08.28 Moca システムディレクトリ付加 TCHAR szCmdDir[_MAX_PATH]; @@ -486,18 +484,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/config/system_constants.h b/sakura_core/config/system_constants.h index b190d30585..ed4ec922b2 100644 --- a/sakura_core/config/system_constants.h +++ b/sakura_core/config/system_constants.h @@ -751,35 +751,6 @@ 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/dlg/CDlgOpenFile.cpp b/sakura_core/dlg/CDlgOpenFile.cpp index 7dd871d615..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" @@ -479,14 +478,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/env/CFileNameManager.cpp b/sakura_core/env/CFileNameManager.cpp index 11c52353ba..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" // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // // ファイル名管理 // @@ -525,7 +524,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/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(); 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/print/CPrintPreview.cpp b/sakura_core/print/CPrintPreview.cpp index f92bba71db..aef6c9f853 100644 --- a/sakura_core/print/CPrintPreview.cpp +++ b/sakura_core/print/CPrintPreview.cpp @@ -400,10 +400,7 @@ 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 ) && - 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 +2125,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/CMenuDrawer.cpp b/sakura_core/uiparts/CMenuDrawer.cpp index f7e21aa6c7..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" // メニューアイコンの背景をボタンの色にする @@ -844,7 +843,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 +854,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/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..c5df9a0131 100644 --- a/sakura_core/uiparts/HandCursor.h +++ b/sakura_core/uiparts/HandCursor.h @@ -31,24 +31,10 @@ #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" - -#ifndef IDC_HAND -#define IDC_HAND MAKEINTRESOURCE(32649) -#endif 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_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/shell.cpp b/sakura_core/util/shell.cpp index f5f7aa86b2..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" @@ -308,11 +307,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; 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..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" @@ -62,9 +61,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 ); @@ -157,10 +153,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) { } @@ -256,28 +250,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; @@ -443,10 +415,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; @@ -854,7 +822,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 ){ @@ -868,7 +836,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 ); @@ -942,22 +911,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/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 9f60a52402..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" @@ -243,18 +242,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 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..5b655caed9 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" @@ -76,17 +75,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 /* ウィンドウ内の枠と紙の隙間最小値 */ @@ -212,8 +200,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] ) @@ -506,19 +492,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 { // 初回表示のアニメーション効果を抑止する @@ -756,7 +729,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 ){ // 返事が返らない @@ -4030,7 +4003,7 @@ void CEditWnd::InitMenubarMessageFont(void) @brief メニューバーにメッセージを表示する 事前にメニューバー表示用フォントが初期化されていなくてはならない. - 指定できる文字数は最大30バイト.それ以上の場合はうち切って表示する. + 指定できる文字数は最大30文字.それ以上の場合はうち切って表示する. @author genta @date 2002.12.04 @@ -4069,17 +4042,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); + INT vDx[MENUBAR_MESSAGE_MAX_LEN] = { 0 }; + WCHAR vGlyphs[(MENUBAR_MESSAGE_MAX_LEN * 3 / 2) + 16]; // エラーグリフの増分を加味した領域を確保 + + GCP_RESULTS results = { sizeof(GCP_RESULTS) }; + results.lpDx = vDx; + results.lpGlyphs = vGlyphs; + results.nGlyphs = _countof(vGlyphs); + 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); + } + } ::SelectObject( hdc, hFontOld ); ::ReleaseDC( GetHwnd(), hdc ); } @@ -4885,7 +4867,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 @@ -4899,7 +4881,7 @@ void CEditWnd::CreateAccelTbl( void ) } } - m_hAccel = m_hAccelWine ? m_hAccelWine : m_pShareData->m_sHandles.m_hAccel; + m_hAccel = m_hAccelWine; } /*! ウィンドウ毎に作成したアクセラレータテーブルを破棄する 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; 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" 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 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"