OSDN Git Service

Change icon.ico. And fix icon bug, write ChangeLog.txt.
[ckw/ckw.git] / main.cpp
index 365726d..1bc49fc 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -769,7 +769,7 @@ static BOOL create_window(ckOpt& opt)
        wc.hbrBackground = CreateSolidBrush(gColorTable[0]);
        wc.lpszMenuName = NULL;
        wc.lpszClassName = className;
-       wc.hIconSm = wc.hIcon;
+       wc.hIconSm = NULL;
        if(! RegisterClassEx(&wc))
                return(FALSE);
 
@@ -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) {
+               // \8fÚ\8d×\82Í\95s\96¾\82¾\82ªSTARTF_TITLEISLINKNAME\82ª\97§\82Á\82Ä\82¢\82é\82Æ\81A
+               // Console\91\8b\89B\82µ\82É\8e¸\94s\82·\82é\82Ì\82Å\8f\9c\8b\8e(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