マウスカーソルへIMEモードの表示
Révision | 1c66eb5611cfe0907ecf845b7af608d48fc91fc7 (tree) |
---|---|
l'heure | 2023-06-13 14:15:26 |
Auteur | JeffyTS <jeffyts@outl...> |
Commiter | JeffyTS |
1.0.0.1
@@ -20,17 +20,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FlushMouseDLL32", "FlushMou | ||
20 | 20 | EndProject |
21 | 21 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SetupProject", "SetupProject\SetupProject.wixproj", "{40614F11-A07B-42AB-822E-FAC73CC85CB0}" |
22 | 22 | EndProject |
23 | -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{352B420D-E55A-4196-9597-D394D0DA2519}" | |
24 | - ProjectSection(SolutionItems) = preProject | |
25 | - Solution.props = Solution.props | |
26 | - EndProjectSection | |
27 | -EndProject | |
28 | 23 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MiscLIB", "MiscLIB\MiscLIB.vcxproj", "{CCAF431F-CE8E-4879-9B1F-3F1DF4AC2269}" |
29 | 24 | EndProject |
30 | 25 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MiscLIB32", "MiscLIB32\MiscLIB32.vcxproj", "{3D3F632C-75BB-4830-AA8E-0871C6AA1A72}" |
31 | 26 | EndProject |
32 | 27 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ソリューション項目", "ソリューション項目", "{4DA8FAF2-6A3D-41B4-B811-0F39BFA7CAA5}" |
33 | 28 | ProjectSection(SolutionItems) = preProject |
29 | + FlushMouse_x64.msi = FlushMouse_x64.msi | |
34 | 30 | version.h = version.h |
35 | 31 | version.wxi = version.wxi |
36 | 32 | EndProjectSection |
@@ -11,7 +11,6 @@ | ||
11 | 11 | // |
12 | 12 | #pragma once |
13 | 13 | #include "pch.h" |
14 | -#include "..\..\DEFS\types.h" | |
15 | 14 | |
16 | 15 | // |
17 | 16 | // Define |
@@ -20,7 +19,7 @@ | ||
20 | 19 | |
21 | 20 | // Window Class |
22 | 21 | #define CLASS_FLUSHMOUSE L"FlushMouse-{E598B54C-A36A-4CDF-BC77-7082CEEDAA46}" |
23 | -#define CLASS_FLUSHMOUSE32 L"FlushMouse32-{07C82AC3-DF75-469D-8443-91E6274A2422}" | |
22 | +#define CLASS_FLUSHMOUSE32 L"FlushMouse32-{E598B54C-A36A-4CDF-BC77-7082CEEDAA46}" | |
24 | 23 | |
25 | 24 | // for IME |
26 | 25 | #define IMC_GETCONVERSIONMODE 0x0001 |
@@ -30,6 +29,18 @@ | ||
30 | 29 | #define IMC_GETOPENSTATUS 0x0005 |
31 | 30 | #define IMC_SETOPENSTATUS 0x0006 |
32 | 31 | |
32 | +// for KB | |
33 | +#define KB_MASK 0xffff0000 | |
34 | +#define KB_JP 0x04110000 | |
35 | +#define KB_US 0x04090000 | |
36 | +#define LANG_MASK 0x0000ffff | |
37 | +#define LANG_IME 0x00000411 | |
38 | +#define LANG_ENG 0x00000409 | |
39 | +#define JP_IME (HKL)(KB_JP | LANG_IME) | |
40 | +#define JP_ENG (HKL)(KB_JP | LANG_ENG) | |
41 | +#define US_IME (HKL)(KB_US | LANG_IME) | |
42 | +#define US_ENG (HKL)(KB_US | LANG_ENG) | |
43 | + | |
33 | 44 | // for Shell_NotifyIcon |
34 | 45 | #define NOTIFYICONDATA_ID 0x684B9604 |
35 | 46 |
@@ -190,23 +190,21 @@ BOOL CALLBACK CIME::bEnumChildProcActivateIME(HWND hWnd, LPARAM lParam) | ||
190 | 190 | { |
191 | 191 | UNREFERENCED_PARAMETER(lParam); |
192 | 192 | |
193 | - BOOL bRet = FALSE; | |
194 | 193 | HWND hIMWnd = ImmGetDefaultIMEWnd(hWnd); |
195 | 194 | if (hIMWnd != NULL) { |
196 | 195 | SendMessage(hIMWnd, WM_ACTIVATE, (WPARAM)WA_ACTIVE, (LPARAM)NULL); |
197 | 196 | LPTSTR lpszBuffer = new TCHAR[_MAX_PATH]; |
198 | - ZeroMemory(lpszBuffer, _MAX_PATH); | |
197 | + ZeroMemory(lpszBuffer, (sizeof(TCHAR) * _MAX_PATH)); | |
199 | 198 | if (GetClassName(hIMWnd, lpszBuffer, _MAX_PATH) != 0) { |
200 | 199 | HWND hIMEWnd = FindWindow(lpszBuffer, NULL); |
201 | 200 | if (hIMEWnd != NULL) { |
202 | 201 | SendMessage(hIMEWnd, WM_ACTIVATE, (WPARAM)WA_ACTIVE, (LPARAM)NULL); |
203 | - | |
204 | - bRet = TRUE; | |
202 | + if (lpszBuffer != NULL) delete[] lpszBuffer; | |
203 | + return TRUE; | |
205 | 204 | } |
206 | 205 | } |
207 | 206 | if (lpszBuffer != NULL) delete[] lpszBuffer; |
208 | 207 | } |
209 | - //return bRet; | |
210 | 208 | return TRUE; |
211 | 209 | } |
212 | 210 |
@@ -335,7 +333,6 @@ BOOL CIME::bGetVirtualDesktopSize() | ||
335 | 333 | return bRet; |
336 | 334 | } |
337 | 335 | |
338 | - | |
339 | 336 | // |
340 | 337 | // bGetVirtualDesktopSizeEnumProc() |
341 | 338 | // |
@@ -395,6 +392,48 @@ BOOL CIME::bIsNewIME() | ||
395 | 392 | } |
396 | 393 | |
397 | 394 | // |
395 | +// dGetInputLocale() | |
396 | +// | |
397 | +DWORD CIME::dwGetInputLocale() | |
398 | +{ | |
399 | +#define SUBKEY _T("SOFTWARE\\Microsoft\\Input\\Locales") | |
400 | +#define VALUE _T("InputLocale") | |
401 | + DWORD dwInputLocale = 0; | |
402 | + CRegistry* CReg = new CRegistry; | |
403 | + if (CReg) { | |
404 | + if (!CReg->bReadSystemRegValueDWORD(HKEY_LOCAL_MACHINE, SUBKEY, VALUE, &dwInputLocale)) { | |
405 | + } | |
406 | + delete CReg; | |
407 | + } | |
408 | + return (dwInputLocale & 0x0000ffff); | |
409 | +#undef SUBKEY | |
410 | +#undef VALUE | |
411 | +} | |
412 | + | |
413 | +// | |
414 | +// hklGetInputLocale() | |
415 | +// | |
416 | +HKL CIME::hklGetInputLocale(HWND hWndObserved) | |
417 | +{ | |
418 | + | |
419 | + DWORD dwProcessID = 0; | |
420 | + DWORD dwThreadID = 0; | |
421 | + HKL hkl = NULL; | |
422 | + DWORD dwInputLocale = 0; | |
423 | + if ((dwThreadID = GetWindowThreadProcessId(hWndObserved, &dwProcessID)) != 0) { | |
424 | + if ((hkl = GetKeyboardLayout(dwThreadID)) != NULL) { | |
425 | + int iKeyboardType = GetKeyboardType(1); | |
426 | + if ((iKeyboardType != 2) || (hkl != JP_IME)) hkl = US_ENG; | |
427 | + hkl = (HKL)(((UINT64)hkl & KB_MASK) | (dwInputLocale & LANG_MASK)); | |
428 | + return hkl; | |
429 | + } | |
430 | + } | |
431 | + return (HKL)0; | |
432 | +#undef SUBKEY | |
433 | +#undef VALUE | |
434 | +} | |
435 | + | |
436 | +//S | |
398 | 437 | // class CCursor |
399 | 438 | // |
400 | 439 | CCursor::CCursor() |
@@ -939,23 +978,27 @@ BOOL CCursor::bDrawIMEModeOnDisplaySub(LPIMECURSORDATA lpstCursorData) | ||
939 | 978 | int iCursorSizeX = 0, iCursorSizeY = 0, iCaretSizeX = 0, iCaretSizeY = 0; |
940 | 979 | DWORD dwIMEMode = Cime->dwIMEMode(lpstCursorData->hWndObserved, lpstCursorData->bForceHiragana); |
941 | 980 | int iCursor = 0; |
942 | - if (dwIMEMode != IMEOFF) { | |
943 | - while (dwIMEMode != lpstCursorData->lpstFlushMouseCursor[iCursor].dwIMEMode) { | |
944 | - ++iCursor; | |
981 | + while (dwIMEMode != lpstCursorData->lpstFlushMouseCursor[iCursor].dwIMEMode) { | |
982 | + ++iCursor; | |
983 | + if (lpstCursorData->lpstFlushMouseCursor[iCursor].dwIMEMode == (DWORD)(-1)) { | |
984 | + iCursor = 0; dwIMEMode = IMEOFF; | |
985 | + break; | |
945 | 986 | } |
946 | - CursorWindow->vSetModeString(stIMECursorData.lpstFlushMouseCursor[iCursor].szMode); | |
947 | 987 | } |
988 | + CursorWindow->vSetModeString(stIMECursorData.lpstFlushMouseCursor[iCursor].szMode); | |
948 | 989 | if (lpstCursorData->bDrawNearCaret != FALSE) { |
949 | 990 | POINT pt{}; |
950 | 991 | HWND hWnd = GetForegroundWindow(); |
951 | 992 | if (bCalcDispModeCaretRect(hWnd, lpstCursorData->iModeSize, lpstCursorData->iModeSize, &rcCaret, &pt)) { |
952 | 993 | hWnd = WindowFromPoint(pt); |
953 | 994 | DWORD dwIMEModeCaret = dwIMEMode; |
954 | - int iCaret = iCursor; | |
955 | - if (hWnd != lpstCursorData->hWndObserved) { | |
956 | - dwIMEModeCaret = Cime->dwIMEMode(hWnd, lpstCursorData->bForceHiragana); | |
957 | - while (dwIMEModeCaret != lpstCursorData->lpstFlushMouseCursor[iCaret].dwIMEMode) { | |
958 | - ++iCaret; | |
995 | + int iCaret = 0; | |
996 | + dwIMEModeCaret = Cime->dwIMEMode(hWnd, lpstCursorData->bForceHiragana); | |
997 | + while (dwIMEModeCaret != lpstCursorData->lpstFlushMouseCursor[iCaret].dwIMEMode) { | |
998 | + ++iCaret; | |
999 | + if (lpstCursorData->lpstFlushMouseCursor[iCaret].dwIMEMode == (DWORD)(-1)) { | |
1000 | + iCaret = 0; dwIMEModeCaret = IMEOFF; | |
1001 | + break; | |
959 | 1002 | } |
960 | 1003 | } |
961 | 1004 | if ((rcCaret.left != 0) || (rcCaret.top != 0) || (rcCaret.right != 0) || (rcCaret.bottom != 0)) { |
@@ -169,6 +169,8 @@ public: | ||
169 | 169 | BOOL bMoveIMEToolbar(); |
170 | 170 | BOOL bGetVirtualDesktopSize(); |
171 | 171 | BOOL bIsNewIME(); |
172 | + DWORD dwGetInputLocale(); | |
173 | + HKL hklGetInputLocale(HWND hWndObserved); | |
172 | 174 | |
173 | 175 | private: |
174 | 176 | BOOL bExistIMEToolbar(); |
@@ -282,7 +284,7 @@ private: | ||
282 | 284 | { IMEHIDE, _T(""), {OCR_NORMAL, IDC_HIDE_ARROW, FALSE, _T(""), _T("%APPDATA%\\JeffyTS\\FlushMouse\\ImeHideOnArrow.cur")}, |
283 | 285 | {OCR_HAND, IDC_HIDE_HAND, FALSE, _T(""), _T("%APPDATA%\\JeffyTS\\FlushMouse\\ImeHideOnHand.cur")}, |
284 | 286 | {OCR_IBEAM, IDC_HIDE_IBEAM, FALSE, _T(""), _T("%APPDATA%\\JeffyTS\\FlushMouse\\ImeHideOnIBeam.cur")}}, |
285 | - { (UINT)(-1), _T(""), {0, 0, FALSE, _T(""), _T("")}, // Terminater | |
287 | + { (DWORD)(-1), _T(""), {0, 0, FALSE, _T(""), _T("")}, // Terminater | |
286 | 288 | {0, 0, FALSE, _T(""), _T("")}, // Terminater |
287 | 289 | {0, 0, FALSE, _T(""), _T("")} } // Terminater |
288 | 290 | }; |
@@ -21,6 +21,7 @@ | ||
21 | 21 | #include "..\version.h" |
22 | 22 | #include "FlushMouseLIB.h" |
23 | 23 | #include "Resource.h" |
24 | +#include "..\FlushMouseDLL\EventlogDll.h" | |
24 | 25 | |
25 | 26 | #if defined _DEBUG |
26 | 27 | #define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__) |
@@ -55,7 +56,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
55 | 56 | // |
56 | 57 | // Local Prototype Define |
57 | 58 | // |
58 | -static INT_PTR CALLBACK AboutDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); | |
59 | +static BOOL bSetHeapInformation(); | |
60 | +static INT_PTR CALLBACK AboutDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); | |
59 | 61 | |
60 | 62 | // |
61 | 63 | // 関数: wWinMain() |
@@ -68,6 +70,43 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
68 | 70 | #if defined _DEBUG |
69 | 71 | _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); |
70 | 72 | #endif |
73 | + | |
74 | + HANDLE hHandle = GetCurrentProcess(); | |
75 | + if (!SetPriorityClass(hHandle, NORMAL_PRIORITY_CLASS)) { | |
76 | + return (-1); | |
77 | + } | |
78 | + | |
79 | + if (!bSetHeapInformation()) return (-1); | |
80 | + | |
81 | + if (*lpCmdLine == _T('\0')) { | |
82 | + // NOP | |
83 | + } | |
84 | + else { | |
85 | + int iRet = 0; | |
86 | + if ((iRet = CompareStringOrdinal(lpCmdLine, -1, L"/quit", -1, TRUE)) != 0) { | |
87 | + if (iRet == CSTR_EQUAL) { | |
88 | + bReportEvent(MSG_DONE_FLUSHMOUSE, APPLICATION_CATEGORY); // Eventlog | |
89 | + HWND hWnd = NULL; | |
90 | + if ((hWnd = FindWindow(CLASS_FLUSHMOUSE, NULL)) != NULL) { // 先に起動されているウィンドウハンドルを探す | |
91 | + SetFocus(GetLastActivePopup(hWnd)); // 先に起動されているウィンドウへフォーカスを与える | |
92 | + PostMessage(hWnd, WM_DESTROY, NULL, NULL); // 先に起動されているウィンドウを終了させる | |
93 | + for (int i = 3; i > 0; i--) { | |
94 | + Sleep(500); // 終了を3回待つ | |
95 | + if ((hWnd = FindWindow(CLASS_FLUSHMOUSE, NULL)) != NULL) { | |
96 | + SetFocus(GetLastActivePopup(hWnd)); // 先に起動されているウィンドウへフォーカスを与える | |
97 | + PostMessage(hWnd, WM_DESTROY, NULL, NULL); // 先に起動されているウィンドウを終了させる | |
98 | + if (i == 1) { | |
99 | + return (-1); // 終了していない場合はエラー終了 | |
100 | + } | |
101 | + } | |
102 | + else return 0; | |
103 | + } | |
104 | + } | |
105 | + } | |
106 | + } | |
107 | + if (hHandle != NULL) CloseHandle(hHandle); | |
108 | + return 0; | |
109 | + } | |
71 | 110 | |
72 | 111 | #define RESOURCEFILE _T("FlushMouse.exe") |
73 | 112 | // Load Resource |
@@ -86,17 +125,53 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
86 | 125 | DispatchMessage(&msg); |
87 | 126 | } |
88 | 127 | } |
128 | + if (Resource) delete Resource; | |
89 | 129 | return (int)msg.wParam; |
90 | 130 | } |
91 | 131 | |
132 | +// | |
133 | +// bSetHeapInformation() | |
134 | +// | |
135 | +BOOL bSetHeapInformation() | |
136 | +{ | |
137 | + HANDLE hHeap = NULL; | |
138 | + if ((hHeap = GetProcessHeap()) != NULL) { | |
139 | + ULONG HeapInformation = 2; | |
140 | + if (!HeapSetInformation(hHeap, HeapCompatibilityInformation, &HeapInformation, sizeof(ULONG))) { | |
141 | + _Post_equals_last_error_ DWORD err = GetLastError(); | |
142 | + if (err != ERROR_INVALID_PARAMETER) { // 87 (0x57) | |
143 | + return FALSE; | |
144 | + } | |
145 | + } | |
146 | + return TRUE; | |
147 | + } | |
148 | + return FALSE; | |
149 | +} | |
150 | + | |
92 | 151 | // |
93 | 152 | // vMessageBox() |
94 | 153 | // |
95 | 154 | void vMessageBox(HWND hWnd, UINT uID, UINT uType) |
96 | 155 | { |
97 | 156 | TCHAR lpText[MAX_LOADSTRING]; |
98 | - if (LoadString(Resource->hLoad(), uID, lpText, MAX_LOADSTRING) != 0) { | |
99 | - MessageBox(hWnd, lpText, szTitle, uType); | |
157 | + try { | |
158 | + throw LoadString(Resource->hLoad(), uID, lpText, MAX_LOADSTRING); | |
159 | + } | |
160 | + catch (int i) { | |
161 | + if (i != 0) { | |
162 | + try { | |
163 | + throw MessageBox(hWnd, lpText, szTitle, uType); | |
164 | + } | |
165 | + catch (int) { | |
166 | + return; | |
167 | + } | |
168 | + catch (...) { | |
169 | + return; // error | |
170 | + } | |
171 | + } | |
172 | + } | |
173 | + catch (...) { | |
174 | + return; // error | |
100 | 175 | } |
101 | 176 | } |
102 | 177 |
@@ -135,11 +210,15 @@ static INT_PTR CALLBACK AboutDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM | ||
135 | 210 | HICON hIcon = NULL; |
136 | 211 | hIcon = (HICON)LoadImage(Resource->hLoad(), MAKEINTRESOURCE(IDI_SMALL), IMAGE_ICON, 16, 16, 0); |
137 | 212 | SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); // Iconの設定 |
138 | - LPTSTR lpszVersion = new TCHAR[128]; | |
139 | - ZeroMemory(lpszVersion, (sizeof(TCHAR) * 128)); | |
140 | - _sntprintf_s(lpszVersion, 128, _TRUNCATE, _T("%d.%d.%d.%d"), MAJOR_VERSION, MINOR_VERSION, BUILD_VERSION, REVISON_VERSION); | |
141 | - SetDlgItemText(hDlg, IDC_VERSION, lpszVersion); // Versionの設定 | |
142 | - delete[] lpszVersion; | |
213 | + LPTSTR lpszVersion = new TCHAR[MAX_LOADSTRING]; | |
214 | + ZeroMemory(lpszVersion, (sizeof(TCHAR) * MAX_LOADSTRING)); | |
215 | + if (lpszVersion) { | |
216 | + ZeroMemory(lpszVersion, (sizeof(TCHAR) * MAX_LOADSTRING)); | |
217 | + _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の設定 | |
219 | + delete[] lpszVersion; | |
220 | + } | |
221 | + else return (INT_PTR)FALSE; | |
143 | 222 | } |
144 | 223 | return (INT_PTR)TRUE; |
145 | 224 | case WM_CTLCOLORDLG: |
@@ -0,0 +1,41 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
2 | +<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> | |
3 | + <assemblyIdentity | |
4 | + type="win32" | |
5 | + name="FlushMouse.exe" | |
6 | + version="0.9.4.8" | |
7 | + processorArchitecture="amd64" | |
8 | + /> | |
9 | + <description>FlushMouse Application</description> | |
10 | + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | |
11 | + <application> | |
12 | + <!-- Windows 10 and Windows 11 --> | |
13 | + <maxversiontested Id="10.0.19041.0"/> | |
14 | + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> | |
15 | + <!-- DPI Awareness --> | |
16 | + <!-- Per Monitor V2 [OS >= Windows 10 Creators Update (1703, 10.0.15063, Redstone 2)] Value: PerMonitorV2 --> | |
17 | + <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> | |
18 | + PerMonitorV2, PerMonitor | |
19 | + </dpiAwareness> | |
20 | + <!-- GDI Scaling --> | |
21 | + <gdiScaling>true</gdiScaling> | |
22 | + </application> | |
23 | + </compatibility> | |
24 | + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> | |
25 | + <security> | |
26 | + <requestedPrivileges> | |
27 | + <!-- UAC settings --> | |
28 | + <!--requestedExecutionLevel level="requireAdministrator" uiAccess="false"/--> | |
29 | + <!--requestedExecutionLevel level="highestAvailable" uiAccess="false"/--> | |
30 | + <requestedExecutionLevel level="asInvoker" uiAccess="false"/> | |
31 | + </requestedPrivileges> | |
32 | + </security> | |
33 | + </trustInfo> | |
34 | + <!--file name="FlushMouseUI3.dll"> | |
35 | + <activatableClass | |
36 | + name="FlushMouseUI3.Class" | |
37 | + threadingModel="both" | |
38 | + xmlns="urn:schemas-microsoft-com:winrt.v1" /> | |
39 | + </file--> | |
40 | + | |
41 | +</assembly> | |
\ No newline at end of file |
@@ -246,6 +246,9 @@ | ||
246 | 246 | <Project>{ccaf431f-ce8e-4879-9b1f-3f1df4ac2269}</Project> |
247 | 247 | </ProjectReference> |
248 | 248 | </ItemGroup> |
249 | + <ItemGroup> | |
250 | + <Manifest Include="FlushMouse.exe.manifest" /> | |
251 | + </ItemGroup> | |
249 | 252 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
250 | 253 | <ImportGroup Label="ExtensionTargets" /> |
251 | 254 | </Project> |
\ No newline at end of file |
@@ -79,4 +79,7 @@ | ||
79 | 79 | <Filter>リソース ファイル</Filter> |
80 | 80 | </Image> |
81 | 81 | </ItemGroup> |
82 | + <ItemGroup> | |
83 | + <Manifest Include="FlushMouse.exe.manifest" /> | |
84 | + </ItemGroup> | |
82 | 85 | </Project> |
\ No newline at end of file |
@@ -18,7 +18,6 @@ | ||
18 | 18 | #include "Resource.h" |
19 | 19 | #include "CommonDef.h" |
20 | 20 | #include "..\FlushMouseDLL\EventlogDll.h" |
21 | -#include "..\FlushMouseDLL\EventlogData.h" | |
22 | 21 | #include "..\FlushMouseDLL\GlobalHookDll.h" |
23 | 22 | #include "..\FlushMouseDLL32\KeyboardHookDll32.h" |
24 | 23 | #include "..\FlushMouseDLL32\MouseHookDll32.h" |
@@ -28,16 +27,6 @@ | ||
28 | 27 | // |
29 | 28 | // Define |
30 | 29 | // |
31 | -#define KB_MASK 0xffff0000 | |
32 | -#define KB_JP 0x04110000 | |
33 | -#define KB_US 0x04090000 | |
34 | -#define LANG_MASK 0x0000ffff | |
35 | -#define LANG_IME 0x00000411 | |
36 | -#define LANG_ENG 0x00000409 | |
37 | -#define JP_IME (HKL)(KB_JP | LANG_IME) | |
38 | -#define JP_ENG (HKL)(KB_JP | LANG_ENG) | |
39 | -#define US_IME (HKL)(KB_US | LANG_IME) | |
40 | -#define US_ENG (HKL)(KB_US | LANG_ENG) | |
41 | 30 | |
42 | 31 | // |
43 | 32 | // Struct Define |
@@ -77,7 +66,7 @@ static UINT nCheckFocusTimerTickValue = FOCUSINITTIMERVALUE; // Timer tick | ||
77 | 66 | static UINT_PTR nCheckFocusTimerID = CHECKFOCUSTIMERID; // Timer ID |
78 | 67 | static UINT_PTR uCheckFocusTimer = NULL; |
79 | 68 | // Timer for Poc |
80 | -#define PROCINITTIMERVALUE 3000 | |
69 | +#define PROCINITTIMERVALUE 1000 | |
81 | 70 | #define CHECKPROCTIMERID 2 |
82 | 71 | static UINT nCheckProcTimerTickValue = PROCINITTIMERVALUE; // Timer tick |
83 | 72 | static UINT_PTR nCheckProcTimerID = CHECKPROCTIMERID; // Timer ID |
@@ -124,9 +113,9 @@ static void Cls_OnCheckIMEStartConvertingEx(HWND hWnd, BOOL bStartConversioning | ||
124 | 113 | // Sub |
125 | 114 | static BOOL bSendInputSub(UINT cInputs, LPINPUT pInputs); |
126 | 115 | static BOOL bKBisEP(); |
116 | +static BOOL bChangeHKLbySendInput(HKL hNewHKL, HKL hPreviousHKL); | |
127 | 117 | static VOID CALLBACK vCheckFocusTimerProc(HWND hWnd, UINT uMsg, UINT uTimerID, DWORD dwTime); |
128 | 118 | static VOID CALLBACK vCheckProcTimerProc(HWND hWnd, UINT uMsg, UINT uTimerID, DWORD dwTime); |
129 | -static LONG WINAPI lExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo); | |
130 | 119 | static BOOL CALLBACK bEnumChildProcChangeHKL(HWND hWnd, LPARAM lParam); |
131 | 120 | |
132 | 121 | // |
@@ -134,11 +123,8 @@ static BOOL CALLBACK bEnumChildProcChangeHKL(HWND hWnd, LPARAM lParam); | ||
134 | 123 | // |
135 | 124 | BOOL bWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance) |
136 | 125 | { |
137 | - SetUnhandledExceptionFilter(&lExceptionFilter); | |
138 | - | |
139 | 126 | if (LoadString(Resource->hLoad(), IDS_APP_TITLE, szTitle, MAX_LOADSTRING) == 0) return FALSE; |
140 | 127 | |
141 | - // Set Thread DPI Awareness V2 for High DPI | |
142 | 128 | SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); |
143 | 129 | SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); |
144 | 130 |
@@ -155,7 +141,9 @@ BOOL bWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance) | ||
155 | 141 | PostMessage(hWnd, WM_DESTROY, NULL, NULL); |
156 | 142 | for (int i = 3; i > 0; i--) { |
157 | 143 | Sleep(500); |
158 | - if (FindWindow(CLASS_FLUSHMOUSE, NULL) != NULL) { | |
144 | + if ((hWnd = FindWindow(CLASS_FLUSHMOUSE, NULL)) != NULL) { | |
145 | + SetFocus(GetLastActivePopup(hWnd)); | |
146 | + PostMessage(hWnd, WM_DESTROY, NULL, NULL); | |
159 | 147 | if (i == 1) { |
160 | 148 | vMessageBox(NULL, IDS_ALREADYRUN, MessageBoxTYPE); |
161 | 149 | if (Resource != NULL) { |
@@ -207,7 +195,7 @@ static ATOM MyRegisterClass(HINSTANCE hInstance) | ||
207 | 195 | static HWND InitInstance(HINSTANCE hInstance, int nCmdShow) |
208 | 196 | { |
209 | 197 | UNREFERENCED_PARAMETER(nCmdShow); |
210 | -#define WINDOWSTYLE (WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL) | |
198 | +#define WINDOWSTYLE WS_DISABLED | |
211 | 199 | // for TaskTray |
212 | 200 | HWND hWnd = NULL; // メインウィンドウのハンドル |
213 | 201 | hWnd = CreateWindowEx( |
@@ -252,6 +240,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l | ||
252 | 240 | HANDLE_MSG(hWnd, WM_POWERBROADCAST, Cls_OnPowerBroadcast); |
253 | 241 | HANDLE_MSG(hWnd, WM_EVENT_SYSTEM_FOREGROUNDEX, Cls_OnEventForegroundEx); |
254 | 242 | HANDLE_MSG(hWnd, WM_CHECKIMESTARTCONVEX, Cls_OnCheckIMEStartConvertingEx); |
243 | + break; | |
255 | 244 | |
256 | 245 | default: |
257 | 246 | if (!bReCreateTaskTrayWindow(hWnd, message)) { |
@@ -287,7 +276,11 @@ static BOOL Cls_OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct) | ||
287 | 276 | HICON hIcon = NULL; |
288 | 277 | if ((hIcon = LoadIcon(Resource->hLoad(), MAKEINTRESOURCE(IDI_FLUSHMOUSE))) != NULL) { |
289 | 278 | if (bCreateTaskTrayWindow(hWnd, hIcon, szTitle) == FALSE) { |
290 | - vMessageBox(hWnd, IDS_NOTREGISTERTT, MessageBoxTYPE); | |
279 | + try { | |
280 | + vMessageBox(hWnd, IDS_NOTREGISTERTT, MessageBoxTYPE); | |
281 | + } | |
282 | + catch (...) { | |
283 | + } | |
291 | 284 | PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); |
292 | 285 | return FALSE; |
293 | 286 | } |
@@ -311,8 +304,8 @@ static BOOL Cls_OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct) | ||
311 | 304 | return FALSE; |
312 | 305 | } |
313 | 306 | |
314 | - if (bCheckExistingJPIME() && bEnableEPHelper) bForExplorerPatcherSWS(GetForegroundWindow(), FALSE, NULL, NULL); | |
315 | - | |
307 | + if (bCheckExistingJPIME() && bEnableEPHelper) bForExplorerPatcherSWS(GetForegroundWindow(), FALSE, FALSE, NULL, NULL); | |
308 | + | |
316 | 309 | return TRUE; |
317 | 310 | } |
318 | 311 |
@@ -325,8 +318,7 @@ static void Cls_OnDestroy(HWND hWnd) | ||
325 | 318 | |
326 | 319 | vStopThreadHookTimer(hWnd); |
327 | 320 | |
328 | - EXCEPTION_POINTERS ExceptionInfo{}; | |
329 | - lExceptionFilter(&ExceptionInfo); | |
321 | + SystemParametersInfo(SPI_SETCURSORS, 0, NULL, 0); | |
330 | 322 | |
331 | 323 | if (Profile != NULL) { |
332 | 324 | Profile->bSetProfileData(); |
@@ -398,7 +390,7 @@ static void Cls_OnCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) | ||
398 | 390 | break; |
399 | 391 | case IDM_EXIT: |
400 | 392 | case IDR_TT_QUIT: |
401 | - DestroyWindow(hWnd); | |
393 | + PostMessage(hWnd, WM_DESTROY, (WPARAM)0, (LPARAM)0); | |
402 | 394 | break; |
403 | 395 | } |
404 | 396 | } |
@@ -428,13 +420,7 @@ static void Cls_OnLButtonDownEx(HWND hWnd, int x, int y, HWND hForeground) | ||
428 | 420 | UNREFERENCED_PARAMETER(y); |
429 | 421 | UNREFERENCED_PARAMETER(hForeground); |
430 | 422 | if (bEnableEPHelper) { |
431 | - POINT pt{}; | |
432 | - if (GetCursorPos(&pt)) { | |
433 | - RECT rc{}; | |
434 | - if (bGetTaskTrayWindowRect(hWnd, &rc) == FALSE) return; | |
435 | - if (((pt.x >= rc.left) && (pt.x <= rc.right)) || ((pt.y <= rc.top) && (pt.y >= rc.bottom))) return; | |
436 | - } | |
437 | - bForExplorerPatcherSWS(hForeground, FALSE, NULL, NULL); | |
423 | + bForExplorerPatcherSWS(hForeground, FALSE, FALSE, NULL, NULL); | |
438 | 424 | } |
439 | 425 | return; |
440 | 426 | } |
@@ -458,9 +444,11 @@ static void Cls_OnLButtonUpEx(HWND hWnd, int x, int y, HWND hForeground) | ||
458 | 444 | POINT pt{}; |
459 | 445 | if (GetCursorPos(&pt)) { |
460 | 446 | RECT rc{}; |
461 | - if (bGetTaskTrayWindowRect(hWnd, &rc) == FALSE) return; | |
462 | - if (((pt.x >= rc.left) && (pt.x <= rc.right)) || ((pt.y <= rc.top) && (pt.y >= rc.bottom))) return; | |
463 | - if ((hWndObserved = WindowFromPoint(pt)) == NULL) return; | |
447 | + if ((hWndObserved = WindowFromPoint(pt)) == NULL) return; | |
448 | + if (FindWindow(L"Shell_TrayWnd", NULL) == GetForegroundWindow()) { | |
449 | + if (bGetTaskTrayWindowRect(hWnd, &rc) == FALSE) return; | |
450 | + if (((pt.x >= rc.left) && (pt.x <= rc.right)) || ((pt.y <= rc.top) && (pt.y >= rc.bottom))) return; | |
451 | + } | |
464 | 452 | if (!Cursor->bStartDrawIMEModeThread(hWndObserved)) return; |
465 | 453 | } |
466 | 454 | } |
@@ -493,23 +481,26 @@ static void Cls_OnEventForegroundEx(HWND hWnd, DWORD dwEvent, HWND hForeWnd) | ||
493 | 481 | else { |
494 | 482 | POINT pt{}; |
495 | 483 | if (GetCursorPos(&pt)) { |
496 | - RECT rc{}; | |
497 | - if (bGetTaskTrayWindowRect(hWnd, &rc) == FALSE) return; | |
498 | - if (((pt.x >= rc.left) && (pt.x <= rc.right)) || ((pt.y <= rc.top) && (pt.y >= rc.bottom))) return; | |
499 | 484 | if ((hWndObserved = WindowFromPoint(pt)) == NULL) return; |
500 | 485 | } |
501 | 486 | else { |
502 | - _Post_equals_last_error_ DWORD err = GetLastError(); | |
503 | - if (err == ERROR_ACCESS_DENIED) return; | |
504 | 487 | return; |
505 | 488 | } |
506 | 489 | } |
507 | - if (bCheckExistingJPIME() && bEnableEPHelper) bForExplorerPatcherSWS(hWnd, FALSE, NULL, NULL); | |
490 | + if (bCheckExistingJPIME() && bEnableEPHelper) bForExplorerPatcherSWS(hWnd, FALSE, FALSE, NULL, NULL); // @@@ for Explorer Patcher Simple Window Switcher | |
508 | 491 | if (bOffChangedFocus) { |
509 | 492 | Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); |
510 | 493 | } |
511 | - if (!Cursor->bStartIMECursorChangeThread(hWndObserved)) return; | |
512 | - if (!Cursor->bStartDrawIMEModeThread(hWndObserved)) return; | |
494 | + if (!Cursor->bStartIMECursorChangeThread(hWndObserved)) return; // error | |
495 | + POINT pt{}; | |
496 | + if (GetCursorPos(&pt)) { | |
497 | + RECT rc{}; | |
498 | + 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 | |
501 | + } | |
502 | + if (!Cursor->bStartDrawIMEModeThread(hForeWnd)) return; // error | |
503 | + } | |
513 | 504 | } |
514 | 505 | } |
515 | 506 | } |
@@ -552,11 +543,11 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
552 | 543 | if ((fDown == FALSE)) { // Key up |
553 | 544 | switch (vk) { |
554 | 545 | case KEY_ONLY_CTRLUP: |
555 | - if (bEnableEPHelper) bForExplorerPatcherSWS(hForeWnd, FALSE, NULL, NULL); | |
546 | + if (bEnableEPHelper) bForExplorerPatcherSWS(hForeWnd, FALSE, FALSE, NULL, NULL); | |
556 | 547 | if (bDoModeDispByCtrlUp) { |
557 | 548 | POINT pt{}; |
558 | 549 | if (GetCursorPos(&pt)) { |
559 | - if (!Cursor->bStartDrawIMEModeThreadWait(WindowFromPoint(pt))) return; // error | |
550 | + if (!Cursor->bStartDrawIMEModeThreadWait(WindowFromPoint(pt))) return; | |
560 | 551 | } |
561 | 552 | } |
562 | 553 | return; |
@@ -574,34 +565,40 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
574 | 565 | case KEY_F10: // F10 (0x79) |
575 | 566 | break; |
576 | 567 | case KEY_IME_ON: // IME ON (0x16) |
577 | - if (bEnableEPHelper) { | |
568 | + bIMEInConverting = FALSE; | |
569 | + if (bEnableEPHelper || bIMEModeForced) { | |
578 | 570 | Cime->vIMEConvertModeChangeForced(hForeWnd, ZENHIRA_IMEON); |
579 | 571 | } |
580 | 572 | break; |
581 | 573 | case KEY_KANJI: // JP(IME/ENG) Alt + 漢字 (0x19) |
582 | - if (bEnableEPHelper) { | |
583 | - while (GetAsyncKeyState(VK_MENU) & 0x8000) | |
584 | - { | |
585 | - Sleep(50); | |
586 | - } | |
587 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
588 | - if (bIMEModeForced != FALSE) { | |
589 | - Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); | |
574 | + bIMEInConverting = FALSE; | |
575 | + if (bEnableEPHelper || bIMEModeForced) { | |
576 | + DWORD dwBeforeIMEMode = Cime->dwIMEMode(hForeWnd, FALSE); | |
577 | + if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { | |
578 | + if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
579 | + if (dwBeforeIMEMode != IMEOFF) { | |
580 | + Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
581 | + } | |
582 | + else { | |
583 | + Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); | |
584 | + } | |
590 | 585 | } |
591 | 586 | } |
592 | 587 | } |
593 | 588 | break; |
594 | 589 | case KEY_IME_OFF: // IME OFF (0x1a) |
595 | - if (bEnableEPHelper) { | |
596 | - if (bIMEModeForced != FALSE) { | |
590 | + bIMEInConverting = FALSE; | |
591 | + if (bEnableEPHelper || bIMEModeForced) { | |
592 | + if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
597 | 593 | Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); |
598 | 594 | } |
599 | 595 | } |
600 | 596 | break; |
601 | 597 | case KEY_CONVERT: // JP(IME/ENG) 変換 (0x1c) |
602 | - if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
598 | + bIMEInConverting = FALSE; | |
599 | + if (bEnableEPHelper || bIMEModeForced) { | |
603 | 600 | SetFocus(hForeWnd); |
604 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
601 | + if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { | |
605 | 602 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
606 | 603 | Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); |
607 | 604 | } |
@@ -615,8 +612,8 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
615 | 612 | break; |
616 | 613 | case KEY_NONCONVERT: // JP(IME/ENG) 無変換 (0x1d) |
617 | 614 | bIMEInConverting = FALSE; |
618 | - if (bEnableEPHelper) { | |
619 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
615 | + if (bEnableEPHelper || bIMEModeForced) { | |
616 | + if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { | |
620 | 617 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
621 | 618 | if (((UINT64)hPreviousHKL & LANG_MASK) != LANG_IME) { |
622 | 619 | PostMessage(hWnd, WM_SYSKEYDOWNUPEX, KEY_OEM_PA1, (0x80000000)); |
@@ -625,51 +622,55 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
625 | 622 | Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); |
626 | 623 | } |
627 | 624 | } |
625 | + else { | |
626 | + if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
627 | + Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
628 | + } | |
629 | + } | |
628 | 630 | } |
629 | 631 | } |
630 | 632 | break; |
631 | 633 | case KEY_OEM_3: // JP(IME/ENG) [@] / US(ENG) IME ON (0xc0) = ['] ALT + 半角/全角 or 漢字 |
632 | 634 | case KEY_OEM_8: // JP(IME/ENG) [`] / UK(ENG) IME ON (0xdf) = ['] ALT + 半角/全角 or 漢字 |
633 | - if (bEnableEPHelper) { | |
634 | - while (GetAsyncKeyState(VK_MENU) & 0x8000) | |
635 | - { | |
636 | - Sleep(50); | |
635 | + if (bEnableEPHelper || bIMEModeForced) { | |
636 | + if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { | |
637 | + Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); | |
637 | 638 | } |
638 | - PostMessage(hWnd, WM_SYSKEYDOWNUPEX, KEY_OEM_IME_ON, (0x80000000)); | |
639 | - Sleep(10); | |
640 | 639 | } |
640 | + break; | |
641 | 641 | return; |
642 | 642 | case KEY_OEM_PA1: // US(ENG) 無変換 (0xeb) |
643 | 643 | bIMEInConverting = FALSE; |
644 | - if (bEnableEPHelper) { | |
645 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
646 | - if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { | |
647 | - Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
648 | - } | |
649 | - else { // KEY_OEM_PA1 is from US KB | |
650 | - Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
651 | - } | |
644 | + if (bEnableEPHelper || bIMEModeForced) { | |
645 | + if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { | |
646 | + Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
652 | 647 | } |
653 | 648 | } |
654 | 649 | break; |
655 | 650 | case KEY_OEM_ATTN: // JP(IME/ENG) 英数/CapsLock(0xf0) |
656 | 651 | bIMEInConverting = FALSE; |
657 | - if (bEnableEPHelper) { | |
658 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
652 | + if (bEnableEPHelper || bIMEModeForced) { | |
653 | + if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { | |
659 | 654 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
660 | 655 | Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); |
661 | 656 | } |
657 | + else { | |
658 | + if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
659 | + Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
660 | + } | |
661 | + } | |
662 | 662 | } |
663 | 663 | } |
664 | 664 | break; |
665 | 665 | case KEY_OEM_FINISH: // JP(IME/ENG) OEM カタカナ (0xf1) |
666 | - if (bEnableEPHelper) { | |
667 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
666 | + bIMEInConverting = FALSE; | |
667 | + if (bEnableEPHelper || bIMEModeForced) { | |
668 | + if (bForExplorerPatcherSWS(hForeWnd, bIMEModeForced, TRUE, &hNewHKL, &hPreviousHKL)) { | |
668 | 669 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
669 | 670 | Cime->vIMEConvertModeChangeForced(hForeWnd, ZENKANA_IMEON); |
670 | 671 | } |
671 | 672 | else { |
672 | - if (bIMEModeForced != FALSE) { | |
673 | + if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
673 | 674 | Cime->vIMEConvertModeChangeForced(hForeWnd, ZENKANA_IMEON); |
674 | 675 | } |
675 | 676 | } |
@@ -677,28 +678,35 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
677 | 678 | } |
678 | 679 | break; |
679 | 680 | case KEY_OEM_COPY: // JP(IME/ENG) OEM ひらがな (0xf2) |
680 | - if (bEnableEPHelper) { | |
681 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
681 | + bIMEInConverting = FALSE; | |
682 | + if (bEnableEPHelper || bIMEModeForced) { | |
683 | + if (bForExplorerPatcherSWS(hForeWnd, bIMEModeForced, TRUE, &hNewHKL, &hPreviousHKL)) { | |
682 | 684 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
683 | 685 | Cime->vIMEConvertModeChangeForced(hForeWnd, ZENHIRA_IMEON); |
684 | 686 | } |
685 | 687 | else { |
686 | - if (bIMEModeForced != FALSE) { | |
688 | + if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
687 | 689 | Cime->vIMEConvertModeChangeForced(hForeWnd, ZENHIRA_IMEON); |
688 | 690 | } |
689 | 691 | } |
690 | 692 | } |
691 | 693 | } |
692 | 694 | break; |
693 | - case KEY_OEM_IME_OFF: // JP(IME/ENG) IME OFF (0xf3) But It's IME ON when key up | |
694 | - if (bEnableEPHelper) { | |
695 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
695 | + case KEY_OEM_IME_OFF: // JP(IME/ENG) IME OFF | |
696 | + bIMEInConverting = FALSE; | |
697 | + if (bEnableEPHelper || bIMEModeForced) { | |
698 | + DWORD dwBeforeIMEMode = Cime->dwIMEMode(hForeWnd, FALSE); | |
699 | + if (bForExplorerPatcherSWS(hForeWnd, bIMEModeForced, TRUE, &hNewHKL, &hPreviousHKL)) { | |
696 | 700 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
697 | - Cime->vIMEConvertModeChangeForced(hForeWnd, ZENHIRA_IMEON); | |
701 | + if (dwBeforeIMEMode == IMEOFF) { | |
702 | + Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); | |
703 | + } | |
698 | 704 | } |
699 | 705 | else { |
700 | 706 | if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { |
701 | - Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); | |
707 | + if (dwBeforeIMEMode != IMEOFF) { | |
708 | + Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
709 | + } | |
702 | 710 | } |
703 | 711 | } |
704 | 712 | } |
@@ -706,14 +714,21 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
706 | 714 | break; |
707 | 715 | case KEY_OEM_IME_ON: // JP(IME/ENG) IME ON |
708 | 716 | bIMEInConverting = FALSE; |
709 | - if (bEnableEPHelper) { | |
710 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
717 | + if (bEnableEPHelper || bIMEModeForced) { | |
718 | + DWORD dwBeforeIMEMode = Cime->dwIMEMode(hForeWnd, FALSE); | |
719 | + if (bForExplorerPatcherSWS(GetForegroundWindow(), bIMEModeForced, TRUE, &hNewHKL, &hPreviousHKL)) { | |
711 | 720 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
712 | - Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); | |
721 | + if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { | |
722 | + if (dwBeforeIMEMode == IMEOFF) { | |
723 | + Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); | |
724 | + } | |
725 | + } | |
713 | 726 | } |
714 | 727 | else { |
715 | 728 | if ((bIMEModeForced != FALSE) && (!Cime->bIsNewIME())) { |
716 | - Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
729 | + if (dwBeforeIMEMode != IMEOFF) { | |
730 | + Cime->vIMEOpenCloseForced(hForeWnd, IMECLOSE); | |
731 | + } | |
717 | 732 | } |
718 | 733 | } |
719 | 734 | } |
@@ -722,9 +737,9 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
722 | 737 | case KEY_OEM_BACKTAB: // OEM Alt+カタカナ/ひらがな (0xf5) |
723 | 738 | case KEY_FF: // US(ENG) 変換/ひら/カタ (0xff) |
724 | 739 | bIMEInConverting = FALSE; |
725 | - if (bEnableEPHelper) { | |
740 | + if (bEnableEPHelper || bIMEModeForced) { | |
726 | 741 | SetFocus(hForeWnd); |
727 | - if (bForExplorerPatcherSWS(hForeWnd, TRUE, &hNewHKL, &hPreviousHKL)) { | |
742 | + if (bForExplorerPatcherSWS(hForeWnd, TRUE, bIMEModeForced, &hNewHKL, &hPreviousHKL)) { | |
728 | 743 | if ((hPreviousHKL != JP_IME) && (hNewHKL == JP_IME)) { |
729 | 744 | Cime->vIMEOpenCloseForced(hForeWnd, IMEOPEN); |
730 | 745 | } |
@@ -744,11 +759,10 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
744 | 759 | case KEY_OEM_ATTN: // JP(IME/ENG) 英数/CapsLock(0xf0) |
745 | 760 | case KEY_OEM_FINISH: // JP(IME/ENG) OEM カタカナ (0xf1) |
746 | 761 | case KEY_OEM_COPY: // JP(IME/ENG) OEM ひらがな (0xf2) |
747 | - if (bEnableEPHelper) { | |
762 | + if (bEnableEPHelper) { | |
748 | 763 | PostMessage(hWnd, WM_SYSKEYDOWNUPEX, vk, (0x80000000)); |
749 | - return; | |
750 | 764 | } |
751 | - break; | |
765 | + return; | |
752 | 766 | default: |
753 | 767 | return; |
754 | 768 | } |
@@ -777,7 +791,7 @@ static void Cls_OnSysKeyDownUpEx(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UI | ||
777 | 791 | // for Explorer Patcher Simple Window Switcher |
778 | 792 | // bForExplorerPatcherSWS() |
779 | 793 | // |
780 | -BOOL bForExplorerPatcherSWS(HWND hForeWnd, BOOL bChangeToIME, LPHKL lpNewHKL, LPHKL lpPreviousHKL) | |
794 | +BOOL bForExplorerPatcherSWS(HWND hForeWnd, BOOL bChangeToIME, BOOL bIMEModeForcedChange, LPHKL lpNewHKL, LPHKL lpPreviousHKL) | |
781 | 795 | { |
782 | 796 | if (hForeWnd == NULL) return FALSE; |
783 | 797 | BOOL bRet = FALSE; |
@@ -785,76 +799,93 @@ BOOL bForExplorerPatcherSWS(HWND hForeWnd, BOOL bChangeToIME, LPHKL lpNewHKL, L | ||
785 | 799 | HKL hPreviousHKL = NULL; |
786 | 800 | DWORD dwProcessID = 0; |
787 | 801 | DWORD dwThreadID = 0; |
788 | - dwThreadID = GetWindowThreadProcessId(hForeWnd, &dwProcessID); | |
789 | - if ((hkl = GetKeyboardLayout(dwThreadID)) != NULL) { | |
790 | - int iKeyboardType = GetKeyboardType(1); | |
791 | - if (iKeyboardType == 2) hPreviousHKL = hkl; | |
792 | - else hPreviousHKL = 0x00000000; | |
793 | - if ((bChangeToIME && (hkl != JP_IME)) || (hkl == US_ENG)) { | |
794 | - hkl = JP_IME; | |
795 | - if (ActivateKeyboardLayout(hkl, KLF_SETFORPROCESS) != 0) { | |
796 | - if ((hkl = GetKeyboardLayout(dwThreadID)) != NULL) { // Re Check | |
797 | - if (hkl != JP_IME) { | |
798 | - int iKBList = 0; | |
799 | - if ((iKBList = GetKeyboardLayoutList(0, NULL)) != 0) { | |
800 | - LPHKL lpHKL = NULL; | |
801 | - if ((lpHKL = new HKL[sizeof(HKL) * iKBList]) != NULL) { | |
802 | - ZeroMemory(lpHKL, (sizeof(HKL) * iKBList)); | |
803 | - if ((iKBList = GetKeyboardLayoutList(iKBList, lpHKL)) != 0) { | |
804 | - int iKB = 0, iJP_IME = 0; | |
805 | - for (int i = 0; i < iKBList; i++) { | |
806 | - if (lpHKL[i] == hkl) iKB = i; | |
807 | - if (lpHKL[i] == JP_IME) iJP_IME = i; | |
808 | - } | |
809 | - while (GetAsyncKeyState(VK_SHIFT) & 0x8000) { | |
810 | - Sleep(50); | |
811 | - } | |
812 | - iKB = iKBList - iKB + iJP_IME; | |
813 | - LPINPUT lpInputs = NULL; | |
814 | - if ((lpInputs = new INPUT[sizeof(INPUT) * (iKB * 2 + 2)]) != NULL) { | |
815 | - ZeroMemory(lpInputs, sizeof(INPUT) * (iKB * 2 + 2)); | |
816 | - lpInputs[0].type = INPUT_KEYBOARD; lpInputs[0].ki.wVk = VK_LWIN; | |
817 | - int i = 0; | |
818 | - for (; i < ((iKB * 2)); i = i + 2) { | |
819 | - lpInputs[i + 1].type = INPUT_KEYBOARD; lpInputs[i + 1].ki.wVk = VK_SPACE; | |
820 | - lpInputs[i + 2].type = INPUT_KEYBOARD; lpInputs[i + 2].ki.wVk = VK_SPACE; lpInputs[i + 2].ki.dwFlags = KEYEVENTF_KEYUP; | |
821 | - } | |
822 | - lpInputs[iKB * 2 + 1].type = INPUT_KEYBOARD; lpInputs[iKB * 2 + 1].ki.wVk = VK_LWIN; lpInputs[iKB * 2 + 1].ki.dwFlags = KEYEVENTF_KEYUP; | |
823 | - if (bSendInputSub((UINT)(iKB * 2 + 2), lpInputs)) { | |
824 | - hkl = lpHKL[iJP_IME]; | |
825 | - if (hkl != NULL) { | |
826 | - if (ActivateKeyboardLayout(hkl, KLF_SETFORPROCESS) != 0) { | |
827 | - EnumChildWindows(hForeWnd, &bEnumChildProcChangeHKL, (LPARAM)hkl); | |
828 | - bRet = TRUE; | |
829 | - } | |
830 | - } | |
831 | - } | |
832 | - delete[] lpInputs; | |
833 | - } | |
802 | + DWORD dwInputLocale = 0; | |
803 | + if ((dwThreadID = GetWindowThreadProcessId(hForeWnd, &dwProcessID)) != 0) { | |
804 | + if ((hkl = GetKeyboardLayout(dwThreadID)) != NULL) { | |
805 | + if ((dwInputLocale = Cime->dwGetInputLocale()) != 0) { | |
806 | + hkl = (HKL)(((UINT64)hkl & KB_MASK) | (dwInputLocale & LANG_MASK)); | |
807 | + int iKeyboardType = GetKeyboardType(1); | |
808 | + if (iKeyboardType == 2) hPreviousHKL = hkl; | |
809 | + else hPreviousHKL = US_ENG; | |
810 | + if ((bChangeToIME && (hkl != JP_IME)) || (hkl == US_ENG) || bIMEModeForcedChange) { | |
811 | + hkl = JP_IME; | |
812 | + if (ActivateKeyboardLayout(hkl, (KLF_SETFORPROCESS | KLF_REORDER)) != 0) { | |
813 | + //EnumChildWindows(hForeWnd, &bEnumChildProcChangeHKL, (LPARAM)hkl); | |
814 | + //Cime->vActivateIME(hForeWnd); | |
815 | + if ((hkl = GetKeyboardLayout(dwThreadID)) != NULL) { // Re Check | |
816 | + if (hkl != JP_IME) { | |
817 | + if (bChangeHKLbySendInput(JP_IME, hkl)) { | |
818 | + hkl = JP_IME; | |
819 | + bRet = TRUE; | |
834 | 820 | } |
835 | - delete[] lpHKL; | |
821 | + } | |
822 | + else { | |
823 | + bRet = TRUE; | |
836 | 824 | } |
837 | 825 | } |
838 | 826 | } |
839 | - else { | |
840 | - EnumChildWindows(hForeWnd, &bEnumChildProcChangeHKL, (LPARAM)hkl); | |
841 | - bRet = TRUE; | |
842 | - } | |
843 | 827 | } |
844 | 828 | } |
845 | 829 | } |
846 | - else { | |
847 | - if (hPreviousHKL != JP_IME) EnumChildWindows(hForeWnd, &bEnumChildProcChangeHKL, (LPARAM)hkl); | |
848 | - bRet = TRUE; | |
849 | - } | |
850 | 830 | } |
851 | - if (bRet) Cime->vActivateIME(hForeWnd); | |
831 | + if (bRet) { | |
832 | + EnumChildWindows(hForeWnd, &bEnumChildProcChangeHKL, (LPARAM)hkl); | |
833 | + Cime->vActivateIME(hForeWnd); | |
834 | + } | |
852 | 835 | if (lpNewHKL != NULL) *lpNewHKL = hkl; |
853 | 836 | if (lpPreviousHKL != NULL) *lpPreviousHKL = hPreviousHKL; |
854 | 837 | return bRet; |
855 | 838 | } |
856 | 839 | |
857 | 840 | // |
841 | +// bChangeHKLbySendInput(); | |
842 | +// | |
843 | +BOOL bChangeHKLbySendInput(HKL hNewHKL, HKL hPreviousHKL) | |
844 | +{ | |
845 | + BOOL bRet = FALSE; | |
846 | + int iKBList = 0; | |
847 | + if ((iKBList = GetKeyboardLayoutList(0, NULL)) != 0) { | |
848 | + LPHKL lpHKL = NULL; | |
849 | + if ((lpHKL = new HKL[sizeof(HKL) * iKBList]) != NULL) { | |
850 | + ZeroMemory(lpHKL, (sizeof(HKL) * iKBList)); | |
851 | + if (GetKeyboardLayoutList(iKBList, lpHKL) != 0) { | |
852 | + int iPreviousKB = 0, iNewKB = 0; | |
853 | + for (int i = 0; i < iKBList; i++) { | |
854 | + if (lpHKL[i] == hPreviousHKL) iPreviousKB = i; | |
855 | + if (lpHKL[i] == hNewHKL) iNewKB = i; | |
856 | + } | |
857 | + //if ((GetAsyncKeyState(VK_SHIFT) & 0x8000)) iKB = iKBList - iKB; | |
858 | + while (GetAsyncKeyState(VK_SHIFT) & 0x8000) { | |
859 | + Sleep(1); | |
860 | + } | |
861 | + int iKB = iKBList - iPreviousKB + iNewKB; | |
862 | + if (iNewKB != iPreviousKB) { | |
863 | + LPINPUT lpInputs = NULL; | |
864 | + if ((lpInputs = new INPUT[sizeof(INPUT) * (iKB * 2 + 2)]) != NULL) { | |
865 | + ZeroMemory(lpInputs, sizeof(INPUT) * (iKB * 2 + 2)); | |
866 | + lpInputs[0].type = INPUT_KEYBOARD; lpInputs[0].ki.wVk = VK_LWIN; | |
867 | + int i = 0; | |
868 | + for (; i < ((iKB * 2)); i = i + 2) { | |
869 | + lpInputs[i + 1].type = INPUT_KEYBOARD; lpInputs[i + 1].ki.wVk = VK_SPACE; | |
870 | + lpInputs[i + 2].type = INPUT_KEYBOARD; lpInputs[i + 2].ki.wVk = VK_SPACE; lpInputs[i + 2].ki.dwFlags = KEYEVENTF_KEYUP; | |
871 | + } | |
872 | + lpInputs[iKB * 2 + 1].type = INPUT_KEYBOARD; lpInputs[iKB * 2 + 1].ki.wVk = VK_LWIN; lpInputs[iKB * 2 + 1].ki.dwFlags = KEYEVENTF_KEYUP; | |
873 | + if (bSendInputSub((UINT)(iKB * 2 + 2), lpInputs)) { | |
874 | + bRet = TRUE; | |
875 | + } | |
876 | + if (lpInputs) delete[] lpInputs; | |
877 | + } | |
878 | + } | |
879 | + else bRet = TRUE; | |
880 | + | |
881 | + } | |
882 | + if (lpHKL) delete[] lpHKL; | |
883 | + } | |
884 | + } | |
885 | + return bRet; | |
886 | +} | |
887 | + | |
888 | +// | |
858 | 889 | // bEnumChildProcChangeHKL() |
859 | 890 | // |
860 | 891 | BOOL CALLBACK bEnumChildProcChangeHKL(HWND hWnd, LPARAM lParam) |
@@ -887,7 +918,7 @@ BOOL bCheckExistingJPIME() | ||
887 | 918 | } |
888 | 919 | } |
889 | 920 | } |
890 | - delete[] lpHKL; | |
921 | + if (lpHKL) delete[] lpHKL; | |
891 | 922 | } |
892 | 923 | } |
893 | 924 | HWND hWnd = FindWindow(CLASS_FLUSHMOUSE32, NULL); |
@@ -908,18 +939,6 @@ static BOOL bSendInputSub(UINT cInputs, LPINPUT pInputs) | ||
908 | 939 | } |
909 | 940 | |
910 | 941 | // |
911 | -// lExceptionFilter() | |
912 | -// | |
913 | -static LONG WINAPI lExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo) | |
914 | -{ | |
915 | - UNREFERENCED_PARAMETER(pExceptionInfo); | |
916 | - | |
917 | - SystemParametersInfo(SPI_SETCURSORS, 0, NULL, 0); | |
918 | - | |
919 | - return EXCEPTION_CONTINUE_SEARCH; | |
920 | -} | |
921 | - | |
922 | -// | |
923 | 942 | // bStartThreadHookTimer() |
924 | 943 | // |
925 | 944 | BOOL bStartThreadHookTimer(HWND hWnd) |
@@ -1091,15 +1110,17 @@ CResource::CResource(LPCTSTR lpszResFile) | ||
1091 | 1110 | hModRes = NULL; |
1092 | 1111 | iResourceLoadCount = 0; |
1093 | 1112 | szResFile = new TCHAR[_MAX_PATH]; |
1094 | - ZeroMemory(szResFile, _MAX_PATH); | |
1095 | - _tcsncpy_s(szResFile, _MAX_PATH, lpszResFile, _TRUNCATE); | |
1113 | + if (szResFile) { | |
1114 | + ZeroMemory(szResFile, sizeof(TCHAR) * _MAX_PATH); | |
1115 | + _tcsncpy_s(szResFile, _MAX_PATH, lpszResFile, _TRUNCATE); | |
1116 | + } | |
1096 | 1117 | } |
1097 | 1118 | |
1098 | 1119 | CResource::~CResource() |
1099 | 1120 | { |
1100 | 1121 | hModRes = NULL; |
1101 | 1122 | iResourceLoadCount = 0; |
1102 | - delete[] szResFile; | |
1123 | + if (szResFile) delete[] szResFile; | |
1103 | 1124 | szResFile = NULL; |
1104 | 1125 | } |
1105 | 1126 |
@@ -47,7 +47,7 @@ private: | ||
47 | 47 | extern BOOL bWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance); |
48 | 48 | extern BOOL bStartThreadHookTimer(HWND hWnd); |
49 | 49 | extern VOID vStopThreadHookTimer(HWND hWnd); |
50 | -extern BOOL bForExplorerPatcherSWS(HWND hForeWnd, BOOL bChangeToIME, LPHKL lpNewHKL, LPHKL lpPreviousHKL); | |
50 | +extern BOOL bForExplorerPatcherSWS(HWND hForeWnd, BOOL bChangeToIME, BOOL bIMEModeForcedChange, LPHKL lpNewHKL, LPHKL lpPreviousHKL); | |
51 | 51 | extern BOOL bCheckExistingJPIME(); |
52 | 52 | |
53 | 53 | // |
@@ -18,7 +18,6 @@ | ||
18 | 18 | #include "Resource.h" |
19 | 19 | #include "..\FlushMouseDLL\GlobalHookDll.h" |
20 | 20 | #include "..\FlushMouseDLL\EventlogDll.h" |
21 | -#include "..\FlushMouseDLL\EventlogData.h" | |
22 | 21 | #include "..\FlushMouseDLL32\FlushMouseDll32.h" |
23 | 22 | #include "..\MiscLIB\CRegistry.h" |
24 | 23 |
@@ -61,26 +60,44 @@ BOOL bCreateTaskTrayWindow(HWND hWnd, HICON hIcon, LPCTSTR lpszTitle) | ||
61 | 60 | nIco.guidItem = GUID_NULL; |
62 | 61 | nIco.uFlags = NIF_INFO | NIF_MESSAGE | NIF_ICON | NIF_TIP; |
63 | 62 | nIco.uCallbackMessage = WM_TASKTRAYEX; |
64 | - nIco.dwState = 0; | |
65 | - nIco.dwInfoFlags = NIIF_USER | NIIF_LARGE_ICON | NIIF_NOSOUND | NIIF_RESPECT_QUIET_TIME | NIIF_LARGE_ICON; | |
63 | + nIco.dwState = NIS_HIDDEN | NIS_SHAREDICON; | |
64 | + nIco.dwInfoFlags = NIIF_USER | NIIF_LARGE_ICON | NIIF_NOSOUND; | |
66 | 65 | nIco.uVersion = NOTIFYICON_VERSION_4; |
67 | 66 | nIco.hIcon = hIcon; |
68 | 67 | if ((nIco.hIcon = LoadIcon(Resource->hLoad(), MAKEINTRESOURCE(IDI_FLUSHMOUSE))) == NULL) { |
69 | 68 | return FALSE; |
70 | 69 | } |
71 | 70 | _tcsncpy_s(nIco.szTip, ARRAYSIZE(nIco.szTip), lpszTitle, _TRUNCATE); |
72 | - if (Shell_NotifyIcon(NIM_ADD, &nIco) == FALSE) { // Add TaskTray Icon | |
73 | - _Post_equals_last_error_ DWORD err = GetLastError(); | |
74 | - if (err == ERROR_TIMEOUT) { | |
75 | - Sleep(1000); | |
76 | - if (Shell_NotifyIcon(NIM_ADD, &nIco) == FALSE) { // Retry once | |
71 | + BOOL bRet = FALSE; | |
72 | + try { | |
73 | + throw bRet = Shell_NotifyIcon(NIM_ADD, &nIco); | |
74 | + } | |
75 | + catch (BOOL) { | |
76 | + if (!bRet) { | |
77 | + _Post_equals_last_error_ DWORD err = GetLastError(); | |
78 | + if (err == ERROR_TIMEOUT) { | |
79 | + Sleep(1000); | |
80 | + try { | |
81 | + throw bRet = Shell_NotifyIcon(NIM_ADD, &nIco); | |
82 | + } | |
83 | + catch (BOOL) { | |
84 | + if (!bRet) { | |
85 | + return FALSE; | |
86 | + } | |
87 | + } | |
88 | + catch (...) { | |
89 | + return FALSE; | |
90 | + } | |
91 | + } | |
92 | + else { | |
77 | 93 | return FALSE; |
78 | 94 | } |
79 | 95 | } |
80 | - else { | |
81 | - return FALSE; | |
82 | - } | |
83 | 96 | } |
97 | + catch (...) { | |
98 | + return FALSE; | |
99 | + } | |
100 | + | |
84 | 101 | if ((uTaskbarCreatedMessage = RegisterWindowMessage(_T("TaskbarCreated"))) == 0) { |
85 | 102 | bDestroyTaskTrayWindow(hWnd); |
86 | 103 | return FALSE; |
@@ -137,9 +154,16 @@ BOOL bDestroyTaskTrayWindow(HWND hWnd) | ||
137 | 154 | nIco.uID = NOTIFYICONDATA_ID; |
138 | 155 | nIco.guidItem = GUID_NULL; |
139 | 156 | nIco.uFlags = 0; |
140 | - if (Shell_NotifyIcon(NIM_DELETE, &nIco) != FALSE) { | |
141 | - bTaskTray = FALSE; | |
142 | - return TRUE; | |
157 | + try { | |
158 | + throw Shell_NotifyIcon(NIM_DELETE, &nIco); | |
159 | + } | |
160 | + catch (BOOL bRet) { | |
161 | + if (bRet) { | |
162 | + bTaskTray = FALSE; | |
163 | + return TRUE; | |
164 | + } | |
165 | + } | |
166 | + catch (...) { | |
143 | 167 | } |
144 | 168 | } |
145 | 169 | return FALSE; |
@@ -156,11 +180,19 @@ BOOL bGetTaskTrayWindowRect(HWND hWnd, LPRECT lpRect) | ||
156 | 180 | nii.hWnd = hWnd; |
157 | 181 | nii.uID = NOTIFYICONDATA_ID; |
158 | 182 | nii.guidItem = GUID_NULL; |
159 | - HRESULT hResult = E_FAIL; | |
160 | - if ((hResult = Shell_NotifyIconGetRect(&nii, lpRect)) != S_OK) { | |
183 | + try { | |
184 | + throw Shell_NotifyIconGetRect(&nii, lpRect); | |
185 | + } | |
186 | + catch (HRESULT hResult) { | |
187 | + if (hResult != S_OK) { | |
188 | + return FALSE; | |
189 | + } | |
190 | + return TRUE; | |
191 | + } | |
192 | + catch (...) { | |
193 | + PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); | |
161 | 194 | return FALSE; |
162 | 195 | } |
163 | - return TRUE; | |
164 | 196 | } |
165 | 197 | return FALSE; |
166 | 198 | } |
@@ -194,6 +226,7 @@ void Cls_OnTaskTrayEx(HWND hWnd, UINT id, UINT uMsg) | ||
194 | 226 | SetForegroundWindow(hWnd); |
195 | 227 | APPBARDATA stAppBarData{}; |
196 | 228 | stAppBarData.cbSize = sizeof(APPBARDATA); |
229 | + stAppBarData.hWnd = hWnd; | |
197 | 230 | SHAppBarMessage(ABM_GETTASKBARPOS, &stAppBarData); |
198 | 231 | UINT uFlags = 0; |
199 | 232 | switch (stAppBarData.uEdge) { |
@@ -221,8 +254,6 @@ void Cls_OnTaskTrayEx(HWND hWnd, UINT id, UINT uMsg) | ||
221 | 254 | //EnableMenuItem(hSubMenu, IDR_TT_SETTING, MF_BYCOMMAND | MF_DISABLED); |
222 | 255 | } |
223 | 256 | TrackPopupMenu(hSubMenu, uFlags, pt.x, pt.y, 0, hWnd, NULL); |
224 | - DestroyMenu(hMenu); | |
225 | - PostMessage(hWnd, WM_NULL, 0, 0); | |
226 | 257 | break; |
227 | 258 | } |
228 | 259 | } |
@@ -705,12 +736,15 @@ CFlushMouseHook::CFlushMouseHook() | ||
705 | 736 | bKeyboardHook64 = FALSE; |
706 | 737 | bMouseHook64 = FALSE; |
707 | 738 | bHook32Dll = FALSE; |
708 | - lpstProcessInfomation = NULL; | |
739 | + lpstProcessInfomation = new PROCESS_INFORMATION[sizeof(PROCESS_INFORMATION)]; | |
740 | + if (lpstProcessInfomation) ZeroMemory(lpstProcessInfomation, sizeof(PROCESS_INFORMATION)); | |
709 | 741 | } |
710 | 742 | |
711 | 743 | CFlushMouseHook::~CFlushMouseHook() |
712 | 744 | { |
713 | 745 | bHookUnset(); |
746 | + if (lpstProcessInfomation) delete[] lpstProcessInfomation; | |
747 | + lpstProcessInfomation = NULL; | |
714 | 748 | } |
715 | 749 | // |
716 | 750 | // bHookSet() |
@@ -738,69 +772,37 @@ BOOL CFlushMouseHook::bHookUnset() | ||
738 | 772 | } |
739 | 773 | |
740 | 774 | // |
741 | -// bHook64DllLoad() | |
742 | -// | |
743 | -BOOL CFlushMouseHook::bHook64DllLoad(LPCTSTR lpszDll64Name) | |
744 | -{ | |
745 | - DWORD dwSize = 0; | |
746 | - dwSize = ExpandEnvironmentStrings(lpszDll64Name, NULL, 0); | |
747 | - LPTSTR lpszBuffer = new TCHAR[dwSize]; | |
748 | - ZeroMemory(lpszBuffer, dwSize); | |
749 | - dwSize = ExpandEnvironmentStrings(lpszDll64Name, lpszBuffer, dwSize); | |
750 | - BOOL bRet = FALSE; | |
751 | - if (hHook64Dll == NULL) { | |
752 | - if ((hHook64Dll = LoadLibraryEx(lpszBuffer, NULL, 0)) != NULL) { | |
753 | - bRet = TRUE; | |
754 | - } | |
755 | - } | |
756 | - delete[] lpszBuffer; | |
757 | - return bRet; | |
758 | -} | |
759 | - | |
760 | -// | |
761 | -// bHook64DllUnload() | |
762 | -// | |
763 | -BOOL CFlushMouseHook::bHook64DllUnload() | |
764 | -{ | |
765 | - if (hHook64Dll != NULL) { | |
766 | - if (!FreeLibrary(hHook64Dll)) { | |
767 | - return FALSE; | |
768 | - } | |
769 | - } | |
770 | - hHook64Dll = NULL; | |
771 | - return TRUE; | |
772 | -} | |
773 | - | |
774 | -// | |
775 | 775 | // bHook32DllStart() |
776 | 776 | // |
777 | 777 | BOOL CFlushMouseHook::bHook32DllStart(HWND hWnd, LPCTSTR lpszExec32Name) |
778 | 778 | { |
779 | 779 | #define COMAMANDLINESIZE (sizeof(_T(" ")) * (sizeof(unsigned long long) + 1)) |
780 | + BOOL bRet = FALSE; | |
780 | 781 | DWORD dwSize = 0; |
781 | 782 | dwSize = ExpandEnvironmentStrings(lpszExec32Name, NULL, 0); |
782 | 783 | LPTSTR lpszBuffer = new TCHAR[dwSize]; |
783 | - ZeroMemory(lpszBuffer, dwSize); | |
784 | - dwSize = ExpandEnvironmentStrings(lpszExec32Name, lpszBuffer, dwSize); | |
785 | - | |
786 | - LPTSTR lpszCommandLine = NULL; | |
787 | - lpszCommandLine = new TCHAR[dwSize + COMAMANDLINESIZE]; | |
788 | - ZeroMemory(lpszCommandLine, (dwSize + sizeof(COMAMANDLINESIZE))); | |
789 | - _sntprintf_s(lpszCommandLine, (dwSize + COMAMANDLINESIZE), _TRUNCATE, _T("%s %llu"), lpszBuffer, (unsigned long long)hWnd); | |
790 | - if (lpszBuffer != NULL) delete[] lpszBuffer; | |
791 | - | |
792 | - lpstProcessInfomation = new PROCESS_INFORMATION[sizeof(PROCESS_INFORMATION)]; | |
793 | - ZeroMemory(lpstProcessInfomation, sizeof(PROCESS_INFORMATION)); | |
794 | - STARTUPINFO stStartupInfo{}; stStartupInfo.cb = sizeof(STARTUPINFO); | |
795 | - BOOL bRet = FALSE; | |
796 | - if ((bRet = CreateProcess(NULL, lpszCommandLine, NULL, NULL, TRUE, | |
797 | - NORMAL_PRIORITY_CLASS, NULL, NULL, &stStartupInfo, lpstProcessInfomation)) == FALSE) { | |
798 | - delete[] lpstProcessInfomation; | |
799 | - } | |
800 | - else { | |
801 | - bHook32Dll = TRUE; | |
784 | + if (lpszBuffer) { | |
785 | + ZeroMemory(lpszBuffer, dwSize); | |
786 | + dwSize = ExpandEnvironmentStrings(lpszExec32Name, lpszBuffer, dwSize); | |
787 | + | |
788 | + LPTSTR lpszCommandLine = NULL; | |
789 | + lpszCommandLine = new TCHAR[dwSize + COMAMANDLINESIZE]; | |
790 | + if (lpszCommandLine) { | |
791 | + ZeroMemory(lpszCommandLine, (dwSize + sizeof(COMAMANDLINESIZE))); | |
792 | + _sntprintf_s(lpszCommandLine, (dwSize + COMAMANDLINESIZE), _TRUNCATE, _T("%s %llu"), lpszBuffer, (unsigned long long)hWnd); | |
793 | + if (lpstProcessInfomation) { | |
794 | + STARTUPINFO stStartupInfo{}; stStartupInfo.cb = sizeof(STARTUPINFO); | |
795 | + if ((bRet = CreateProcess(NULL, lpszCommandLine, NULL, NULL, TRUE, | |
796 | + NORMAL_PRIORITY_CLASS, NULL, NULL, &stStartupInfo, lpstProcessInfomation)) == FALSE) { | |
797 | + } | |
798 | + else { | |
799 | + bHook32Dll = TRUE; | |
800 | + } | |
801 | + } | |
802 | + delete[] lpszCommandLine; | |
803 | + } | |
804 | + delete[] lpszBuffer; | |
802 | 805 | } |
803 | - if (lpszCommandLine != NULL) delete[] lpszCommandLine; | |
804 | 806 | return bRet; |
805 | 807 | } |
806 | 808 |
@@ -812,37 +814,38 @@ BOOL CFlushMouseHook::bHook32DllStop() | ||
812 | 814 | #define TIMEOUT 1000 |
813 | 815 | if (!bHook32Dll) return TRUE; |
814 | 816 | BOOL bRet = FALSE; |
815 | - if (lpstProcessInfomation->hProcess != NULL) { | |
816 | - if (!EnumWindows((WNDENUMPROC)&CFlushMouseHook::bEnumWindowsProcHookStop, (LPARAM)lpstProcessInfomation)) { | |
817 | - if (GetLastError() == ERROR_SUCCESS) { | |
818 | - DWORD dwRet = WaitForSingleObject(lpstProcessInfomation->hProcess, TIMEOUT); | |
819 | - switch (dwRet) { | |
820 | - case WAIT_OBJECT_0: | |
821 | - bRet = TRUE; | |
822 | - break; | |
823 | - case WAIT_FAILED: | |
824 | - case WAIT_ABANDONED: | |
825 | - case WAIT_TIMEOUT: | |
826 | - default: | |
827 | - if (TerminateProcess(lpstProcessInfomation->hProcess, 0) != 0) { | |
817 | + if (lpstProcessInfomation != NULL) { | |
818 | + if (lpstProcessInfomation->hProcess != NULL) { | |
819 | + if (!EnumWindows((WNDENUMPROC)&CFlushMouseHook::bEnumWindowsProcHookStop, (LPARAM)lpstProcessInfomation)) { | |
820 | + if (GetLastError() == ERROR_SUCCESS) { | |
821 | + DWORD dwRet = WaitForSingleObject(lpstProcessInfomation->hProcess, TIMEOUT); | |
822 | + switch (dwRet) { | |
823 | + case WAIT_OBJECT_0: | |
824 | + bRet = TRUE; | |
825 | + break; | |
826 | + case WAIT_FAILED: | |
827 | + case WAIT_ABANDONED: | |
828 | + case WAIT_TIMEOUT: | |
829 | + default: | |
830 | + if (TerminateProcess(lpstProcessInfomation->hProcess, 0)) { | |
831 | + bRet = TRUE; | |
832 | + } | |
828 | 833 | bRet = TRUE; |
829 | 834 | } |
835 | + DWORD dwExitCode; | |
836 | + if (!GetExitCodeProcess(lpstProcessInfomation->hProcess, &dwExitCode)) { | |
837 | + bRet = FALSE; | |
838 | + } | |
839 | + if (lpstProcessInfomation->hProcess != NULL) { | |
840 | + CloseHandle(lpstProcessInfomation->hProcess); | |
841 | + } | |
830 | 842 | } |
831 | - DWORD dwExitCode; | |
832 | - if (!GetExitCodeProcess(lpstProcessInfomation->hProcess, &dwExitCode)) { | |
833 | - bRet = FALSE; | |
834 | - } | |
835 | - if (lpstProcessInfomation->hProcess != NULL) { | |
836 | - CloseHandle(lpstProcessInfomation->hProcess); | |
843 | + if (lpstProcessInfomation->hThread != NULL) { | |
844 | + CloseHandle(lpstProcessInfomation->hThread); | |
837 | 845 | } |
838 | 846 | } |
839 | - if (lpstProcessInfomation->hThread != NULL) { | |
840 | - CloseHandle(lpstProcessInfomation->hThread); | |
841 | - } | |
842 | 847 | } |
843 | 848 | } |
844 | - delete[] lpstProcessInfomation; | |
845 | - lpstProcessInfomation = NULL; | |
846 | 849 | return bRet; |
847 | 850 | } |
848 | 851 |
@@ -28,9 +28,8 @@ | ||
28 | 28 | // |
29 | 29 | // Define |
30 | 30 | // |
31 | -#define MAX_LOADSTRING 100 | |
32 | 31 | // Timer |
33 | -#define PROCINITTIMERVALUE 3000 | |
32 | +#define PROCINITTIMERVALUE 1000 | |
34 | 33 | #define CHECKPROCTIMERID 2 |
35 | 34 | static UINT nCheckProcTimerTickValue = PROCINITTIMERVALUE; // Timer tick |
36 | 35 | static UINT_PTR nCheckProcTimerID = CHECKPROCTIMERID; // Timer ID |
@@ -71,7 +70,6 @@ static void Cls_OnCheckExistingJPIMEEx(HWND hWnd, BOOL bEPHelper); | ||
71 | 70 | // Sub |
72 | 71 | static VOID CALLBACK vCheckProcTimerProc(HWND hWnd, UINT uMsg, UINT uTimerID, DWORD dwTime); |
73 | 72 | static BOOL bReportEvent(DWORD dwEventID, WORD wCategory); |
74 | -static LONG WINAPI lExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo); | |
75 | 73 | static void vMessageBox(HWND hWnd, UINT uID, UINT uType); |
76 | 74 | |
77 | 75 | // |
@@ -87,11 +85,14 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
87 | 85 | _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); |
88 | 86 | #endif |
89 | 87 | |
90 | - SetUnhandledExceptionFilter(&lExceptionFilter); | |
88 | + HANDLE hHandle = GetCurrentProcess(); | |
89 | + if (!SetPriorityClass(hHandle, NORMAL_PRIORITY_CLASS)) { | |
90 | + return (-1); | |
91 | + } | |
91 | 92 | |
92 | 93 | if (*lpCmdLine == _T('\0')) { |
93 | 94 | hParentWnd = NULL; |
94 | - vMessageBox(NULL, IDS_NOTFORKBY64, MessageBoxTYPE); // 不正起動のためメッセージを表示 | |
95 | + vMessageBox(NULL, IDS_NOTFORKBY64, MessageBoxTYPE); | |
95 | 96 | return (-1); |
96 | 97 | } |
97 | 98 | else { |
@@ -118,7 +119,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
118 | 119 | PostMessage(hWnd, WM_DESTROY, NULL, NULL); |
119 | 120 | for (int i = 3; i > 0; i--) { |
120 | 121 | Sleep(500); |
121 | - if (FindWindow(CLASS_FLUSHMOUSE32, NULL) != NULL) { | |
122 | + if ((hWnd = FindWindow(CLASS_FLUSHMOUSE32, NULL)) != NULL) { | |
123 | + SetFocus(GetLastActivePopup(hWnd)); | |
124 | + PostMessage(hWnd, WM_DESTROY, NULL, NULL); | |
122 | 125 | if (i == 1) { |
123 | 126 | vMessageBox(NULL, IDS_ALREADYRUN, MessageBoxTYPE); |
124 | 127 | return (-1); |
@@ -128,7 +131,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | ||
128 | 131 | } |
129 | 132 | } |
130 | 133 | |
131 | - if (!InitInstance(hInstance, nCmdShow)) { // Window作成 | |
134 | + if (!InitInstance(hInstance, nCmdShow)) { | |
132 | 135 | return (-1); |
133 | 136 | } |
134 | 137 |
@@ -254,8 +257,8 @@ static BOOL Cls_OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct) | ||
254 | 257 | // |
255 | 258 | static void Cls_OnDestroy(HWND hWnd) |
256 | 259 | { |
257 | - EXCEPTION_POINTERS ExceptionInfo{}; | |
258 | - lExceptionFilter(&ExceptionInfo); | |
260 | + bKeyboardHookLLUnset32(); | |
261 | + bMouseHookUnset32(); | |
259 | 262 | |
260 | 263 | if (uCheckProcTimer != NULL) { |
261 | 264 | if (KillTimer(hWnd, nCheckProcTimerID)) { |
@@ -273,7 +276,7 @@ static void Cls_OnCheckExistingJPIMEEx(HWND hWnd, BOOL bEPHelper) | ||
273 | 276 | { |
274 | 277 | UNREFERENCED_PARAMETER(hWnd); |
275 | 278 | if (!bSetEnableEPHelperLL32(bEPHelper)) { |
276 | - DestroyWindow(hWnd); | |
279 | + PostMessage(hWnd, WM_DESTROY, (WPARAM)0, (LPARAM)0); | |
277 | 280 | } |
278 | 281 | } |
279 | 282 |
@@ -294,27 +297,25 @@ static VOID CALLBACK vCheckProcTimerProc(HWND hWnd, UINT uMsg, UINT uTimerID, DW | ||
294 | 297 | nIco.uID = NOTIFYICONDATA_ID; |
295 | 298 | nIco.guidItem = GUID_NULL; |
296 | 299 | nIco.uFlags = 0; |
297 | - if (Shell_NotifyIcon(NIM_DELETE, &nIco) == FALSE) { | |
298 | - bReportEvent(MSG_RESTART_EVENT, APPLICATION32_CATEGORY); | |
299 | - PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); | |
300 | + try { | |
301 | + throw Shell_NotifyIcon(NIM_DELETE, &nIco); // Delete TaskTray Icon | |
302 | + } | |
303 | + catch (BOOL bRet) { | |
304 | + if (!bRet) { | |
305 | + return; | |
306 | + } | |
307 | + } | |
308 | + catch (...) { | |
309 | + return; | |
300 | 310 | } |
311 | + bReportEvent(MSG_RESTART_EVENT, APPLICATION32_CATEGORY); // FlushMouseが動いていないため再起動する | |
312 | + PostMessage(hWnd, WM_DESTROY, (WPARAM)NULL, (LPARAM)NULL); // Quit | |
301 | 313 | } |
302 | 314 | } |
303 | 315 | return; |
304 | 316 | } |
305 | 317 | |
306 | 318 | // |
307 | -// lExceptionFilter() | |
308 | -// | |
309 | -static LONG WINAPI lExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo) | |
310 | -{ | |
311 | - UNREFERENCED_PARAMETER(pExceptionInfo); | |
312 | - bKeyboardHookLLUnset32(); // Keyboard Hook LL の解除 | |
313 | - bMouseHookUnset32(); // Mouse Hook の解除 | |
314 | - return EXCEPTION_CONTINUE_SEARCH; | |
315 | -} | |
316 | - | |
317 | -// | |
318 | 319 | // bReportEvent() |
319 | 320 | // |
320 | 321 | static BOOL bReportEvent(DWORD dwEventID, WORD wCategory) |
@@ -0,0 +1,34 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
2 | +<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> | |
3 | + <assemblyIdentity | |
4 | + type="win32" | |
5 | + name="FlushMouse32.exe" | |
6 | + version="0.2.0.1" | |
7 | + processorArchitecture="x86" | |
8 | + /> | |
9 | + <description>FlushMouse Application</description> | |
10 | + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | |
11 | + <application> | |
12 | + <!-- Windows 10 and Windows 11 --> | |
13 | + <maxversiontested Id="10.0.19041.0"/> | |
14 | + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> | |
15 | + <!-- DPI Awareness --> | |
16 | + <!-- Per Monitor V2 [OS >= Windows 10 Creators Update (1703, 10.0.15063, Redstone 2)] Value: PerMonitorV2 --> | |
17 | + <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> | |
18 | + PerMonitorV2, PerMonitor | |
19 | + </dpiAwareness> | |
20 | + <!-- GDI Scaling --> | |
21 | + <gdiScaling>true</gdiScaling> | |
22 | + </application> | |
23 | + </compatibility> | |
24 | + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> | |
25 | + <security> | |
26 | + <requestedPrivileges> | |
27 | + <!-- UAC settings --> | |
28 | + <!--requestedExecutionLevel level="requireAdministrator" uiAccess="false"/--> | |
29 | + <!--requestedExecutionLevel level="highestAvailable" uiAccess="false"/--> | |
30 | + <requestedExecutionLevel level="asInvoker" uiAccess="false"/> | |
31 | + </requestedPrivileges> | |
32 | + </security> | |
33 | + </trustInfo> | |
34 | +</assembly> |
@@ -219,6 +219,9 @@ | ||
219 | 219 | <Project>{3d3f632c-75bb-4830-aa8e-0871c6aa1a72}</Project> |
220 | 220 | </ProjectReference> |
221 | 221 | </ItemGroup> |
222 | + <ItemGroup> | |
223 | + <Manifest Include="FlushMouse32.exe.manifest" /> | |
224 | + </ItemGroup> | |
222 | 225 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
223 | 226 | <ImportGroup Label="ExtensionTargets"> |
224 | 227 | </ImportGroup> |
@@ -55,4 +55,7 @@ | ||
55 | 55 | <Filter>リソース ファイル</Filter> |
56 | 56 | </Image> |
57 | 57 | </ItemGroup> |
58 | + <ItemGroup> | |
59 | + <Manifest Include="FlushMouse32.exe.manifest" /> | |
60 | + </ItemGroup> | |
58 | 61 | </Project> |
\ No newline at end of file |
@@ -6,6 +6,7 @@ | ||
6 | 6 | // #0000 2023/04/13 JeffyTS New edit. |
7 | 7 | // |
8 | 8 | // |
9 | +// | |
9 | 10 | // Categories of events. |
10 | 11 | // |
11 | 12 | // |
@@ -98,6 +99,15 @@ | ||
98 | 99 | #define POWERNOTIFICATION_CATEGORY ((DWORD)0x00000010L) |
99 | 100 | |
100 | 101 | // |
102 | +// MessageId: TASKSCHDULER_CATEGORY | |
103 | +// | |
104 | +// MessageText: | |
105 | +// | |
106 | +// TaskSheduler Events | |
107 | +// | |
108 | +#define TASKSCHDULER_CATEGORY ((DWORD)0x00000011L) | |
109 | + | |
110 | +// | |
101 | 111 | // Message definitions. |
102 | 112 | // |
103 | 113 | // |
@@ -143,7 +153,7 @@ | ||
143 | 153 | // |
144 | 154 | // Thread, Hook and Timer Restarted. |
145 | 155 | // |
146 | -#define MSG_THREAD_HOOK_TIMER_RESTARTED ((DWORD)0x40000005L) | |
156 | +#define MSG_THREAD_HOOK_TIMER_RESTARTED ((DWORD)0x40000004L) | |
147 | 157 | |
148 | 158 | // |
149 | 159 | // MessageId: MSG_QUIT_FLUSHMOUSE |
@@ -152,7 +162,25 @@ | ||
152 | 162 | // |
153 | 163 | // Quit FlushMouse. |
154 | 164 | // |
155 | -#define MSG_QUIT_FLUSHMOUSE ((DWORD)0x40000006L) | |
165 | +#define MSG_QUIT_FLUSHMOUSE ((DWORD)0x40000005L) | |
166 | + | |
167 | +// | |
168 | +// MessageId: MSG_RESTART_INSTALLER | |
169 | +// | |
170 | +// MessageText: | |
171 | +// | |
172 | +// Start FlushMouse(Installer). | |
173 | +// | |
174 | +#define MSG_RESTART_INSTALLER ((DWORD)0x00000006L) | |
175 | + | |
176 | +// | |
177 | +// MessageId: MSG_DONE_FLUSHMOUSE | |
178 | +// | |
179 | +// MessageText: | |
180 | +// | |
181 | +// Quit FlushMouse(Installer). | |
182 | +// | |
183 | +#define MSG_DONE_FLUSHMOUSE ((DWORD)0x00000007L) | |
156 | 184 | |
157 | 185 | // |
158 | 186 | // MessageId: MSG_PBT_APMSUSPEND |
@@ -5,6 +5,7 @@ | ||
5 | 5 | ;// -------+-----------+-----------+-------------------------------------------- - |
6 | 6 | ;// #0000 2023/04/13 JeffyTS New edit. |
7 | 7 | ;// |
8 | +;// | |
8 | 9 | |
9 | 10 | SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS |
10 | 11 | Informational=0x1:STATUS_SEVERITY_INFORMATIONAL |
@@ -77,6 +78,16 @@ Language=Japanese | ||
77 | 78 | PowerNotification Events |
78 | 79 | . |
79 | 80 | |
81 | +MessageId=0x11 | |
82 | +SymbolicName=TASKSCHDULER_CATEGORY | |
83 | +Language=English | |
84 | +TaskSheduler Events | |
85 | +. | |
86 | + | |
87 | +Language=Japanese | |
88 | +TaskSheduler Events | |
89 | +. | |
90 | + | |
80 | 91 | |
81 | 92 | ;// |
82 | 93 | ;// Message definitions. |
@@ -130,7 +141,7 @@ Language=Japanese | ||
130 | 141 | Thread, Hook and Timer Stopped. |
131 | 142 | . |
132 | 143 | |
133 | -MessageId=0x0005 | |
144 | +MessageId=0x0004 | |
134 | 145 | Severity=Informational |
135 | 146 | Facility=Application |
136 | 147 | SymbolicName=MSG_THREAD_HOOK_TIMER_RESTARTED |
@@ -142,7 +153,7 @@ Language=Japanese | ||
142 | 153 | Thread, Hook and Timer Restarted. |
143 | 154 | . |
144 | 155 | |
145 | -MessageId=0x0006 | |
156 | +MessageId=0x0005 | |
146 | 157 | Severity=Informational |
147 | 158 | Facility=Application |
148 | 159 | SymbolicName=MSG_QUIT_FLUSHMOUSE |
@@ -154,6 +165,30 @@ Language=Japanese | ||
154 | 165 | FlushMouseを終了します。 |
155 | 166 | . |
156 | 167 | |
168 | +MessageId=0x0006 | |
169 | +Severity=Success | |
170 | +Facility=Application | |
171 | +SymbolicName=MSG_RESTART_INSTALLER | |
172 | +Language=English | |
173 | +Start FlushMouse(Installer). | |
174 | +. | |
175 | + | |
176 | +Language=Japanese | |
177 | +FlushMouseを起動します(Installer)。 | |
178 | +. | |
179 | + | |
180 | +MessageId=0x0007 | |
181 | +Severity=Success | |
182 | +Facility=Application | |
183 | +SymbolicName=MSG_DONE_FLUSHMOUSE | |
184 | +Language=English | |
185 | +Quit FlushMouse(Installer). | |
186 | +. | |
187 | + | |
188 | +Language=Japanese | |
189 | +FlushMouseを終了します(Installer)。 | |
190 | +. | |
191 | + | |
157 | 192 | MessageId=0x0100 |
158 | 193 | Severity=Informational |
159 | 194 | Facility=Application |
@@ -12,6 +12,7 @@ | ||
12 | 12 | #pragma once |
13 | 13 | #include "pch.h" |
14 | 14 | #include "FlushMouseDll.h" |
15 | +#include "EventlogData.h" | |
15 | 16 | |
16 | 17 | // |
17 | 18 | // Global Prototype Define |
@@ -62,6 +62,12 @@ DLLEXPORT BOOL __stdcall bGlobalHookSet(HWND hWnd) | ||
62 | 62 | } |
63 | 63 | delete CSharedMem; |
64 | 64 | CSharedMem = NULL; |
65 | + hGLInstance = NULL; | |
66 | + hWndGLParent = NULL; | |
67 | + hHookGL = NULL; | |
68 | + lpDatGlobal = NULL; | |
69 | + hPrevWnd = NULL; | |
70 | + bSubclassed = FALSE; | |
65 | 71 | } |
66 | 72 | return FALSE; |
67 | 73 | } |
@@ -86,6 +92,12 @@ DLLEXPORT BOOL __stdcall bGlobalHookUnset() | ||
86 | 92 | } |
87 | 93 | delete CSharedMem; |
88 | 94 | CSharedMem = NULL; |
95 | + hGLInstance = NULL; | |
96 | + hWndGLParent = NULL; | |
97 | + hHookGL = NULL; | |
98 | + lpDatGlobal = NULL; | |
99 | + hPrevWnd = NULL; | |
100 | + bSubclassed = FALSE; | |
89 | 101 | } |
90 | 102 | return bRet; |
91 | 103 | } |
@@ -119,18 +131,20 @@ static LRESULT CALLBACK lpGlobalHookProc(int nCode, WPARAM wParam, LPARAM lParam | ||
119 | 131 | if (lpCW->message == WM_HOOKEX) { |
120 | 132 | if (bGlobalHookProcSub()) { |
121 | 133 | if (lpCW->lParam) { |
122 | - if (UnhookWindowsHookEx(hHookGL) != FALSE) { | |
123 | - if (!bSubclassed) { | |
134 | + if (!bSubclassed) { | |
135 | + if (hHookGL == NULL) break; | |
136 | + if (UnhookWindowsHookEx(hHookGL) != FALSE) { | |
124 | 137 | #define DLLNAME _T("FlushMouseDLL.dll") |
125 | 138 | if (LoadLibraryEx(DLLNAME, NULL, 0)) { |
126 | 139 | bSubclassed = TRUE; |
127 | 140 | } |
141 | + hHookGL = NULL; | |
128 | 142 | } |
129 | 143 | } |
130 | 144 | } |
131 | 145 | else { |
132 | - if (UnhookWindowsHookEx(hHookGL) != FALSE) { | |
133 | - FreeLibrary(hGLInstance); | |
146 | + if (bSubclassed) { | |
147 | + if (hHookGL == NULL) break; | |
134 | 148 | bSubclassed = FALSE; |
135 | 149 | } |
136 | 150 | } |
@@ -23,8 +23,6 @@ | ||
23 | 23 | // |
24 | 24 | static LRESULT CALLBACK lpKeyboardHookLLProc(int nCode, WPARAM wParam, LPARAM lParam); |
25 | 25 | static BOOL bKeyboardHookLLProcSub(); |
26 | -static BOOL bKBisNotJP(); | |
27 | -static BOOL bKBisEP(); | |
28 | 26 | |
29 | 27 | // |
30 | 28 | // Local Data |
@@ -62,6 +60,12 @@ DLLEXPORT BOOL __stdcall bKeyboardHookLLSet32(HWND hWnd) | ||
62 | 60 | } |
63 | 61 | delete CSharedMemLL; |
64 | 62 | CSharedMemLL = NULL; |
63 | + bOnlyCtrlLL = FALSE; | |
64 | + dwPreviousVKLL = 0; | |
65 | + hWndKBParentLL = NULL; | |
66 | + lpDatKeyboardLL = NULL; | |
67 | + bEnableEPHelperLL = FALSE; | |
68 | + bStartConvertingLL = FALSE; | |
65 | 69 | } |
66 | 70 | return FALSE; |
67 | 71 | } |
@@ -82,6 +86,12 @@ DLLEXPORT BOOL __stdcall bKeyboardHookLLUnset32() | ||
82 | 86 | } |
83 | 87 | delete CSharedMemLL; |
84 | 88 | CSharedMemLL = NULL; |
89 | + bOnlyCtrlLL = FALSE; | |
90 | + dwPreviousVKLL = 0; | |
91 | + hWndKBParentLL = NULL; | |
92 | + lpDatKeyboardLL = NULL; | |
93 | + bEnableEPHelperLL = FALSE; | |
94 | + bStartConvertingLL = FALSE; | |
85 | 95 | } |
86 | 96 | return bRet; |
87 | 97 | } |
@@ -158,7 +168,6 @@ static LRESULT CALLBACK lpKeyboardHookLLProc(int nCode, WPARAM wParam, LPARAM lP | ||
158 | 168 | case VK_F10: // (0x79) |
159 | 169 | //case VK_NUMLOCK: // Num Lock (0x90) |
160 | 170 | case VK_OEM_ATTN: // OEM 英数/CapsLock (0xf0) |
161 | - case VK_OEM_FINISH: // OEM カタカナ (0xf1) | |
162 | 171 | case VK_OEM_COPY: // OEM ひらがな (0xf2) |
163 | 172 | //case VK_OEM_AUTO: // OEM 半角/全角 (0xf3 = VK_OEM_IME_OFF) |
164 | 173 | case VK_OEM_IME_OFF: // OEM IME OFF (0xf3) |
@@ -170,11 +179,21 @@ static LRESULT CALLBACK lpKeyboardHookLLProc(int nCode, WPARAM wParam, LPARAM lP | ||
170 | 179 | PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, (WM_USER + lpstKBH->vkCode), ((0x80000000 | 0xff000000 & (static_cast<LPARAM>(lpstKBH->flags)) << 24))); |
171 | 180 | } |
172 | 181 | break; |
173 | - case 0xff: // US(ENG) Convert (0xff) | |
182 | + case VK_OEM_FINISH: // OEM カタカナ (0xf1) | |
183 | + bOnlyCtrlLL = FALSE; | |
184 | + if (GetAsyncKeyState(VK_SHIFT) & 0x8000) { // Remove Shift + Caps Lock | |
185 | + if (bKeyboardHookLLProcSub()) { | |
186 | + PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, (WM_USER + lpstKBH->vkCode), ((0x80000000 | 0xff000000 & (static_cast<LPARAM>(lpstKBH->flags)) << 24))); | |
187 | + return 1; | |
188 | + } | |
189 | + } | |
190 | + break; | |
191 | + case VK_FF: // US(ENG) Convert (0xff) | |
174 | 192 | if (GetAsyncKeyState(VK_SHIFT) & 0x8000) { |
175 | 193 | if (bKeyboardHookLLProcSub()) { |
176 | 194 | if (!bEnableEPHelperLL) break; |
177 | 195 | PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, KEY_OEM_FINISH, ((0x80000000 | 0xff000000 & (static_cast<LPARAM>(lpstKBH->flags)) << 24))); |
196 | + return 1; | |
178 | 197 | } |
179 | 198 | } |
180 | 199 | else if (lpstKBH->scanCode == 0x0070) { |
@@ -216,34 +235,34 @@ static LRESULT CALLBACK lpKeyboardHookLLProc(int nCode, WPARAM wParam, LPARAM lP | ||
216 | 235 | case VK_CAPITAL: // 英数/CapsLock (0x14) |
217 | 236 | bOnlyCtrlLL = FALSE; |
218 | 237 | bStartConvertingLL = FALSE; |
219 | - if (bKBisNotJP() || bKBisEP()) { | |
220 | - dwPreviousVKLL = VK_OEM_ATTN; | |
221 | - if (bKeyboardHookLLProcSub()) { | |
222 | - if (!bEnableEPHelperLL) break; | |
223 | - PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, KEY_OEM_ATTN, (0x7f000000 & (static_cast<LPARAM>(lpstKBH->flags) << 24))); | |
224 | - } | |
225 | - return 1; | |
238 | + dwPreviousVKLL = VK_OEM_ATTN; | |
239 | + if (bKeyboardHookLLProcSub()) { | |
240 | + if (!bEnableEPHelperLL) break; | |
241 | + PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, KEY_OEM_ATTN, (0x7f000000 & (static_cast<LPARAM>(lpstKBH->flags) << 24))); | |
226 | 242 | } |
243 | + return 1; | |
227 | 244 | break; |
228 | 245 | case VK_KANJI: // JP(IME/ENG) Alt + 漢字 (0x19) |
229 | 246 | bOnlyCtrlLL = FALSE; |
230 | 247 | bStartConvertingLL = FALSE; |
231 | 248 | dwPreviousVKLL = VK_KANJI; |
232 | - if (bKeyboardHookLLProcSub()) { | |
233 | - PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, KEY_KANJI, (0x7f000000 & (static_cast<LPARAM>(lpstKBH->flags) << 24))); | |
249 | + if (GetAsyncKeyState(VK_MENU) & 0x8000) { | |
250 | + if (bKeyboardHookLLProcSub()) { | |
251 | + PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, KEY_KANJI, (0x7f000000 & (static_cast<LPARAM>(lpstKBH->flags) << 24))); | |
252 | + } | |
253 | + return 1; | |
234 | 254 | } |
235 | 255 | break; |
236 | 256 | case VK_OEM_3: // JP(IME/ENG) [@] / US(ENG) IME ON (0xc0) = ['] ALT + 半角/全角 or 漢字 |
237 | 257 | case VK_OEM_8: // JP(IME/ENG) [`] / UK(ENG) IME ON (0xdf) = ['] ALT + 半角/全角 or 漢字 |
238 | 258 | bOnlyCtrlLL = FALSE; |
239 | 259 | bStartConvertingLL = FALSE; |
240 | - if (bKBisNotJP() || bKBisEP()) { | |
241 | - if (bKeyboardHookLLProcSub()) { | |
242 | - if (!bEnableEPHelperLL) break; | |
243 | - PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, (WM_USER + lpstKBH->vkCode), (0x7f000000 & (static_cast<LPARAM>(lpstKBH->flags) << 24))); | |
244 | - } | |
245 | - return 1; | |
260 | + if (bKeyboardHookLLProcSub()) { | |
261 | + PostMessage(hWndKBParentLL, WM_CHECKIMESTARTCONVEX, (WPARAM)bStartConvertingLL, (WM_USER + lpstKBH->vkCode)); | |
262 | + if (!bEnableEPHelperLL) break; | |
263 | + PostMessage(hWndKBParentLL, WM_SYSKEYDOWNUPEX, (WM_USER + lpstKBH->vkCode), (0x7f000000 & (static_cast<LPARAM>(lpstKBH->flags) << 24))); | |
246 | 264 | } |
265 | + return 1; | |
247 | 266 | break; |
248 | 267 | case VK_OEM_ATTN: // OEM 英数/CapsLock (0xf0) |
249 | 268 | case VK_OEM_FINISH: // OEM カタカナ (0xf1) |
@@ -256,6 +275,7 @@ static LRESULT CALLBACK lpKeyboardHookLLProc(int nCode, WPARAM wParam, LPARAM lP | ||
256 | 275 | break; |
257 | 276 | case VK_RETURN: // RETURN (0x0d) |
258 | 277 | case VK_ESCAPE: // ESC (0x1b) |
278 | + case VK_NONCONVERT: // 無変換 (0x1d) | |
259 | 279 | case VK_INSERT: // INSERT (0x2d) |
260 | 280 | bOnlyCtrlLL = FALSE; |
261 | 281 | bStartConvertingLL = FALSE; |
@@ -287,34 +307,6 @@ static LRESULT CALLBACK lpKeyboardHookLLProc(int nCode, WPARAM wParam, LPARAM lP | ||
287 | 307 | } |
288 | 308 | |
289 | 309 | // |
290 | -// bKBisNotJP() | |
291 | -// | |
292 | -static BOOL bKBisNotJP() | |
293 | -{ | |
294 | -#define KB_MASK 0xffff0000 | |
295 | -#define KB_JP 0x04110000 | |
296 | - | |
297 | - DWORD dProcessID = 0; | |
298 | - DWORD dThreadID = GetWindowThreadProcessId(GetForegroundWindow(), &dProcessID); | |
299 | - HKL hkl = GetKeyboardLayout(dThreadID); | |
300 | - if (((UINT64)hkl & KB_MASK) != KB_JP) { | |
301 | - return TRUE; | |
302 | - } | |
303 | - return FALSE; | |
304 | -} | |
305 | - | |
306 | -// | |
307 | -// bKBisEP() | |
308 | -// | |
309 | -static BOOL bKBisEP() | |
310 | -{ | |
311 | - if (GetKeyboardType(1) == 0) { | |
312 | - return TRUE; | |
313 | - } | |
314 | - return FALSE; | |
315 | -} | |
316 | - | |
317 | -// | |
318 | 310 | // bKeyboardHookLLProcSub |
319 | 311 | // |
320 | 312 | static BOOL bKeyboardHookLLProcSub() |
@@ -55,6 +55,8 @@ DLLEXPORT BOOL __stdcall bMouseHookSet32(HWND hWnd) | ||
55 | 55 | } |
56 | 56 | delete CSharedMem; |
57 | 57 | CSharedMem = NULL; |
58 | + hWndMSParent = NULL; | |
59 | + lpDatMouse = NULL; | |
58 | 60 | } |
59 | 61 | return FALSE; |
60 | 62 | } |
@@ -75,6 +77,8 @@ DLLEXPORT BOOL __stdcall bMouseHookUnset32() | ||
75 | 77 | } |
76 | 78 | delete CSharedMem; |
77 | 79 | CSharedMem = NULL; |
80 | + hWndMSParent = NULL; | |
81 | + lpDatMouse = NULL; | |
78 | 82 | } |
79 | 83 | return bRet; |
80 | 84 | } |
@@ -40,7 +40,7 @@ BOOL CRegistry::bGetSetRegValueDWORD(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szV | ||
40 | 40 | DWORD dwDisposition = 0; |
41 | 41 | DWORD dwLen = sizeof(DWORD); |
42 | 42 | DWORD dwData = dwInitialData; |
43 | - if ((lStatus = RegCreateKeyEx(hKey, lpszSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKeySub, &dwDisposition)) == ERROR_SUCCESS) { | |
43 | + if ((lStatus = RegCreateKeyEx(hKey, lpszSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, NULL, &hKeySub, &dwDisposition)) == ERROR_SUCCESS) { | |
44 | 44 | if (dwDisposition == KEY_QUERY_VALUE) { |
45 | 45 | if ((lStatus = RegSetValueEx(hKeySub, szValue, NULL, REG_DWORD, reinterpret_cast<BYTE*>(&dwData), dwLen)) == ERROR_SUCCESS) { |
46 | 46 | bRet = TRUE; |
@@ -72,8 +72,33 @@ BOOL CRegistry::bReadRegValueDWORD(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szVal | ||
72 | 72 | BOOL bRet = FALSE; |
73 | 73 | DWORD dwData = 0; |
74 | 74 | DWORD dwLen = sizeof(DWORD); |
75 | - if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_READ, &hkResult)) == ERROR_SUCCESS) { | |
76 | - if ((lStatus = RegGetValue(hKey, lpszSubKey, szValue, RRF_RT_REG_DWORD, NULL, &dwData, &dwLen)) == ERROR_SUCCESS) { | |
75 | + if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hkResult)) == ERROR_SUCCESS) { | |
76 | + if ((lStatus = RegGetValue(hKey, lpszSubKey, szValue, RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY, NULL, &dwData, &dwLen)) == ERROR_SUCCESS) { | |
77 | + bRet = TRUE; | |
78 | + } | |
79 | + else { | |
80 | + if (lStatus == ERROR_FILE_NOT_FOUND) { | |
81 | + bRet = FALSE; | |
82 | + } | |
83 | + } | |
84 | + RegCloseKey(hkResult); | |
85 | + } | |
86 | + *lpdwData = dwData; | |
87 | + return bRet; | |
88 | +} | |
89 | + | |
90 | +// | |
91 | +// bReadSystemRegValueDWORD() | |
92 | +// | |
93 | +BOOL CRegistry::bReadSystemRegValueDWORD(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValue, LPDWORD lpdwData) | |
94 | +{ | |
95 | + LSTATUS lStatus = 0; | |
96 | + HKEY hkResult = 0; | |
97 | + BOOL bRet = FALSE; | |
98 | + DWORD dwData = 0; | |
99 | + DWORD dwLen = sizeof(DWORD); | |
100 | + if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hkResult)) == ERROR_SUCCESS) { | |
101 | + if ((lStatus = RegGetValue(hKey, lpszSubKey, szValue, RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY, NULL, &dwData, &dwLen)) == ERROR_SUCCESS) { | |
77 | 102 | bRet = TRUE; |
78 | 103 | } |
79 | 104 | else { |
@@ -96,7 +121,7 @@ BOOL CRegistry::bSetRegValueDWORD(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValu | ||
96 | 121 | HKEY hKeySub = NULL; |
97 | 122 | BOOL bRet = FALSE; |
98 | 123 | DWORD dwDisposition = 0; |
99 | - if ((lStatus = RegCreateKeyEx(hKey, lpszSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKeySub, &dwDisposition)) == ERROR_SUCCESS) { | |
124 | + if ((lStatus = RegCreateKeyEx(hKey, lpszSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, NULL, &hKeySub, &dwDisposition)) == ERROR_SUCCESS) { | |
100 | 125 | DWORD dwLen = sizeof(DWORD); |
101 | 126 | if ((lStatus = RegSetValueEx(hKeySub, szValue, NULL, REG_DWORD, reinterpret_cast<BYTE*>(&dwData), dwLen)) == ERROR_SUCCESS) { |
102 | 127 | bRet = TRUE; |
@@ -149,7 +174,7 @@ BOOL CRegistry::bReadRegValueString(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szVa | ||
149 | 174 | LSTATUS lStatus = 0; |
150 | 175 | HKEY hKeySub = NULL; |
151 | 176 | BOOL bRet = FALSE; |
152 | - if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_READ, &hKeySub)) == ERROR_SUCCESS) { | |
177 | + if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKeySub)) == ERROR_SUCCESS) { | |
153 | 178 | DWORD dwLen = 0; |
154 | 179 | if ((lStatus = RegQueryValueEx(hKeySub, szValue, NULL, NULL, NULL, &dwLen)) == ERROR_SUCCESS) { |
155 | 180 | if ((dwLen <= (_MAX_PATH * sizeof(TCHAR)) && (dwLen <= dwDataSize))) { |
@@ -172,7 +197,7 @@ BOOL CRegistry::bGetSetRegValueString(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR sz | ||
172 | 197 | LSTATUS lStatus = 0; |
173 | 198 | HKEY hKeySub = NULL; |
174 | 199 | BOOL bRet = FALSE; |
175 | - if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_READ, &hKeySub)) == ERROR_SUCCESS) { | |
200 | + if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKeySub)) == ERROR_SUCCESS) { | |
176 | 201 | DWORD dwLen = 0; |
177 | 202 | if ((lStatus = RegQueryValueEx(hKeySub, szValue, NULL, NULL, NULL, &dwLen)) == ERROR_SUCCESS) { |
178 | 203 | if ((dwLen <= (_MAX_PATH * sizeof(TCHAR)) && (dwLen <= dwDataSize))) { |
@@ -196,7 +221,7 @@ BOOL CRegistry::bSetRegValueString(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szVal | ||
196 | 221 | HKEY hKeySub = NULL; |
197 | 222 | BOOL bRet = FALSE; |
198 | 223 | DWORD dwDisposition = 0; |
199 | - if ((lStatus = RegCreateKeyEx(hKey, lpszSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKeySub, &dwDisposition)) == ERROR_SUCCESS) { | |
224 | + if ((lStatus = RegCreateKeyEx(hKey, lpszSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, NULL, &hKeySub, &dwDisposition)) == ERROR_SUCCESS) { | |
200 | 225 | if (dwDataSize <= _MAX_PATH) { |
201 | 226 | if ((lStatus = RegSetValueEx(hKeySub, szValue, NULL, REG_SZ, (LPBYTE)&szData, dwDataSize)) == ERROR_SUCCESS) { |
202 | 227 | bRet = TRUE; |
@@ -215,7 +240,7 @@ BOOL CRegistry::bDeleteRegValue(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValue) | ||
215 | 240 | LSTATUS lStatus = 0; |
216 | 241 | HKEY hKeySub = NULL; |
217 | 242 | BOOL bRet = FALSE; |
218 | - if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_ALL_ACCESS, &hKeySub)) == ERROR_SUCCESS) { | |
243 | + if ((lStatus = RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hKeySub)) == ERROR_SUCCESS) { | |
219 | 244 | if ((lStatus = RegDeleteValue(hKeySub, szValue)) == ERROR_SUCCESS) { |
220 | 245 | bRet = TRUE; |
221 | 246 | } |
@@ -30,6 +30,7 @@ public: | ||
30 | 30 | BOOL bSetRegValueString(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValue, LPTSTR szData, DWORD dwDataSize); |
31 | 31 | |
32 | 32 | BOOL bReadRegValueDWORD(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValue, LPDWORD lpdwData); |
33 | + BOOL bReadSystemRegValueDWORD(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValue, LPDWORD lpdwData); | |
33 | 34 | BOOL bReadRegValueDWORDasBOOL(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValue, LPBOOL lpbData); |
34 | 35 | BOOL bReadRegValueString(HKEY hKey, LPCTSTR lpszSubKey, LPCTSTR szValue, LPTSTR szData, DWORD dwDataSize); |
35 | 36 |
@@ -33,7 +33,7 @@ CSharedMemory::CSharedMemory(LPCTSTR szSharedMemoryName, DWORD dwDataSize) | ||
33 | 33 | { |
34 | 34 | |
35 | 35 | size_t size = wcsnlen_s(szSharedMemoryName, MAX_LOADSTRING); |
36 | - lpszSharedMemoryName = new TCHAR[size + 1]; | |
36 | + if ((lpszSharedMemoryName = new TCHAR[size + 1]) == NULL) return; | |
37 | 37 | ZeroMemory(lpszSharedMemoryName, sizeof(TCHAR) * (size + 1)); |
38 | 38 | _tcsncpy_s(lpszSharedMemoryName, size + 1, szSharedMemoryName, _TRUNCATE); |
39 | 39 | dwDataByteSize = dwDataSize; |
@@ -65,7 +65,7 @@ CSharedMemory::~CSharedMemory() | ||
65 | 65 | hSharedMem = NULL; |
66 | 66 | } |
67 | 67 | } |
68 | - delete[] lpszSharedMemoryName; | |
68 | + if (lpszSharedMemoryName != NULL) delete[] lpszSharedMemoryName; | |
69 | 69 | lpszSharedMemoryName = NULL; |
70 | 70 | dwDataByteSize = 0; |
71 | 71 | return; |
@@ -12,14 +12,12 @@ | ||
12 | 12 | #include "CThread.h" |
13 | 13 | |
14 | 14 | // |
15 | -// CThred:: | |
15 | +// CThread:: | |
16 | 16 | // |
17 | 17 | CThread::CThread() |
18 | 18 | { |
19 | - lpstThreadData = new THREAD_DATA[sizeof(THREAD_DATA)]; | |
20 | - ZeroMemory(lpstThreadData, sizeof(THREAD_DATA)); | |
21 | - lpstThreadData->lpstSA = new SECURITY_ATTRIBUTES[sizeof(SECURITY_ATTRIBUTES)]; | |
22 | - ZeroMemory(lpstThreadData->lpstSA, sizeof(SECURITY_ATTRIBUTES)); | |
19 | + if ((lpstThreadData = new THREAD_DATA[sizeof(THREAD_DATA)]) != NULL) ZeroMemory(lpstThreadData, sizeof(THREAD_DATA)); | |
20 | + if ((lpstThreadData->lpstSA = new SECURITY_ATTRIBUTES[sizeof(SECURITY_ATTRIBUTES)]) != NULL) ZeroMemory(lpstThreadData->lpstSA, sizeof(SECURITY_ATTRIBUTES)); | |
23 | 21 | |
24 | 22 | lpstThreadData->lpstSA->nLength = sizeof(SECURITY_ATTRIBUTES); |
25 | 23 | lpstThreadData->lpstSA->lpSecurityDescriptor = NULL; |
@@ -39,7 +37,7 @@ CThread::~CThread() | ||
39 | 37 | // |
40 | 38 | BOOL CThread::bRegister(LPCTSTR lpszThreadName, DWORD dwThreadID, LPTHREAD_START_ROUTINE lpbCallbackRoutine, LPVOID lParamOption, DWORD dwSleepTime) |
41 | 39 | { |
42 | - if (lpstThreadData == NULL) return FALSE; | |
40 | + if ((lpstThreadData == NULL) || (lpstThreadData->lpstSA == NULL)) return FALSE; | |
43 | 41 | lpstThreadData->lpszThreadName = lpszThreadName; lpstThreadData->dwThreadID = dwThreadID; |
44 | 42 | lpstThreadData->lpbCallbackRoutine = lpbCallbackRoutine; lpstThreadData->lParamOption = lParamOption; |
45 | 43 | lpstThreadData->dwSleepTime = dwSleepTime; lpstThreadData->bThreadSentinel = TRUE; |
@@ -57,9 +55,7 @@ BOOL CThread::bRegister(LPCTSTR lpszThreadName, DWORD dwThreadID, LPTHREAD_STAR | ||
57 | 55 | // |
58 | 56 | BOOL CThread::bStart() |
59 | 57 | { |
60 | - if ((lpstThreadData == NULL) || (lpstThreadData->hThread == NULL)) { | |
61 | - return FALSE; | |
62 | - } | |
58 | + if ((lpstThreadData == NULL) || (lpstThreadData->lpstSA == NULL) || (lpstThreadData->hThread == NULL)) return FALSE; | |
63 | 59 | lpstThreadData->bThreadSentinel = TRUE; |
64 | 60 | DWORD dwExitCode = 0; |
65 | 61 | if (GetExitCodeThread((HANDLE)lpstThreadData->hThread, &dwExitCode)) { |
@@ -89,29 +85,27 @@ BOOL CThread::bStart() | ||
89 | 85 | VOID CThread::vUnregister() |
90 | 86 | { |
91 | 87 | #define TIMEOUT 1000 |
92 | - if ((lpstThreadData == NULL) || (lpstThreadData->hThread == NULL)) return; | |
88 | + if ((lpstThreadData == NULL) || (lpstThreadData->lpstSA == NULL) || (lpstThreadData->hEvent == NULL) || (lpstThreadData->hThread == NULL)) return; | |
93 | 89 | lpstThreadData->bThreadSentinel = FALSE; |
94 | 90 | DWORD dwExitCode = 0; |
95 | 91 | if (GetExitCodeThread((HANDLE)lpstThreadData->hThread, &dwExitCode)) { |
96 | 92 | if (dwExitCode == STILL_ACTIVE) { |
97 | 93 | if (ResumeThread(lpstThreadData->hThread) != -1) { |
98 | - if (lpstThreadData->hEvent != NULL) { | |
99 | - if (SetEvent(lpstThreadData->hEvent)) { | |
100 | - DWORD dwRet = WaitForSingleObject((HANDLE)lpstThreadData->hThread, TIMEOUT); | |
101 | - switch (dwRet) { | |
102 | - case WAIT_OBJECT_0: | |
103 | - break; | |
104 | - case WAIT_ABANDONED: | |
105 | - case WAIT_TIMEOUT: | |
106 | - case WAIT_FAILED: | |
107 | - default: | |
94 | + if (SetEvent(lpstThreadData->hEvent)) { | |
95 | + DWORD dwRet = WaitForSingleObject((HANDLE)lpstThreadData->hThread, TIMEOUT); | |
96 | + switch (dwRet) { | |
97 | + case WAIT_OBJECT_0: | |
98 | + break; | |
99 | + case WAIT_ABANDONED: | |
100 | + case WAIT_TIMEOUT: | |
101 | + case WAIT_FAILED: | |
102 | + default: | |
108 | 103 | #pragma warning(push) |
109 | 104 | #pragma warning(disable : 6258) |
110 | 105 | if (!TerminateThread(lpstThreadData->hThread, 2)) { |
111 | 106 | } |
112 | 107 | #pragma warning(pop) |
113 | 108 | break; |
114 | - } | |
115 | 109 | } |
116 | 110 | } |
117 | 111 | } |
@@ -129,7 +123,7 @@ unsigned __stdcall CThread::uThreadProc(void* pArguments) | ||
129 | 123 | { |
130 | 124 | LPTHREAD_DATA lpstThreadData = (LPTHREAD_DATA)pArguments; |
131 | 125 | do { |
132 | - if ((lpstThreadData != NULL) && (lpstThreadData->hEvent != NULL) && (lpstThreadData->hThread != NULL)) { | |
126 | + if ((lpstThreadData != NULL) && (lpstThreadData->lpstSA != NULL) && (lpstThreadData->hEvent != NULL) && (lpstThreadData->hThread != NULL)) { | |
133 | 127 | DWORD dwRet = WaitForSingleObject(lpstThreadData->hEvent, INFINITE); |
134 | 128 | switch (dwRet) { |
135 | 129 | case WAIT_OBJECT_0: |
@@ -2,22 +2,24 @@ | ||
2 | 2 | |
3 | 3 | [[RepositoryInfo]] |
4 | 4 | |
5 | -||[[Thumb(FlushMouse.png, size=48x48)]]||'''[[ProjectDescription]](タスクトレイに常駐して、マウスカーソルへIMEモードの表示をするユーティリティです)[[BR]]FlushMouse is a software developed by JeffyTS . It is a mouse gesture tool that allows you to perform various operations by drawing gestures with your mouse . (by Bing ChatGPT)'''|| | |
5 | +||[[Thumb(FlushMouse.png, size=48x48)]]||'''[[ProjectDescription]](タスクトレイに常駐して、マウスカーソルへIMEモードの表示をするユーティリティです)[[BR]]FlushMouse is a software developed by JeffyTS . It is a mouse gesture tool that allows you to perform various operations by drawing gestures with your mouse . (by Bing)'''|| | |
6 | 6 | |
7 | 7 | [[BR]] |
8 | -2023/05/25[[BR]] | |
9 | - Version 0.9.4.14 をリリースしました[[BR]] | |
8 | +2023/06/13[[BR]] | |
9 | + '''Version 1.0.0.1 をリリースしました'''[[BR]] | |
10 | 10 | [[BR]] |
11 | 11 | (主な変更点)[[BR]] |
12 | - * 処理のシェイプアップ及び軽微なバグ修正を行いました[[BR]] | |
12 | + * 処理のシェイプアップ及びバグ修正を行いました[[BR]] | |
13 | 13 | * IMEモードの表示の色指定でαチャネルが有効になるようにしてあります(設定画面は作成していません。レジストリを編集できる方は好みの色にしてみてください。ただし、レジストリの編集は十分注意して行ってください)[[BR]] |
14 | 14 | * HKEY_CURRENT_USER\Software\JeffyTS\FlushMouse の NearDrawCaretColor と NearDrawMouseColor です。上位バイトから、α B G R の順です[[BR]] |
15 | 15 | * αの値は、通常と違って、大きいほうが透明度が高くなります。これは従来と互換性を持たせるためですのでご了承ください。なお、レジストリを変更した方がいたら、お手数をおかけしますが修正をお願いします[[BR]] |
16 | 16 | * マウスカーソル右下のモード表示の色は、現状では変更できません。ご了承ください[[BR]] |
17 | 17 | [[BR]] |
18 | 18 | (今後について)[[BR]] |
19 | - * OSDN上ではここまでの機能で開発は終了としたいと考えています(バグ対応は除く)[[BR]] | |
20 | - * 今後は、プレゼンテーションモードの追加や、マウスカーソルの形状や、表示する内容などをカスタマイズする機能をつけて有償に移行しようと考えています[[BR]] | |
19 | + * ~~OSDN上ではここまでの機能で開発は終了としたいと考えています(バグ対応は除く)~~[[BR]] | |
20 | + * ~~今後は、プレゼンテーションモードの追加や、マウスカーソルの形状や、表示する内容などをカスタマイズする機能をつけて有償に移行しようと考えています~~[[BR]] | |
21 | + * と、上記のように考えていたのですが、この FlushMouse は Microsoft Storeに登録できないやり方を使って処理しているので無理なことが判明しました(フックを使用しいるとどうしてもだめなようです。ただ、SDKなどでだいぶ検証して直させてもらいました)[[BR]] | |
22 | + * '''ということで、今後も暇を見つけて、機能向上を目指していきますのでよろしくお願いします'''[[BR]] | |
21 | 23 | [[BR]] |
22 | 24 | ||'''対応OS'''|| |
23 | 25 | Windows 10 / 11 64bit (Latest Release Versionで検証しています)[[BR]] |
@@ -32,14 +32,18 @@ | ||
32 | 32 | Description="$(var.Description)" |
33 | 33 | Comments="$(var.Comments)" |
34 | 34 | Manufacturer="$(var.Manufacturer)" /> |
35 | + | |
35 | 36 | <!-- @@@ for Major Upgrade --> |
37 | + <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="[ProductName] の新しいバージョンがすでにインストールされています。" /> | |
38 | + <!-- @@@ for Upgrade --> | |
39 | + <Property Id='PREVIOUSVERSIONSINSTALLED' Secure='yes' /> | |
36 | 40 | <Upgrade Id="{8B8C6810-E467-498D-926C-F4139B2AE8AB}"> |
37 | - <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND' | |
38 | - Minimum='$(var.Version)' IncludeMinimum='no' /> | |
39 | - <UpgradeVersion OnlyDetect='no' Property='PREVIOUSFOUND' | |
40 | - Minimum='0.3.0' IncludeMinimum='yes' | |
41 | - Maximum='$(var.Version)' IncludeMaximum='no' /> | |
41 | + <!--UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND' Minimum='$(var.Version)' IncludeMinimum='no' /--> | |
42 | + <UpgradeVersion OnlyDetect='no' Property='PREVIOUSFOUND' Minimum='0.0.0.0' IncludeMinimum='yes' Maximum='$(var.Version)' IncludeMaximum='no' /> | |
43 | + <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND' Minimum='0.0.0.0' IncludeMinimum='yes' Maximum='$(var.Version)' IncludeMaximum='yes' /> | |
44 | + <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND' Minimum='$(var.Version)' IncludeMinimum='no' /> | |
42 | 45 | </Upgrade> |
46 | + | |
43 | 47 | <!-- Media Template--> |
44 | 48 | <MediaTemplate EmbedCab="yes" /> |
45 | 49 |
@@ -72,89 +76,129 @@ | ||
72 | 76 | <!-- Condition --> |
73 | 77 | <Condition Message="Windows 10 Anniversary update 以降が必要です"> WindowsBuild < 14390 </Condition> |
74 | 78 | <Condition Message="64bitのWindows 10 Anniversary update 以降が必要です"> NOT (%PROCESSOR_ARCHITECTURE="x86") </Condition> |
75 | - <!-- Verify Dialog for Short cut & Start menu --> | |
79 | + <!-- Verify Dialog for Short cut , Start menu & application Launch menu --> | |
76 | 80 | <Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT1" Value=" デスクトップにショートカットを作成する" /> |
77 | 81 | <Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX1" Value="1" /> |
78 | 82 | <Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT2" Value=" スタートメニューに登録する" /> |
83 | + <!--Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX2" Value="1" /--> | |
84 | + <Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3" Value=" セットアップを終了したら、すぐに $(var.ProductName) を実行する" /> | |
85 | + <Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3" Value="1" /> | |
86 | + <!-- Exit Dialog for application Launch --> | |
79 | 87 | <!-- Comment out for default Check box off Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX2" Value="2" /--> |
80 | 88 | <!--Property Id="WIXUI_VERIFYDIALOGOPTIONALCOMMENT1" Value=" セットアップが完了したら再起動してください" /--> |
81 | 89 | <!-- Verify Dialog for Uninstall Registry --> |
82 | - <Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3" Value=" $(var.ProductName) の設定情報を削除する" /> | |
90 | + <Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT4" Value=" $(var.ProductName) の設定情報を削除する" /> | |
91 | + <!--Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX4" Value="1" /--> | |
83 | 92 | <!-- Comment out for default Check box off Property Id="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3" Value="1" /--> |
84 | 93 | <!-- Exit Dialog for application Launch --> |
85 | - <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value=" セットアップを終了したら、すぐに $(var.ProductName) を実行する (ただし、全機能を使用するためにはWindowsの再起動が必要です)" /> | |
86 | - <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /> | |
94 | + <!--Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value=" セットアップを終了したら、すぐに $(var.ProductName) を実行する (ただし、全機能を使用するためにはWindowsの再起動が必要です)" /> | |
95 | + <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /--> | |
87 | 96 | |
88 | 97 | <UI> |
89 | 98 | <!-- WixUtilExtension が必要 --> |
90 | 99 | <!-- Majour Upgrade Dialog--> |
91 | 100 | <Dialog Id="NewerFoundDlg" Width="270" Height="105" Title="[ProductName] セットアップ" NoMinimize="yes"> |
92 | - <Control Id="MessageText" Type="Text" | |
93 | - X="48" Y="15" Width="205" Height="60" TabSkip="no" | |
94 | - Text="[ProductName] の新しいバージョンがすでにインストールされています。" /> | |
95 | - <Control Id="Y" Type="PushButton" | |
96 | - X="200" Y="80" Width="56" Height="17" TabSkip="yes" | |
97 | - Text="!(loc.WixUIOK)"> | |
101 | + <Control Id="MessageText" Type="Text" X="48" Y="15" Width="205" Height="60" TabSkip="no" Text="[ProductName] の新しいバージョンがすでにインストールされています。" /> | |
102 | + <Control Id="Y" Type="PushButton" X="200" Y="80" Width="56" Height="17" TabSkip="yes" Text="!(loc.WixUIOK)"> | |
103 | + <Publish Event="EndDialog" Value="Return">1</Publish> | |
104 | + </Control> | |
105 | + <Control Id="NewerFoundDlgIcon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="!(loc.ErrorDlgErrorIconTooltip)" FixedSize="yes" IconSize="32" Text="!(loc.ErrorDlgErrorIcon)" /> | |
106 | + </Dialog> | |
107 | + <Dialog Id="SelfFoundDlg" Width="270" Height="105" Title="[ProductName] セットアップ" NoMinimize="yes"> | |
108 | + <Control Id="MessageText" Type="Text" X="48" Y="15" Width="205" Height="60" TabSkip="no" Text="[ProductName] の同じバージョンがすでにインストールされています。" /> | |
109 | + <Control Id="Y" Type="PushButton" X="200" Y="80" Width="56" Height="17" TabSkip="yes" Text="!(loc.WixUIOK)"> | |
98 | 110 | <Publish Event="EndDialog" Value="Return">1</Publish> |
99 | 111 | </Control> |
100 | - <Control Id="NewerFoundDlgIcon" | |
101 | - Type="Icon" X="15" Y="15" Width="24" Height="24" | |
102 | - ToolTip="!(loc.ErrorDlgErrorIconTooltip)" FixedSize="yes" IconSize="32" | |
103 | - Text="!(loc.ErrorDlgErrorIcon)" /> | |
112 | + <Control Id="SeelfFoundDlgIcon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="!(loc.ErrorDlgErrorIconTooltip)" FixedSize="yes" IconSize="32" Text="!(loc.ErrorDlgErrorIcon)" /> | |
104 | 113 | </Dialog> |
114 | + <!-- _VerifyReady Dialog for Launch application --> | |
115 | + <!--Publish Dialog="_ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3 = 1 and NOT Installed</Publish--> | |
105 | 116 | <!-- _VerifyReady Dialog for remove registry, but publish on _ExitDlg--> |
106 | - <Publish Dialog="_ExitDialog" Control="Finish" Event="DoAction" Value="RemoveReg">WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3 = 1 and Installed</Publish> | |
117 | + <Publish Dialog="_ExitDialog" Control="Finish" Event="DoAction" Value="RemoveReg">WIXUI_VERIFYDIALOGOPTIONALCHECKBOX4 = 1 and Installed</Publish> | |
107 | 118 | <!-- _Exit Dialog for Launch application --> |
108 | - <Publish Dialog="_ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish> | |
119 | + <!--Publish Dialog="_ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish--> | |
109 | 120 | </UI> |
110 | 121 | <!-- Newer Version Found --> |
111 | 122 | <InstallUISequence> |
112 | 123 | <Show Dialog='NewerFoundDlg' After='FindRelatedProducts'>NEWERFOUND</Show> |
113 | - <Custom Action='WixExitEarlyWithSuccess' After='NewerFoundDlg'>NEWERFOUND</Custom> | |
124 | + <Show Dialog='SelfFoundDlg' After='FindRelatedProducts'>SELFFOUND</Show> | |
114 | 125 | </InstallUISequence> |
115 | 126 | <InstallExecuteSequence> |
116 | - <Custom Action='WixExitEarlyWithSuccess' After='FindRelatedProducts'>NEWERFOUND</Custom> | |
117 | - <RemoveExistingProducts After="InstallFinalize" /> | |
118 | - </InstallExecuteSequence> | |
119 | - <!--CustomAction Id='AlreadyUpdated' Error='[ProductName] は既に、このバージョンに更新されています。' /--> | |
120 | - <!--CustomAction Id='NoDowngrade' Error='[ProductName] の新しいバージョンが既にインストールされています。' /--> | |
121 | - <InstallExecuteSequence> | |
122 | - <Custom Action="TaskKill" Before="FindRelatedProducts">Installed</Custom> | |
127 | + <Custom Action="QuitApplication" Before="FindRelatedProducts"></Custom> | |
128 | + <!--Custom Action='WixExitEarlyWithSuccess' After='NewerFoundDlg'>NEWERFOUND</Custom--> | |
129 | + <!--Custom Action='WixExitEarlyWithSuccess' After='SelfFoundDlg'>SELFFOUND</Custom--> | |
130 | + <!--Custom Action='WixExitEarlyWithSuccess' After='FindRelatedProducts'>NEWERFOUND</Custom--> | |
131 | + <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom> | |
132 | + <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom> | |
133 | + <!--RemoveExistingProducts After="InstallFinalize" /--> | |
134 | + <!--Custom Action="TaskKill" After="FindRelatedProducts">Installed</Custom--> | |
135 | + <Custom Action="QuitApplication2" After="InstallInitialize">Installed</Custom> | |
136 | + <!--Custom Action='QuitApplication4' After='InstallInitialize'>Installed</Custom--> | |
123 | 137 | <Custom Action='UnregisterTaskScheduler' After='InstallInitialize'>Installed</Custom> |
124 | - <Custom Action='UnregisterEventlog' After='InstallInitialize'>Installed</Custom> | |
125 | - <Custom Action='TaskKill_force' After='InstallInitialize'>Installed</Custom> | |
126 | - <Custom Action='RegisterTaskScheduler' Before='InstallFinalize'>NOT Installed</Custom> | |
127 | - <Custom Action='RegisterEventlog' Before='InstallFinalize'>NOT Installed</Custom> | |
128 | - <Custom Action='RemoveReg' After='RemoveExistingProducts'>WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3 = 1 and Installed</Custom> | |
138 | + <Custom Action='UnregisterTaskScheduler2' After='InstallInitialize'>Installed</Custom> | |
139 | + <!--Custom Action='UnregisterEventlog' After='InstallInitialize'>Installed</Custom--> | |
140 | + <!--Custom Action="QuitApplication" After="InstallInitialize">Installed</Custom--> | |
141 | + <!--Custom Action="TaskKill" After="InstallInitialize">Installed</Custom--> | |
142 | + <!--Custom Action='TaskKill_force' After='InstallInitialize'>Installed</Custom--> | |
143 | + | |
144 | + <Custom Action='RegisterTaskScheduler' Before='InstallFinalize'>(NOT Installed) or REINSTALL</Custom> | |
145 | + <Custom Action='RegisterTaskScheduler2' Before='InstallFinalize'>(NOT Installed) or REINSTALL</Custom> | |
146 | + <Custom Action='LaunchApplication' After='InstallFinalize'>(WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3 = 1 and NOT Installed) or (WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3 = 1 and REINSTALL)</Custom> | |
147 | + <!--Custom Action='LaunchApplication' Before='InstallFinalize'>NOT Installed</Custom--> | |
148 | + <!--Custom Action='RegisterEventlog' Before='InstallFinalize'>NOT Installed</Custom--> | |
149 | + | |
150 | + <!--Custom Action="QuitApplication3" Before="RemoveExistingProducts">Installed</Custom--> | |
151 | + <Custom Action='RemoveReg' After='RemoveExistingProducts'>WIXUI_VERIFYDIALOGOPTIONALCHECKBOX4 = 1 and Installed</Custom> | |
129 | 152 | </InstallExecuteSequence> |
130 | 153 | |
154 | + <!-- Version Check --> | |
155 | + <CustomAction Id='AlreadyUpdated' Error='[ProductName] は既に、このバージョンに更新されています。' /> | |
156 | + <CustomAction Id='NoDowngrade' Error='[ProductName] の新しいバージョンが既にインストールされています。' /> | |
131 | 157 | <!-- Kill Own Application --> |
132 | 158 | <Binary Id="TASKKILL" SourceFile="C:\Windows\System32\taskkill.exe"> </Binary> |
133 | - <CustomAction Id="TaskKill" BinaryKey="TASKKILL" Execute="immediate" Return="ignore" Impersonate="yes" | |
159 | + <CustomAction Id="TaskKill" BinaryKey="TASKKILL" Execute="deferred" Return="ignore" Impersonate="no" | |
134 | 160 | ExeCommand=" /IM "$(var.MainExeFileName)"" /> |
135 | 161 | <CustomAction Id="TaskKill_force" BinaryKey="TASKKILL" Execute="deferred" Return="asyncWait" Impersonate="no" |
136 | 162 | ExeCommand=" /F /IM "$(var.MainExeFileName)" /IM "$(var.ProductName)32.exe"" /> |
137 | - <!-- Application Launch on Exit Dialog --> | |
138 | - <CustomAction Id="LaunchApplication" Directory="INSTALLFOLDER" | |
139 | - ExeCommand="[INSTALLFOLDER]$(var.MainExeFileName)" Return="asyncNoWait" /> | |
163 | + <!-- Quit Own Application --> | |
164 | + <Binary Id="EVENTCREATE" SourceFile="C:\Windows\System32\eventcreate.exe"> </Binary> | |
165 | + <CustomAction Id="QuitApplication" BinaryKey="EVENTCREATE" Execute="firstSequence" Return="ignore" Impersonate="yes" | |
166 | + ExeCommand=" /T SUCCESS /ID 7 /L Application /SO FlushMouse /D "Quit FlushMouse(Installer)."" /> | |
167 | + <CustomAction Id="QuitApplication2" BinaryKey="EVENTCREATE" Execute="firstSequence" Return="ignore" Impersonate="yes" | |
168 | + ExeCommand=" /T SUCCESS /ID 7 /L Application /SO FlushMouse /D "Quit FlushMouse(Installer)."" /> | |
169 | + <CustomAction Id="QuitApplication3" BinaryKey="EVENTCREATE" Execute="firstSequence" Return="ignore" Impersonate="yes" | |
170 | + ExeCommand=" /T SUCCESS /ID 7 /L Application /SO FlushMouse /D "Quit FlushMouse(Installer)."" /> | |
171 | + <!--Binary Id="QUITApplication" SourceFile="C:\Program Files\JeffyTS\FlushMouse\FlushMouse.exe"> </Binary> | |
172 | + <CustomAction Id="QuitApplication4" BinaryKey="QUITApplication" Execute="deferred" Return="ignore" Impersonate="no" | |
173 | + ExeCommand=" /quit" /--> | |
174 | + <!-- Application Launch --> | |
175 | + <!--CustomAction Id="LaunchApplication" Directory="INSTALLFOLDER" | |
176 | + ExeCommand="[INSTALLFOLDER]$(var.MainExeFileName)" Return="asyncNoWait" /--> | |
177 | + <CustomAction Id="LaunchApplication" BinaryKey="EVENTCREATE" Execute="immediate" Return="ignore" Impersonate="yes" | |
178 | + ExeCommand=" /T SUCCESS /ID 6 /L Application /SO FlushMouse /D "Start FlushMouse(Installer)."" /> | |
179 | + | |
140 | 180 | <!-- Register TaskScheduler --> |
141 | 181 | <Binary Id="REGISTERTaskScheduler" SourceFile="C:\Windows\System32\schtasks.exe"> </Binary> |
142 | 182 | <CustomAction Id="RegisterTaskScheduler" BinaryKey="REGISTERTaskScheduler" Execute="deferred" Return="asyncWait" Impersonate="no" |
143 | 183 | ExeCommand=" /Create /F /TN "$(var.ProductName)" /XML "[INSTALLFOLDER]Register_TaskScheduler.xml"" /> |
184 | + <CustomAction Id="RegisterTaskScheduler2" BinaryKey="REGISTERTaskScheduler" Execute="deferred" Return="asyncWait" Impersonate="no" | |
185 | + ExeCommand=" /Create /F /TN "$(var.ProductName)Installer" /XML "[INSTALLFOLDER]Register_TaskScheduler2.xml"" /> | |
144 | 186 | <!-- Unregister TaskScheduler --> |
145 | 187 | <Binary Id="UNREGISTERTaskScheduler" SourceFile="C:\Windows\System32\schtasks.exe"> </Binary> |
146 | 188 | <CustomAction Id="UnregisterTaskScheduler" BinaryKey="UNREGISTERTaskScheduler" Execute="deferred" Return="asyncWait" Impersonate="no" |
147 | 189 | ExeCommand=" /Delete /F /TN "$(var.ProductName)"" /> |
190 | + <CustomAction Id="UnregisterTaskScheduler2" BinaryKey="UNREGISTERTaskScheduler" Execute="deferred" Return="asyncWait" Impersonate="no" | |
191 | + ExeCommand=" /Delete /F /TN "$(var.ProductName)Installer"" /> | |
148 | 192 | <!-- Register EventLog --> |
149 | - <Binary Id="REGISTEREventlog" SourceFile="C:\Windows\System32\reg.exe"> </Binary> | |
193 | + <!--Binary Id="REGISTEREventlog" SourceFile="C:\Windows\System32\reg.exe"> </Binary> | |
150 | 194 | <CustomAction Id="RegisterEventlog" BinaryKey="REGISTEREventlog" Execute="deferred" Return="asyncWait" Impersonate="no" |
151 | - ExeCommand=" IMPORT "[INSTALLFOLDER]Register_Eventlog.reg" /reg:64" /> | |
195 | + ExeCommand=" IMPORT "[INSTALLFOLDER]Register_Eventlog.reg" /reg:64" /--> | |
152 | 196 | <!-- Unegister EventLog --> |
153 | - <Binary Id="UNREGISTEREventlog" SourceFile="C:\Windows\System32\reg.exe"> </Binary> | |
197 | + <!--Binary Id="UNREGISTEREventlog" SourceFile="C:\Windows\System32\reg.exe"> </Binary--> | |
154 | 198 | <!--CustomAction Id="UnregisterEventlog" BinaryKey="UNREGISTEREventlog" Execute="deferred" Return="asyncWait" Impersonate="no" |
155 | 199 | ExeCommand=" DELETE HKLM\System\CurrentControlSet\Services\Eventlog\Application\"$(var.ProductName)" /f /va" /--> |
156 | - <CustomAction Id="UnregisterEventlog" BinaryKey="UNREGISTEREventlog" Execute="deferred" Return="asyncWait" Impersonate="no" | |
157 | - ExeCommand=" DELETE HKLM\System\CurrentControlSet\Services\Eventlog\Application\FlushMouse /f" /> | |
200 | + <!--CustomAction Id="UnregisterEventlog" BinaryKey="UNREGISTEREventlog" Execute="deferred" Return="asyncWait" Impersonate="no" | |
201 | + ExeCommand=" DELETE HKLM\System\CurrentControlSet\Services\Eventlog\Application\FlushMouse /f" /--> | |
158 | 202 | <!-- Remove Registry in Uninstall --> |
159 | 203 | <Binary Id="REMOVEREG" SourceFile="C:\Windows\System32\reg.exe"> </Binary> |
160 | 204 | <CustomAction Id="RemoveReg" BinaryKey="REMOVEREG" Execute="immediate" Return="asyncNoWait" Impersonate="yes" |
@@ -194,6 +238,7 @@ | ||
194 | 238 | <Feature Id="EssentialFeature" Level="1"> |
195 | 239 | <ComponentGroupRef Id="ProductComponents" /> |
196 | 240 | <!--ComponentRef Id="AutoStartRegistry" /--> |
241 | + <ComponentRef Id="EventLogRegistry" /> | |
197 | 242 | <ComponentRef Id="Registries" /> |
198 | 243 | <ComponentRef Id="Shortcuts" /> |
199 | 244 | <ComponentRef Id="DesktopShortcut" /> |
@@ -222,6 +267,9 @@ | ||
222 | 267 | <Component Id="Register_TaskScheduler.xml" Guid="{3FA0C6AB-6E9C-4B55-BE44-A02A3B6A0C3E}"> |
223 | 268 | <File Id="Register_TaskScheduler.xml" Name="Register_TaskScheduler.xml" Source="$(var.TargetDir04)Register_TaskScheduler.xml" /> |
224 | 269 | </Component> |
270 | + <Component Id="Register_TaskScheduler2.xml" Guid="{17BD4844-87C4-4A06-BBF3-86C94D22C5DC}"> | |
271 | + <File Id="Register_TaskScheduler2.xml" Name="Register_TaskScheduler2.xml" Source="$(var.TargetDir04)Register_TaskScheduler2.xml" /> | |
272 | + </Component> | |
225 | 273 | <Component Id="License.rtf" Guid="{E6E55A92-6BE8-4612-8172-0BC04811D6E1}"> |
226 | 274 | <File Id="License.rtf" Name="License.rtf" Source="$(var.TargetDir04)License.rtf" /> |
227 | 275 | </Component> |
@@ -240,10 +288,18 @@ | ||
240 | 288 | <!-- Registries --> |
241 | 289 | <!-- Auto start by user registry --> |
242 | 290 | <!--Component Id="AutoStartRegistry" Guid="{AE2203C7-DFFF-40AA-873F-39C206583E9C}"--> |
243 | - <!--RegistryKey Root="HKCU" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="no"--> | |
244 | - <!--RegistryValue Type="string" Name="$(var.ProductName)" Value="[INSTALLFOLDER]$(var.MainExeFileName)" KeyPath="yes" /--> | |
245 | - <!--/RegistryKey--> | |
291 | + <!--RegistryKey Root="HKCU" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="no"--> | |
292 | + <!--RegistryValue Type="string" Name="$(var.ProductName)" Value="[INSTALLFOLDER]$(var.MainExeFileName)" KeyPath="yes" /--> | |
293 | + <!--/RegistryKey--> | |
246 | 294 | <!--/Component--> |
295 | + <!-- EventLog registry --> | |
296 | + <Component Id="EventLogRegistry" Guid="{B5A28410-C07F-43BD-BA17-D15F0331986B}"> | |
297 | + <RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\EventLog\Application\$(var.ProductName)" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> | |
298 | + <RegistryValue Type="integer" Name="CustomSource" Value="00000001"/> | |
299 | + <RegistryValue Type="integer" Name="TypesSupported" Value="00000007"/> | |
300 | + <RegistryValue Type="expandable" Name="EventMessageFile" Value="%ProgramFiles%\$(var.Manufacturer)\$(var.ProductName)\FlushMouseDLL.dll"/> | |
301 | + </RegistryKey> | |
302 | + </Component> | |
247 | 303 | <!-- App registries --> |
248 | 304 | <Component Id="Registries" Guid="{05B14589-18DE-4AE3-B6D8-EB65FA40B46D}"> |
249 | 305 | <RegistryKey Root="HKLM" Key="$(var.AppRegKey)" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="no"> |
@@ -9,6 +9,7 @@ | ||
9 | 9 | FlushMouseDLL32.dll |
10 | 10 | Register_Eventlog.reg |
11 | 11 | Register_TaskScheduler.xml |
12 | + Register_TaskScheduler2.xml | |
12 | 13 | License.rtf |
13 | 14 | Readme.txt |
14 | 15 |
@@ -20,6 +20,8 @@ | ||
20 | 20 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> |
21 | 21 | <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath> |
22 | 22 | <CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions> |
23 | + <SuppressValidation>False</SuppressValidation> | |
24 | + <SuppressIces>ICE61</SuppressIces> | |
23 | 25 | </PropertyGroup> |
24 | 26 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> |
25 | 27 | <DefineConstants>Debug</DefineConstants> |
@@ -45,6 +47,7 @@ | ||
45 | 47 | <Content Include="Readme.txt" /> |
46 | 48 | <Content Include="Register_Eventlog.reg" /> |
47 | 49 | <Content Include="Register_TaskScheduler.xml" /> |
50 | + <Content Include="Register_TaskScheduler2.xml" /> | |
48 | 51 | </ItemGroup> |
49 | 52 | <ItemGroup> |
50 | 53 | <ProjectReference Include="..\FlushMouse32\FlushMouse32.vcxproj"> |
@@ -90,6 +93,9 @@ | ||
90 | 93 | <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> |
91 | 94 | <Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" /> |
92 | 95 | </Target> |
96 | + <PropertyGroup> | |
97 | + <PostBuildEvent>copy "$(TargetDir)ja-JP\$(TargetFileName)" "$(SolutionDir)$(TargetFileName)"</PostBuildEvent> | |
98 | + </PropertyGroup> | |
93 | 99 | <!-- |
94 | 100 | To modify your build process, add your task inside one of the targets below and uncomment it. |
95 | 101 | Other similar extension points exist, see Wix.targets. |
@@ -5,27 +5,27 @@ | ||
5 | 5 | <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> |
6 | 6 | <Fragment> |
7 | 7 | <UI> |
8 | - <Dialog Id="_ExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)"> | |
9 | - <Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" /> | |
10 | - <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" /> | |
11 | - <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.ExitDialogBitmap)" /> | |
12 | - <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" /> | |
13 | - <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> | |
14 | - <Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="40" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" /> | |
15 | - <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" /> | |
16 | - <Control Id="OptionalText" Type="Text" X="135" Y="110" Width="220" Height="80" Transparent="yes" NoPrefix="yes" Hidden="yes" Text="[WIXUI_EXITDIALOGOPTIONALTEXT]"> | |
8 | + <Dialog Id="_ExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)"> | |
9 | + <Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" /> | |
10 | + <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" /> | |
11 | + <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.ExitDialogBitmap)" /> | |
12 | + <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" /> | |
13 | + <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> | |
14 | + <Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="40" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" /> | |
15 | + <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" /> | |
16 | + <!--Control Id="OptionalText" Type="Text" X="135" Y="110" Width="220" Height="80" Transparent="yes" NoPrefix="yes" Hidden="yes" Text="[WIXUI_EXITDIALOGOPTIONALTEXT]"> | |
17 | 17 | <Condition Action="show">WIXUI_EXITDIALOGOPTIONALTEXT AND NOT Installed</Condition> |
18 | - </Control> | |
18 | + </Control--> | |
19 | 19 | <!--Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]"--> |
20 | 20 | <!--Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="100" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]"> |
21 | 21 | <Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed</Condition> |
22 | 22 | </Control--> |
23 | - <Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="100" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]"> | |
23 | + <!--Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="100" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]"> | |
24 | 24 | <Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed</Condition> |
25 | - </Control> | |
25 | + </Control--> | |
26 | 26 | </Dialog> |
27 | 27 | |
28 | - <InstallUISequence> | |
28 | + <InstallUISequence> | |
29 | 29 | <Show Dialog="_ExitDialog" OnExit="success" Overridable="yes" /> |
30 | 30 | </InstallUISequence> |
31 | 31 |
@@ -7,19 +7,22 @@ | ||
7 | 7 | <UI> |
8 | 8 | <Dialog Id="_VerifyReadyDlg" Width="370" Height="270" Title="!(loc.VerifyReadyDlg_Title)" TrackDiskSpace="yes"> |
9 | 9 | <!--@@@ start--> |
10 | - <!-- Install --> | |
11 | - <Control Id="OptionalCheckBox1" Type="CheckBox" X="80" Y="150" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX1" CheckBoxValue="1" Text="[WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT1]"> | |
12 | - <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3 AND NOT Installed</Condition> | |
10 | + <!-- Install --> | |
11 | + <Control Id="OptionalCheckBox1" Type="CheckBox" X="80" Y="145" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX1" CheckBoxValue="1" Text="[WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT1]"> | |
12 | + <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT1 AND NOT Installed</Condition> | |
13 | + </Control> | |
14 | + <Control Id="OptionalCheckBox2" Type="CheckBox" X="80" Y="160" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX2" CheckBoxValue="1" Text="[WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT2]"> | |
15 | + <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT2 AND NOT Installed</Condition> | |
13 | 16 | </Control> |
14 | - <Control Id="OptionalCheckBox2" Type="CheckBox" X="80" Y="170" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX2" CheckBoxValue="1" Text="[WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT2]"> | |
17 | + <Control Id="OptionalCheckBox3" Type="CheckBox" X="80" Y="175" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3" CheckBoxValue="1" Text="[WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3]"> | |
15 | 18 | <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3 AND NOT Installed</Condition> |
16 | 19 | </Control> |
17 | 20 | <Control Id="Comment1" Type="Text" X="80" Y="190" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCOMMENT1" Text="[WIXUI_VERIFYDIALOGOPTIONALCOMMENT1]"> |
18 | - <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3 AND NOT Installed</Condition> | |
21 | + <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCOMMENT1 AND NOT Installed</Condition> | |
19 | 22 | </Control> |
20 | 23 | <!-- Uninstall --> |
21 | - <Control Id="OptionalCheckBox3" Type="CheckBox" X="80" Y="170" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX3" CheckBoxValue="1" Text="[WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3]"> | |
22 | - <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT3 AND Installed</Condition> | |
24 | + <Control Id="OptionalCheckBox4" Type="CheckBox" X="80" Y="175" Width="220" Height="20" Hidden="yes" Property="WIXUI_VERIFYDIALOGOPTIONALCHECKBOX4" CheckBoxValue="1" Text="[WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT4]"> | |
25 | + <Condition Action="show">WIXUI_VERIFYDIALOGOPTIONALCHECKBOXTEXT4 AND Installed</Condition> | |
23 | 26 | </Control> |
24 | 27 | <!--@@@ end--> |
25 | 28 | <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Hidden="yes" Disabled="yes" Text="!(loc.VerifyReadyDlgInstall)"> |
@@ -6,13 +6,13 @@ | ||
6 | 6 | // #0000 2023/03/17 JeffyTS New edit. |
7 | 7 | // |
8 | 8 | |
9 | -#define MAJOR_VERSION 0 | |
10 | -#define MINOR_VERSION 9 | |
11 | -#define BUILD_VERSION 4 | |
12 | -#define REVISON_VERSION 14 | |
9 | +#define MAJOR_VERSION 1 | |
10 | +#define MINOR_VERSION 0 | |
11 | +#define BUILD_VERSION 0 | |
12 | +#define REVISON_VERSION 1 | |
13 | 13 | |
14 | -#define FILE_VERSION_STRING VALUE "FileVersion", "0.9.4.14" | |
15 | -#define PRODUCT_VERSION_STRING VALUE "ProductVersion", "0.9.4.14" | |
14 | +#define FILE_VERSION_STRING VALUE "FileVersion", "1.0.0.1" | |
15 | +#define PRODUCT_VERSION_STRING VALUE "ProductVersion", "1.0.0.1" | |
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 = "0.9.4.14" ?> | |
3 | + <?define Version = "1.0.0.1" ?> | |
4 | 4 | </Include> |
5 | 5 |