Permalink
Browse files

Add Pratform x64 and Fix Console-bug(thanks to rururu)

  • Loading branch information...
1 parent dc6317a commit 3f23a58223a79610376c3923888eb7c3f8009589 @deflis committed Jul 18, 2010
Showing with 191 additions and 9 deletions.
  1. +7 −0 ChangeLog.txt
  2. +9 −0 ime_wrap.cpp
  3. +1 −0 ime_wrap.h
  4. +19 −6 main.cpp
  5. +1 −1 misc.cpp
  6. +5 −0 vc2008/ckw.sln
  7. +147 −0 vc2008/ckw.vcproj
  8. +2 −2 version.h
View
@@ -1,3 +1,10 @@
+
+2010-07-15 rururu
+ * x64でもビルド出来るように修正(VC2008)
+ * AllocConsoleのSW_HIDE処理にx64対応を追加(VC2008)
+ * 念の為にim32.dllを終了時に解放する様にした
+ * ショートカットからの起動でコマンドプロンプトが残る不具合を暫定修正
+
2010-06-19 deflis
Version 0.9.0-mod-d1
* コンソール隠しに失敗する場合のパッチをMichiru氏やnocd5氏のパッチを参考に書き直し。
View
@@ -94,8 +94,17 @@ BOOL ime_wrap_init()
fn_SetCompositionFontW = NULL;
fn_SetCompositionWindow = NULL;
FreeLibrary(gDll);
+ gDll = NULL;
}
return(result);
}
+void ime_wrap_term()
+{
+ if (gDll) {
+ FreeLibrary(gDll);
+ gDll = NULL;
+ }
+}
+
/* EOF */
View
@@ -2,6 +2,7 @@
#define __IME_WRAP_H__ 1
BOOL ime_wrap_init();
+void ime_wrap_term();
HIMC WINAPI ImmGetContext(HWND hwnd);
BOOL WINAPI ImmReleaseContext(HWND hwnd, HIMC imc);
View
@@ -898,6 +898,12 @@ static void __hide_alloc_console()
*/
#ifdef _MSC_VER
+#ifdef _WIN64
+ INT_PTR peb = *(INT_PTR*)((INT_PTR)NtCurrentTeb() + 0x60);
+ INT_PTR param = *(INT_PTR*) (peb + 0x20);
+ DWORD* pflags = (DWORD*) (param + 0xa4);
+ WORD* pshow = (WORD*) (param + 0xa8);
+#else
#ifndef _WINTERNL_
INT_PTR peb = *(INT_PTR*)((INT_PTR)NtCurrentTeb() + 0x30);
INT_PTR param = *(INT_PTR*) (peb + 0x10);
@@ -909,6 +915,7 @@ static void __hide_alloc_console()
DWORD* pflags = (DWORD*)((INT_PTR)param + 0x68);
WORD* pshow = (WORD*)((INT_PTR)param + 0x6C);
+#endif // _WIN64
#else
// for gcc
INT_PTR peb = *(INT_PTR*)((INT_PTR)NtCurrentTeb() + 0x30);
@@ -925,6 +932,11 @@ static void __hide_alloc_console()
/* check */
if(si.dwFlags == backup_flags && si.wShowWindow == backup_show) {
+ // 詳細は不明だがSTARTF_TITLEISLINKNAMEが立っていると、
+ // Console窓隠しに失敗するので除去(Win7-64bit)
+ if (*pflags & STARTF_TITLEISLINKNAME) {
+ *pflags &= ~STARTF_TITLEISLINKNAME;
+ }
*pflags |= STARTF_USESHOWWINDOW;
*pshow = SW_HIDE;
bResult = true;
@@ -964,12 +976,12 @@ static BOOL create_console(ckOpt& opt)
conf_title = opt.getTitle();
if(!conf_title || !conf_title[0]){
- title = L"ckw";
- }else{
- title = new wchar_t[ strlen(conf_title)+1 ];
- ZeroMemory(title, sizeof(wchar_t) * (strlen(conf_title)+1));
- MultiByteToWideChar(CP_ACP, 0, conf_title, (int)strlen(conf_title), title, (int)(sizeof(wchar_t) * (strlen(conf_title)+1)) );
- }
+ title = L"ckw";
+ }else{
+ title = new wchar_t[ strlen(conf_title)+1 ];
+ ZeroMemory(title, sizeof(wchar_t) * (strlen(conf_title)+1));
+ MultiByteToWideChar(CP_ACP, 0, conf_title, (int)strlen(conf_title), title, (int)(sizeof(wchar_t) * (strlen(conf_title)+1)) );
+ }
__hide_alloc_console();
@@ -1163,6 +1175,7 @@ static void _terminate()
SAFE_DeleteObject(gFont);
SAFE_DeleteObject(gBgBrush);
SAFE_DeleteObject(gBgBmp);
+ ime_wrap_term();
}
#ifdef _DEBUG
View
@@ -228,7 +228,7 @@ void onDropFile(HDROP hDrop)
}
/*----------*/
-BOOL CALLBACK AboutDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
+INT_PTR CALLBACK AboutDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
{
switch(msg) {
case WM_INITDIALOG:
View
@@ -6,13 +6,18 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EB44C1CD-BE69-448B-8305-0706053C620B}.Debug|Win32.ActiveCfg = Debug|Win32
{EB44C1CD-BE69-448B-8305-0706053C620B}.Debug|Win32.Build.0 = Debug|Win32
+ {EB44C1CD-BE69-448B-8305-0706053C620B}.Debug|x64.ActiveCfg = Debug|Win32
+ {EB44C1CD-BE69-448B-8305-0706053C620B}.Debug|x64.Build.0 = Debug|Win32
{EB44C1CD-BE69-448B-8305-0706053C620B}.Release|Win32.ActiveCfg = Release|Win32
{EB44C1CD-BE69-448B-8305-0706053C620B}.Release|Win32.Build.0 = Release|Win32
+ {EB44C1CD-BE69-448B-8305-0706053C620B}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -157,6 +160,150 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="&quot;$(InputDir)..\version.bat&quot; &gt; &quot;$(InputDir)..\version.h&quot;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib"
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="&quot;$(InputDir)..\version.bat&quot; &gt; &quot;$(InputDir)..\version.h&quot;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib"
+ GenerateDebugInformation="true"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
View
@@ -3,6 +3,6 @@
#define VERSION_BUGFIX 0
#define VERSION_STRING "0.9.0-mod-d1"
#define VERSION_NUMSTRING "009001"
-#define BUILDDATE_STRING "2010/06/19 20:31:15 UTC+9"
+#define BUILDDATE_STRING "2010/07/18 13:01:31 UTC+9"
#define COPYRIGHT_STRING "Copyright (C) 2005-2010 Kazuo Ishii and hideden and shuujin and s-yata and Shimizukawa and Deflis and nocd5 and craftware"
-#define ABOUT_DLG_STRING "ckw version 0.9.0-mod+git-d1 , build 2010/06/19 20:31:15 UTC+9\r\nCopyright (C) 2005-2010 Kazuo Ishii and ckw-moders"
+#define ABOUT_DLG_STRING "ckw version 0.9.0-mod+git-d1 , build 2010/07/18 13:01:31 UTC+9\r\nCopyright (C) 2005-2010 Kazuo Ishii and ckw-moders"

0 comments on commit 3f23a58

Please sign in to comment.