Windows: build with UNICODE, get rid of all TCHAR/TEXT(), use explicit

xxA() interfaces and wchar_t in some places. Add a static cleanup retry
method to TempFile, called after clearing the MimeHandler cache (killing
the subprocesses which might hold an open file).
This commit is contained in:
Jean-Francois Dockes
2019-07-21 16:23:16 +02:00
parent af664e7768
commit 049ba1e7e4
11 changed files with 280 additions and 247 deletions
+6 -6
View File
@@ -205,16 +205,16 @@ LRESULT CALLBACK MainWndProc(HWND hwnd , UINT msg , WPARAM wParam,
bool CreateInvisibleWindow()
{
HWND hwnd;
WNDCLASS wc = {0};
WNDCLASS wc = {0,0,0,0,0,0,0,0,0,0};
wc.lpfnWndProc = (WNDPROC)MainWndProc;
wc.hInstance = GetModuleHandle(NULL);
wc.hIcon = LoadIcon(GetModuleHandle(NULL), "TestWClass");
wc.lpszClassName = "TestWClass";
wc.hIcon = LoadIcon(GetModuleHandle(NULL), L"TestWClass");
wc.lpszClassName = L"TestWClass";
RegisterClass(&wc);
hwnd =
CreateWindowEx(0, "TestWClass", "TestWClass", WS_OVERLAPPEDWINDOW,
CreateWindowEx(0, L"TestWClass", L"TestWClass", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, (HWND) NULL, (HMENU) NULL,
GetModuleHandle(NULL), (LPVOID) NULL);
@@ -248,8 +248,8 @@ void initAsyncSigs(void (*sigcleanup)(int))
}
}
}
HANDLE hInvisiblethread =
CreateThread(NULL, 0, RunInvisibleWindowThread, NULL, 0, &tid);
CreateThread(NULL, 0, RunInvisibleWindowThread, NULL, 0, &tid);
SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE);
eWorkFinished = CreateEvent(NULL, TRUE, FALSE, NULL);
if (eWorkFinished == INVALID_HANDLE_VALUE) {