From 0ee77e7d2fafe8cf93c24b15bec8acec270e3e29 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 17 Aug 2018 19:58:32 +0200 Subject: [PATCH] + chg: Change application entry point from WinMain to wWinMain. (See MSDN article "WinMain: The Application Entry Point" at https://msdn.microsoft.com/en-us/library/windows/desktop/ff381406.) --- minipath/src/minipath.c | 9 +++------ minipath/src/minipath.h | 2 +- src/Notepad3.c | 9 ++++----- src/Notepad3.h | 2 +- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/minipath/src/minipath.c b/minipath/src/minipath.c index 6c2c5fde9..b40b58ce3 100644 --- a/minipath/src/minipath.c +++ b/minipath/src/minipath.c @@ -279,7 +279,7 @@ static HMODULE __fastcall _LoadLanguageResources(LANGID const langID) // WinMain() // // -int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nCmdShow) +int WINAPI wWinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPWSTR lpCmdLine,int nCmdShow) { UNUSED(hPrevInst); @@ -407,8 +407,9 @@ BOOL InitApplication(HINSTANCE hInstance) // InitInstance() // // -HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow) +HWND InitInstance(HINSTANCE hInstance,LPWSTR pszCmdLine,int nCmdShow) { + UNUSED(pszCmdLine); RECT rc; rc.left = wi.x; rc.top = wi.y; rc.right = wi.x + wi.cx; rc.bottom = wi.y + wi.cy; @@ -521,11 +522,7 @@ HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow) if (!ListView_GetItemCount(hwndDirList)) PostMessage(hwndMain,WM_COMMAND,MAKELONG(IDM_VIEW_UPDATE,1),0); - - UNUSED(pszCmdLine); - return(hwndMain); - } diff --git a/minipath/src/minipath.h b/minipath/src/minipath.h index 63afbbdd2..828f9c9d4 100644 --- a/minipath/src/minipath.h +++ b/minipath/src/minipath.h @@ -83,7 +83,7 @@ //==== Function Declarations ================================================== BOOL InitApplication(HINSTANCE); -HWND InitInstance(HINSTANCE,LPSTR,int); +HWND InitInstance(HINSTANCE,LPWSTR,int); BOOL ActivatePrevInst(); void ShowNotifyIcon(HWND,BOOL); diff --git a/src/Notepad3.c b/src/Notepad3.c index 2813f7bff..d74207cfc 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -604,7 +604,7 @@ static void __fastcall _SetDocumentModified(bool bModified) // // -int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nCmdShow) +int WINAPI wWinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPWSTR lpCmdLine,int nCmdShow) { UNUSED(hPrevInst); @@ -1097,8 +1097,10 @@ static void __fastcall _InitWindowPosition(HWND hwnd) // InitInstance() // // -HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow) +HWND InitInstance(HINSTANCE hInstance,LPWSTR pszCmdLine,int nCmdShow) { + UNUSED(pszCmdLine); + g_hwndMain = NULL; _InitWindowPosition(g_hwndMain); @@ -1353,9 +1355,6 @@ HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow) PostMessage(g_hwndMain, WM_CLOSE, 0, 0); } - - UNUSED(pszCmdLine); - return(g_hwndMain); } diff --git a/src/Notepad3.h b/src/Notepad3.h index e373f0fff..a9c3d3c78 100644 --- a/src/Notepad3.h +++ b/src/Notepad3.h @@ -110,7 +110,7 @@ typedef enum { //==== Function Declarations ================================================== bool InitApplication(HINSTANCE); -HWND InitInstance(HINSTANCE,LPSTR,int); +HWND InitInstance(HINSTANCE,LPWSTR,int); void BeginWaitCursor(LPCWSTR text); void EndWaitCursor(); bool ActivatePrevInst();