マウスカーソルへIMEモードの表示
Revision | 59eb3c80f1ff1b5a0198d11975aacc2639dd9752 (tree) |
---|---|
Time | 2023-06-24 16:07:57 |
Author | JeffyTS <jeffyts@outl...> |
Commiter | JeffyTS |
1.0.2.6
@@ -14,7 +14,7 @@ | ||
14 | 14 | #include "Cursor.h" |
15 | 15 | #include "CommonDef.h" |
16 | 16 | #include "FlushMouseLIB.h" |
17 | -#include "..\FlushMouseCursor\Resource.h" | |
17 | +#include "..\FlushMouseDLL\EventlogDll.h" | |
18 | 18 | #include "..\MiscLIB\CRegistry.h" |
19 | 19 | |
20 | 20 | // |
@@ -1131,6 +1131,11 @@ BOOL CCursor::bSetSystemCursor(LPMOUSECURSOR lpstMC, int iCursorSizeX, int iCur | ||
1131 | 1131 | fuLoad = (LR_VGACOLOR | LR_DEFAULTSIZE | LR_DEFAULTCOLOR | LR_CREATEDIBSECTION); |
1132 | 1132 | if ((hCur = (HCURSOR)LoadImage((HINSTANCE)hMod, MAKEINTRESOURCE(lpstMC->uResourceID), |
1133 | 1133 | IMAGE_CURSOR, iCursorSizeX, iCursorSizeY, fuLoad)) == NULL) { |
1134 | + _Post_equals_last_error_ DWORD err = GetLastError(); | |
1135 | + if (err == ERROR_MOD_NOT_FOUND) { | |
1136 | + bReportEvent(MSG_RESTART_EVENT, APPLICATION_CATEGORY); | |
1137 | + PostMessage(hMainWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); | |
1138 | + } | |
1134 | 1139 | if (!bCursorDllUnload()) return FALSE; |
1135 | 1140 | return FALSE; |
1136 | 1141 | } |
@@ -85,18 +85,18 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
85 | 85 | int iRet = 0; |
86 | 86 | if ((iRet = CompareStringOrdinal(lpCmdLine, -1, L"/quit", -1, TRUE)) != 0) { |
87 | 87 | if (iRet == CSTR_EQUAL) { |
88 | - bReportEvent(MSG_DONE_FLUSHMOUSE, APPLICATION_CATEGORY); // Eventlog | |
88 | + bReportEvent(MSG_DONE_FLUSHMOUSE, Installer_CATEGORY); | |
89 | 89 | HWND hWnd = NULL; |
90 | - if ((hWnd = FindWindow(CLASS_FLUSHMOUSE, NULL)) != NULL) { // 先に起動されているウィンドウハンドルを探す | |
91 | - SetFocus(GetLastActivePopup(hWnd)); // 先に起動されているウィンドウへフォーカスを与える | |
92 | - PostMessage(hWnd, WM_DESTROY, NULL, NULL); // 先に起動されているウィンドウを終了させる | |
90 | + if ((hWnd = FindWindow(CLASS_FLUSHMOUSE, NULL)) != NULL) { | |
91 | + SetFocus(GetLastActivePopup(hWnd)); | |
92 | + PostMessage(hWnd, WM_DESTROY, NULL, NULL); | |
93 | 93 | for (int i = 3; i > 0; i--) { |
94 | - Sleep(500); // 終了を3回待つ | |
94 | + Sleep(500); | |
95 | 95 | if ((hWnd = FindWindow(CLASS_FLUSHMOUSE, NULL)) != NULL) { |
96 | - SetFocus(GetLastActivePopup(hWnd)); // 先に起動されているウィンドウへフォーカスを与える | |
97 | - PostMessage(hWnd, WM_DESTROY, NULL, NULL); // 先に起動されているウィンドウを終了させる | |
96 | + SetFocus(GetLastActivePopup(hWnd)); | |
97 | + PostMessage(hWnd, WM_DESTROY, NULL, NULL); | |
98 | 98 | if (i == 1) { |
99 | - return (-1); // 終了していない場合はエラー終了 | |
99 | + return (-1); | |
100 | 100 | } |
101 | 101 | } |
102 | 102 | else return 0; |
@@ -116,7 +116,6 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
116 | 116 | } |
117 | 117 | if (!bWinMain(hInstance, hPrevInstance)) return (-1); |
118 | 118 | |
119 | - // メイン メッセージ ループ: | |
120 | 119 | MSG msg{}; |
121 | 120 | while (GetMessage(&msg, NULL, 0, 0)) { |
122 | 121 | HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_FLUSHMOUSE)); |
@@ -139,7 +138,7 @@ BOOL bSetHeapInformation() | ||
139 | 138 | ULONG HeapInformation = 2; |
140 | 139 | if (!HeapSetInformation(hHeap, HeapCompatibilityInformation, &HeapInformation, sizeof(ULONG))) { |
141 | 140 | _Post_equals_last_error_ DWORD err = GetLastError(); |
142 | - if (err != ERROR_INVALID_PARAMETER) { // 87 (0x57) | |
141 | + if (err != ERROR_INVALID_PARAMETER) { | |
143 | 142 | return FALSE; |
144 | 143 | } |
145 | 144 | } |
@@ -199,35 +198,35 @@ static INT_PTR CALLBACK AboutDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM | ||
199 | 198 | { |
200 | 199 | RECT rc{}; |
201 | 200 | int cx = 0, cy = 0; |
202 | - cx = GetSystemMetrics(SM_CXSCREEN); // スクリーンサイズの取得 | |
201 | + cx = GetSystemMetrics(SM_CXSCREEN); | |
203 | 202 | cy = GetSystemMetrics(SM_CYSCREEN); |
204 | - GetWindowRect(hDlg, (LPRECT)&rc); // 子ウィンドウのスクリーン座標を取得 | |
205 | - rc.right = rc.right - rc.left + 1; // 中央の計算 | |
203 | + GetWindowRect(hDlg, (LPRECT)&rc); | |
204 | + rc.right = rc.right - rc.left + 1; | |
206 | 205 | rc.bottom = rc.bottom - rc.top + 1; |
207 | 206 | rc.left = (cx - rc.right) / 2; |
208 | 207 | rc.top = (cy - rc.bottom) / 2; |
209 | - MoveWindow(hDlg, rc.left, rc.top, rc.right, rc.bottom, TRUE); // 移動 | |
208 | + MoveWindow(hDlg, rc.left, rc.top, rc.right, rc.bottom, TRUE); | |
210 | 209 | HICON hIcon = NULL; |
211 | 210 | hIcon = (HICON)LoadImage(Resource->hLoad(), MAKEINTRESOURCE(IDI_SMALL), IMAGE_ICON, 16, 16, 0); |
212 | - SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); // Iconの設定 | |
211 | + SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); | |
213 | 212 | LPTSTR lpszVersion = new TCHAR[MAX_LOADSTRING]; |
214 | 213 | ZeroMemory(lpszVersion, (sizeof(TCHAR) * MAX_LOADSTRING)); |
215 | 214 | if (lpszVersion) { |
216 | 215 | ZeroMemory(lpszVersion, (sizeof(TCHAR) * MAX_LOADSTRING)); |
217 | 216 | _sntprintf_s(lpszVersion, MAX_LOADSTRING, _TRUNCATE, _T("%d.%d.%d.%d"), MAJOR_VERSION, MINOR_VERSION, BUILD_VERSION, REVISON_VERSION); |
218 | - SetDlgItemText(hDlg, IDC_VERSION, lpszVersion); // Versionの設定 | |
217 | + SetDlgItemText(hDlg, IDC_VERSION, lpszVersion); | |
219 | 218 | delete[] lpszVersion; |
220 | 219 | } |
221 | 220 | else return (INT_PTR)FALSE; |
222 | 221 | } |
223 | 222 | return (INT_PTR)TRUE; |
224 | 223 | case WM_CTLCOLORDLG: |
225 | - return (INT_PTR)GetStockObject(WHITE_BRUSH); // 背景の色 | |
224 | + return (INT_PTR)GetStockObject(WHITE_BRUSH); | |
226 | 225 | case WM_CTLCOLORSTATIC: |
227 | 226 | case WM_CTLCOLOREDIT: |
228 | 227 | SetBkMode(((HDC)wParam), TRANSPARENT); |
229 | - SetTextColor(((HDC)wParam), RGB(0, 0, 0)); // 文字の色 | |
230 | - return (INT_PTR)GetStockObject(WHITE_BRUSH); // 背景の色 | |
228 | + SetTextColor(((HDC)wParam), RGB(0, 0, 0)); | |
229 | + return (INT_PTR)GetStockObject(WHITE_BRUSH); | |
231 | 230 | case WM_COMMAND: |
232 | 231 | if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { |
233 | 232 | EndDialog(hDlg, LOWORD(wParam)); |
@@ -109,6 +109,7 @@ static void Cls_OnLButtonUpEx(HWND hWnd, int x, int y, HWND hForeground); | ||
109 | 109 | static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UINT flags); |
110 | 110 | static void Cls_OnEventForegroundEx(HWND hWnd, DWORD dwEvent, HWND hForeWnd); |
111 | 111 | static void Cls_OnCheckIMEStartConvertingEx(HWND hWnd, BOOL bStartConversioning, DWORD vkCode); |
112 | +static void Cls_OnCheckExistingJPIMEEx(HWND hWnd, BOOL bEPHelper); | |
112 | 113 | |
113 | 114 | // Sub |
114 | 115 | static BOOL bSendInputSub(UINT cInputs, LPINPUT pInputs); |
@@ -240,6 +241,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l | ||
240 | 241 | HANDLE_MSG(hWnd, WM_POWERBROADCAST, Cls_OnPowerBroadcast); |
241 | 242 | HANDLE_MSG(hWnd, WM_EVENT_SYSTEM_FOREGROUNDEX, Cls_OnEventForegroundEx); |
242 | 243 | HANDLE_MSG(hWnd, WM_CHECKIMESTARTCONVEX, Cls_OnCheckIMEStartConvertingEx); |
244 | + HANDLE_MSG(hWnd, WM_CHECKEXISTINGJPIMEEX, Cls_OnCheckExistingJPIMEEx); | |
243 | 245 | break; |
244 | 246 | |
245 | 247 | default: |
@@ -304,8 +306,12 @@ static BOOL Cls_OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct) | ||
304 | 306 | return FALSE; |
305 | 307 | } |
306 | 308 | |
307 | - if (bCheckExistingJPIME() && bEnableEPHelper) bForExplorerPatcherSWS(GetForegroundWindow(), FALSE, FALSE, NULL, NULL); | |
308 | - | |
309 | + if (bCheckExistingJPIME() && (bEnableEPHelper || bIMEModeForced)) { | |
310 | + bForExplorerPatcherSWS(GetForegroundWindow(), TRUE, bIMEModeForced, NULL, NULL); | |
311 | + } | |
312 | + | |
313 | + bReportEvent(MSG_START_SUCCEED, APPLICATION_CATEGORY); | |
314 | + | |
309 | 315 | return TRUE; |
310 | 316 | } |
311 | 317 |
@@ -345,6 +351,8 @@ static void Cls_OnDestroy(HWND hWnd) | ||
345 | 351 | Cime = NULL; |
346 | 352 | } |
347 | 353 | |
354 | + bReportEvent(MSG_QUIT_FLUSHMOUSE, APPLICATION_CATEGORY); | |
355 | + | |
348 | 356 | PostQuitMessage(0); |
349 | 357 | } |
350 | 358 |
@@ -487,19 +495,21 @@ static void Cls_OnEventForegroundEx(HWND hWnd, DWORD dwEvent, HWND hForeWnd) | ||
487 | 495 | return; |
488 | 496 | } |
489 | 497 | } |
490 | - if (bCheckExistingJPIME() && bEnableEPHelper) bForExplorerPatcherSWS(hWnd, FALSE, FALSE, NULL, NULL); // @@@ for Explorer Patcher Simple Window Switcher | |
498 | + if (bCheckExistingJPIME() && (bEnableEPHelper || bIMEModeForced)) { | |
499 | + bForExplorerPatcherSWS(hWnd, TRUE, bIMEModeForced, NULL, NULL); | |
500 | + } | |
491 | 501 | if (bOffChangedFocus) { |
492 | 502 | Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); |
493 | 503 | } |
494 | - if (!Cursor->bStartIMECursorChangeThread(hWndObserved)) return; // error | |
504 | + if (!Cursor->bStartIMECursorChangeThread(hWndObserved)) return; | |
495 | 505 | POINT pt{}; |
496 | 506 | if (GetCursorPos(&pt)) { |
497 | 507 | RECT rc{}; |
498 | 508 | if (FindWindow(L"Shell_TrayWnd", NULL) == GetForegroundWindow()) { |
499 | - if (bGetTaskTrayWindowRect(hWnd, &rc) == FALSE) return; // error | |
500 | - if (((pt.x >= rc.left) && (pt.x <= rc.right)) || ((pt.y <= rc.top) && (pt.y >= rc.bottom))) return; // Clicked on Notify Icon | |
509 | + if (bGetTaskTrayWindowRect(hWnd, &rc) == FALSE) return; | |
510 | + if (((pt.x >= rc.left) && (pt.x <= rc.right)) || ((pt.y <= rc.top) && (pt.y >= rc.bottom))) return; | |
501 | 511 | } |
502 | - if (!Cursor->bStartDrawIMEModeThread(hForeWnd)) return; // error | |
512 | + if (!Cursor->bStartDrawIMEModeThread(hForeWnd)) return; | |
503 | 513 | } |
504 | 514 | } |
505 | 515 | } |
@@ -587,7 +597,7 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
587 | 597 | } |
588 | 598 | break; |
589 | 599 | case KEY_IME_OFF: // IME OFF (0x1a) |
590 | - if (bIMEInConverting) return; | |
600 | + bIMEInConverting = FALSE; | |
591 | 601 | if (bEnableEPHelper || bIMEModeForced) { |
592 | 602 | if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { |
593 | 603 | Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); |
@@ -595,7 +605,7 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
595 | 605 | } |
596 | 606 | break; |
597 | 607 | case KEY_CONVERT: // JP(IME/ENG) 変換 (0x1c) |
598 | - bIMEInConverting = FALSE; | |
608 | + if (bIMEInConverting) return; | |
599 | 609 | if (bEnableEPHelper || bIMEModeForced) { |
600 | 610 | SetFocus(hForeWnd); |
601 | 611 | if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { |
@@ -795,6 +805,19 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
795 | 805 | } |
796 | 806 | |
797 | 807 | // |
808 | +// WM_CHECKEXISTINGJPIMEEX | |
809 | +// Cls_OnCheckExistingJPIMEEx() | |
810 | +// | |
811 | +void Cls_OnCheckExistingJPIMEEx(HWND hWnd, BOOL bEPHelper) | |
812 | +{ | |
813 | + UNREFERENCED_PARAMETER(hWnd); | |
814 | + UNREFERENCED_PARAMETER(bEPHelper); | |
815 | + if (!bSetEnableEPHelperLL64(bEPHelper)) { | |
816 | + PostMessage(hWnd, WM_DESTROY, (WPARAM)0, (LPARAM)0); | |
817 | + } | |
818 | +} | |
819 | + | |
820 | +// | |
798 | 821 | // bKBisEP() |
799 | 822 | // |
800 | 823 | static BOOL bKBisEP() |
@@ -968,7 +991,7 @@ BOOL bCheckExistingJPIME() | ||
968 | 991 | if (lpHKL) delete[] lpHKL; |
969 | 992 | } |
970 | 993 | } |
971 | - HWND hWnd = FindWindow(CLASS_FLUSHMOUSE32, NULL); | |
994 | + HWND hWnd = FindWindow(CLASS_FLUSHMOUSE, NULL); | |
972 | 995 | if (hWnd != NULL) PostMessage(hWnd, WM_CHECKEXISTINGJPIMEEX, (WPARAM)bRet, (LPARAM)NULL); |
973 | 996 | return bRet; |
974 | 997 | } |
@@ -1051,7 +1074,7 @@ BOOL bStartThreadHookTimer(HWND hWnd) | ||
1051 | 1074 | } |
1052 | 1075 | } |
1053 | 1076 | |
1054 | - HWND hFindWnd = FindWindow(CLASS_FLUSHMOUSE32, NULL); | |
1077 | + HWND hFindWnd = FindWindow(CLASS_FLUSHMOUSE, NULL); | |
1055 | 1078 | if (hFindWnd != NULL) { |
1056 | 1079 | if (bEnableEPHelper) { |
1057 | 1080 | PostMessage(hFindWnd, WM_CHECKEXISTINGJPIMEEX, (WPARAM)bEnableEPHelper, (LPARAM)NULL); |
@@ -1136,8 +1159,9 @@ static VOID CALLBACK vCheckProcTimerProc(HWND hWnd, UINT uMsg, UINT uTimerID, DW | ||
1136 | 1159 | |
1137 | 1160 | if (uTimerID == nCheckProcTimerID) { |
1138 | 1161 | if (FindWindow(CLASS_FLUSHMOUSE32, NULL) == NULL) { |
1139 | - bReportEvent(MSG_RESTART_EVENT, APPLICATION_CATEGORY); // 再起動する | |
1140 | - PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); // Quit | |
1162 | + bReportEvent(MSG_DETECT_FLUSHMOUSE_STOP, APPLICATION_CATEGORY); | |
1163 | + bReportEvent(MSG_RESTART_EVENT, APPLICATION_CATEGORY); | |
1164 | + PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); | |
1141 | 1165 | } |
1142 | 1166 | } |
1143 | 1167 | } |
@@ -119,22 +119,23 @@ BOOL bReCreateTaskTrayWindow(HWND hWnd, UINT message) | ||
119 | 119 | HICON hIcon = NULL; |
120 | 120 | if ((hIcon = LoadIcon(Resource->hLoad(), MAKEINTRESOURCE(IDI_FLUSHMOUSE))) != NULL) { |
121 | 121 | if (bCreateTaskTrayWindow(hWnd, hIcon, szTitle) == FALSE) { |
122 | - if (bDestroyTaskTrayWindow(hWnd)) { | |
123 | - bTaskTray = FALSE; | |
124 | - } | |
125 | - bReportEvent(MSG_RESTART_EVENT, APPLICATION_CATEGORY); | |
126 | - Sleep(100); | |
127 | - return TRUE; | |
128 | - } | |
129 | - else { | |
130 | 122 | bTaskTray = TRUE; |
131 | 123 | vStopThreadHookTimer(hWnd); |
132 | 124 | if (!bStartThreadHookTimer(hWnd)) { |
125 | + bReportEvent(MSG_THREAD_HOOK_TIMER_RESTART_FAILED, APPLICATION_CATEGORY);// Eventlog | |
133 | 126 | PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); |
134 | 127 | } |
135 | 128 | bReportEvent(MSG_THREAD_HOOK_TIMER_RESTARTED, APPLICATION_CATEGORY); |
136 | 129 | return TRUE; |
137 | 130 | } |
131 | + else { | |
132 | + if (bDestroyTaskTrayWindow(hWnd)) { | |
133 | + bTaskTray = FALSE; | |
134 | + } | |
135 | + bReportEvent(MSG_TASKTRAY_REGISTER_FAILD, APPLICATION_CATEGORY);// Eventlog | |
136 | + bReportEvent(MSG_RESTART_EVENT, APPLICATION_CATEGORY); | |
137 | + return TRUE; | |
138 | + } | |
138 | 139 | } |
139 | 140 | else { |
140 | 141 | return FALSE; |
@@ -163,11 +164,15 @@ BOOL bDestroyTaskTrayWindow(HWND hWnd) | ||
163 | 164 | bTaskTray = FALSE; |
164 | 165 | return TRUE; |
165 | 166 | } |
167 | + else { | |
168 | + return FALSE; | |
169 | + } | |
166 | 170 | } |
167 | 171 | catch (...) { |
172 | + return FALSE; | |
168 | 173 | } |
169 | 174 | } |
170 | - return FALSE; | |
175 | + return TRUE; | |
171 | 176 | } |
172 | 177 | |
173 | 178 | // |
@@ -559,19 +564,12 @@ BOOL CPowerNotification::PowerBroadcast(HWND hWnd, ULONG Type, POWERBROADCAST_S | ||
559 | 564 | UNREFERENCED_PARAMETER(lpSetting); |
560 | 565 | switch (Type) { |
561 | 566 | case PBT_APMSUSPEND: |
562 | - vStopThreadHookTimer(hWnd); | |
563 | 567 | bReportEvent(MSG_PBT_APMSUSPEND, POWERNOTIFICATION_CATEGORY); |
564 | - bReportEvent(MSG_THREAD_HOOK_TIMER_STOPPED, POWERNOTIFICATION_CATEGORY); | |
565 | 568 | break; |
566 | 569 | case PBT_APMRESUMEAUTOMATIC: |
567 | 570 | bReportEvent(MSG_PBT_APMRESUMEAUTOMATIC, POWERNOTIFICATION_CATEGORY); |
568 | 571 | break; |
569 | 572 | case PBT_APMRESUMESUSPEND: |
570 | - vGetSetProfileData(); | |
571 | - if (!bStartThreadHookTimer(hWnd)) { | |
572 | - PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); | |
573 | - } | |
574 | - bReportEvent(MSG_THREAD_HOOK_TIMER_STARTED, POWERNOTIFICATION_CATEGORY); | |
575 | 573 | bReportEvent(MSG_PBT_APMRESUMESUSPEND, POWERNOTIFICATION_CATEGORY); |
576 | 574 | break; |
577 | 575 | case PBT_POWERSETTINGCHANGE: |
@@ -584,13 +582,12 @@ BOOL CPowerNotification::PowerBroadcast(HWND hWnd, ULONG Type, POWERBROADCAST_S | ||
584 | 582 | switch (PowerStatus.ACLineStatus) { |
585 | 583 | case 0: |
586 | 584 | bReportEvent(MSG_PBT_APMPOWERSTATUSCHANGE_AC_OFF, POWERNOTIFICATION_CATEGORY); |
587 | - bDestroyTaskTrayWindow(hWnd); | |
585 | + Sleep(3000); | |
588 | 586 | bReportEvent(MSG_RESTART_EVENT, POWERNOTIFICATION_CATEGORY); |
587 | + bDestroyTaskTrayWindow(hWnd); | |
589 | 588 | break; |
590 | 589 | case 1: |
591 | 590 | bReportEvent(MSG_PBT_APMPOWERSTATUSCHANGE_AC_ON, POWERNOTIFICATION_CATEGORY); |
592 | - bReportEvent(MSG_RESTART_EVENT, POWERNOTIFICATION_CATEGORY); | |
593 | - PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); | |
594 | 591 | break; |
595 | 592 | default: |
596 | 593 | break; |
@@ -277,7 +277,7 @@ static VOID CALLBACK vCheckProcTimerProc(HWND hWnd, UINT uMsg, UINT uTimerID, DW | ||
277 | 277 | nIco.guidItem = GUID_NULL; |
278 | 278 | nIco.uFlags = 0; |
279 | 279 | try { |
280 | - throw Shell_NotifyIcon(NIM_DELETE, &nIco); // Delete TaskTray Icon | |
280 | + throw Shell_NotifyIcon(NIM_DELETE, &nIco); | |
281 | 281 | } |
282 | 282 | catch (BOOL bRet) { |
283 | 283 | if (!bRet) { |
@@ -287,8 +287,9 @@ static VOID CALLBACK vCheckProcTimerProc(HWND hWnd, UINT uMsg, UINT uTimerID, DW | ||
287 | 287 | catch (...) { |
288 | 288 | return; |
289 | 289 | } |
290 | - bReportEvent(MSG_RESTART_EVENT, APPLICATION32_CATEGORY); // FlushMouseが動いていないため再起動する | |
291 | - PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); // Quit | |
290 | + bReportEvent(MSG_DETECT_FLUSHMOUSE_STOP, APPLICATION32_CATEGORY); | |
291 | + bReportEvent(MSG_RESTART_EVENT, APPLICATION32_CATEGORY); | |
292 | + PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); | |
292 | 293 | } |
293 | 294 | } |
294 | 295 | return; |
@@ -320,8 +321,24 @@ static BOOL bReportEvent(DWORD dwEventID, WORD wCategory) | ||
320 | 321 | static void vMessageBox(HWND hWnd, UINT uID, UINT uType) |
321 | 322 | { |
322 | 323 | TCHAR lpText[MAX_LOADSTRING]; |
323 | - if (LoadString(hInst, uID, lpText, MAX_LOADSTRING) != 0) { | |
324 | - MessageBox(hWnd, lpText, szTitle, uType); | |
324 | + try { | |
325 | + throw LoadString(hInst, uID, lpText, MAX_LOADSTRING); | |
326 | + } | |
327 | + catch (int i) { | |
328 | + if (i != 0) { | |
329 | + try { | |
330 | + throw MessageBox(hWnd, lpText, szTitle, uType); | |
331 | + } | |
332 | + catch (int) { | |
333 | + return; | |
334 | + } | |
335 | + catch (...) { | |
336 | + return; | |
337 | + } | |
338 | + } | |
339 | + } | |
340 | + catch (...) { | |
341 | + return; | |
325 | 342 | } |
326 | 343 | } |
327 | 344 |
@@ -90,6 +90,15 @@ | ||
90 | 90 | #define DLL32_CATEGORY ((DWORD)0x00000003L) |
91 | 91 | |
92 | 92 | // |
93 | +// MessageId: Installer_CATEGORY | |
94 | +// | |
95 | +// MessageText: | |
96 | +// | |
97 | +// Installer Events | |
98 | +// | |
99 | +#define Installer_CATEGORY ((DWORD)0x00000004L) | |
100 | + | |
101 | +// | |
93 | 102 | // MessageId: POWERNOTIFICATION_CATEGORY |
94 | 103 | // |
95 | 104 | // MessageText: |
@@ -138,6 +147,15 @@ | ||
138 | 147 | #define MSG_THREAD_HOOK_TIMER_STARTED ((DWORD)0x40000002L) |
139 | 148 | |
140 | 149 | // |
150 | +// MessageId: MSG_THREAD_HOOK_TIMER_START_FAILED | |
151 | +// | |
152 | +// MessageText: | |
153 | +// | |
154 | +// Thread, Hook and Timer Start Failed. | |
155 | +// | |
156 | +#define MSG_THREAD_HOOK_TIMER_START_FAILED ((DWORD)0x40008002L) | |
157 | + | |
158 | +// | |
141 | 159 | // MessageId: MSG_THREAD_HOOK_TIMER_STOPPED |
142 | 160 | // |
143 | 161 | // MessageText: |
@@ -156,6 +174,15 @@ | ||
156 | 174 | #define MSG_THREAD_HOOK_TIMER_RESTARTED ((DWORD)0x40000004L) |
157 | 175 | |
158 | 176 | // |
177 | +// MessageId: MSG_THREAD_HOOK_TIMER_RESTART_FAILED | |
178 | +// | |
179 | +// MessageText: | |
180 | +// | |
181 | +// Thread, Hook and Timer Restart Failed. | |
182 | +// | |
183 | +#define MSG_THREAD_HOOK_TIMER_RESTART_FAILED ((DWORD)0x40008004L) | |
184 | + | |
185 | +// | |
159 | 186 | // MessageId: MSG_QUIT_FLUSHMOUSE |
160 | 187 | // |
161 | 188 | // MessageText: |
@@ -183,6 +210,33 @@ | ||
183 | 210 | #define MSG_DONE_FLUSHMOUSE ((DWORD)0x00000007L) |
184 | 211 | |
185 | 212 | // |
213 | +// MessageId: MSG_TASKTRAY_REGISTERED | |
214 | +// | |
215 | +// MessageText: | |
216 | +// | |
217 | +// Registered TaskTray. | |
218 | +// | |
219 | +#define MSG_TASKTRAY_REGISTERED ((DWORD)0x00000008L) | |
220 | + | |
221 | +// | |
222 | +// MessageId: MSG_TASKTRAY_REGISTER_FAILD | |
223 | +// | |
224 | +// MessageText: | |
225 | +// | |
226 | +// Register TaskTray Failed. | |
227 | +// | |
228 | +#define MSG_TASKTRAY_REGISTER_FAILD ((DWORD)0x00008008L) | |
229 | + | |
230 | +// | |
231 | +// MessageId: MSG_DETECT_FLUSHMOUSE_STOP | |
232 | +// | |
233 | +// MessageText: | |
234 | +// | |
235 | +// Detected Stopping FlushMouse Process. | |
236 | +// | |
237 | +#define MSG_DETECT_FLUSHMOUSE_STOP ((DWORD)0x00008009L) | |
238 | + | |
239 | +// | |
186 | 240 | // MessageId: MSG_PBT_APMSUSPEND |
187 | 241 | // |
188 | 242 | // MessageText: |
@@ -196,7 +250,7 @@ | ||
196 | 250 | // |
197 | 251 | // MessageText: |
198 | 252 | // |
199 | -// Resuming from sleep or hibernation (APM). | |
253 | +// Resuming from Sleep or Hibernation (APM). | |
200 | 254 | // |
201 | 255 | #define MSG_PBT_APMRESUMEAUTOMATIC ((DWORD)0x40000101L) |
202 | 256 |
@@ -68,6 +68,16 @@ Language=Japanese | ||
68 | 68 | DLL32 Events |
69 | 69 | . |
70 | 70 | |
71 | +MessageId=0x4 | |
72 | +SymbolicName=Installer_CATEGORY | |
73 | +Language=English | |
74 | +Installer Events | |
75 | +. | |
76 | + | |
77 | +Language=Japanese | |
78 | +Installer Events | |
79 | +. | |
80 | + | |
71 | 81 | MessageId=0x10 |
72 | 82 | SymbolicName=POWERNOTIFICATION_CATEGORY |
73 | 83 | Language=English |
@@ -129,6 +139,18 @@ Language=Japanese | ||
129 | 139 | Thread, Hook and Timer Started. |
130 | 140 | . |
131 | 141 | |
142 | +MessageId=0x8002 | |
143 | +Severity=Informational | |
144 | +Facility=Application | |
145 | +SymbolicName=MSG_THREAD_HOOK_TIMER_START_FAILED | |
146 | +Language=English | |
147 | +Thread, Hook and Timer Start Failed. | |
148 | +. | |
149 | + | |
150 | +Language=Japanese | |
151 | +Thread, Hook and Timer Start Failed. | |
152 | +. | |
153 | + | |
132 | 154 | MessageId=0x0003 |
133 | 155 | Severity=Informational |
134 | 156 | Facility=Application |
@@ -153,6 +175,18 @@ Language=Japanese | ||
153 | 175 | Thread, Hook and Timer Restarted. |
154 | 176 | . |
155 | 177 | |
178 | +MessageId=0x8004 | |
179 | +Severity=Informational | |
180 | +Facility=Application | |
181 | +SymbolicName=MSG_THREAD_HOOK_TIMER_RESTART_FAILED | |
182 | +Language=English | |
183 | +Thread, Hook and Timer Restart Failed. | |
184 | +. | |
185 | + | |
186 | +Language=Japanese | |
187 | +Thread, Hook and Timer Restart Failed. | |
188 | +. | |
189 | + | |
156 | 190 | MessageId=0x0005 |
157 | 191 | Severity=Informational |
158 | 192 | Facility=Application |
@@ -188,6 +222,45 @@ Quit FlushMouse(Installer). | ||
188 | 222 | Language=Japanese |
189 | 223 | FlushMouseを終了します(Installer)。 |
190 | 224 | . |
225 | +MessageId=0x0008 | |
226 | +Severity=Success | |
227 | +Facility=Application | |
228 | +SymbolicName=MSG_TASKTRAY_REGISTERED | |
229 | +Language=English | |
230 | +Registered TaskTray. | |
231 | +. | |
232 | + | |
233 | +Language=Japanese | |
234 | +Registered TaskTray. | |
235 | +. | |
236 | + | |
237 | +MessageId=0x8008 | |
238 | +Severity=Success | |
239 | +Facility=Application | |
240 | +SymbolicName=MSG_TASKTRAY_REGISTER_FAILD | |
241 | +Language=English | |
242 | +Register TaskTray Failed. | |
243 | +. | |
244 | + | |
245 | +Language=Japanese | |
246 | +Register TaskTray Failed. | |
247 | +. | |
248 | + | |
249 | +Language=Japanese | |
250 | +Registered TaskTray. | |
251 | +. | |
252 | + | |
253 | +MessageId=0x8009 | |
254 | +Severity=Success | |
255 | +Facility=Application | |
256 | +SymbolicName=MSG_DETECT_FLUSHMOUSE_STOP | |
257 | +Language=English | |
258 | +Detected Stopping FlushMouse Process. | |
259 | +. | |
260 | + | |
261 | +Language=Japanese | |
262 | +Detected Stopping FlushMouse Process. | |
263 | +. | |
191 | 264 | |
192 | 265 | MessageId=0x0100 |
193 | 266 | Severity=Informational |
@@ -206,11 +279,11 @@ Severity=Informational | ||
206 | 279 | Facility=Application |
207 | 280 | SymbolicName=MSG_PBT_APMRESUMEAUTOMATIC |
208 | 281 | Language=English |
209 | -Resuming from sleep or hibernation (APM). | |
282 | +Resuming from Sleep or Hibernation (APM). | |
210 | 283 | . |
211 | 284 | |
212 | 285 | Language=Japanese |
213 | -Resuming from sleep or hibernation (APM). | |
286 | +Resuming from Sleep or Hibernation (APM). | |
214 | 287 | . |
215 | 288 | |
216 | 289 | MessageId=0x0102 |
@@ -318,7 +318,7 @@ static LRESULT CALLBACK lpKeyboardHookLLProc(int nCode, WPARAM wParam, LPARAM lP | ||
318 | 318 | // |
319 | 319 | static BOOL bKBisEP() |
320 | 320 | { |
321 | - if (GetKeyboardType(1) == 0) { // EP Keyboard | |
321 | + if (GetKeyboardType(1) == 0) { | |
322 | 322 | _Post_equals_last_error_ DWORD err = GetLastError(); |
323 | 323 | if (err != 0) { |
324 | 324 | } |
@@ -8,11 +8,11 @@ | ||
8 | 8 | |
9 | 9 | #define MAJOR_VERSION 1 |
10 | 10 | #define MINOR_VERSION 0 |
11 | -#define BUILD_VERSION 1 | |
12 | -#define REVISON_VERSION 1 | |
11 | +#define BUILD_VERSION 2 | |
12 | +#define REVISON_VERSION 6 | |
13 | 13 | |
14 | -#define FILE_VERSION_STRING VALUE "FileVersion", "1.0.1.1" | |
15 | -#define PRODUCT_VERSION_STRING VALUE "ProductVersion", "1.0.1.1" | |
14 | +#define FILE_VERSION_STRING VALUE "FileVersion", "1.0.2.6" | |
15 | +#define PRODUCT_VERSION_STRING VALUE "ProductVersion", "1.0.2.6" | |
16 | 16 | |
17 | 17 | #define FILE_VERSION MAJOR_VERSION, MINOR_VERSION, BUILD_VERSION, REVISON_VERSION |
18 | 18 | #define PRODUCT_VERSION MAJOR_VERSION, MINOR_VERSION, BUILD_VERSION, REVISON_VERSION |
@@ -1,5 +1,5 @@ | ||
1 | 1 | <Include> |
2 | 2 | <!-- for wix Setup Project --> |
3 | - <?define Version = "1.0.1.1" ?> | |
3 | + <?define Version = "1.0.2.6" ?> | |
4 | 4 | </Include> |
5 | 5 |