6 Commits
v1.3 ... v1.4

Author SHA1 Message Date
W0LF
4586599d2c Update README.md 2020-01-23 17:32:57 +03:00
dfdbd6a94b Merge branch 'master' of https://github.com/dreamforceinc/wCenterWindow 2020-01-23 17:21:33 +03:00
5ef184bee3 change version number 2020-01-23 17:18:24 +03:00
ce31a7d6e0 Added commandline option '/hide' for hide trayicon at startup. 2020-01-23 17:15:30 +03:00
W0LF
00a949f502 Update README.md 2020-01-22 13:46:50 +03:00
W0LF
703fccaa15 Update README.md 2020-01-22 13:46:25 +03:00
3 changed files with 14 additions and 2 deletions

View File

@@ -1,2 +1,6 @@
# wCenterWindow # wCenterWindow
This program centers the current active window by a 'LCTRL + LWIN + C' hotkey. This program centers the current active window by a `LCTRL + LWIN + C` hotkey.
`LCTRL + LWIN + I` hotkey - hide tray icon.
You can add `/hide` option to command line for hiding trayicon at startup.

View File

@@ -28,6 +28,14 @@ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK KeyboardHookProc(int, WPARAM, LPARAM); LRESULT CALLBACK KeyboardHookProc(int, WPARAM, LPARAM);
BOOL CreateTrayIcon(); BOOL CreateTrayIcon();
VOID parseCmdLine()
{
int nArgs = 0;
LPWSTR *szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
(nArgs >= 2 && 0 == lstrcmpiW(szArglist[1], L"/hide")) ? showIcon = FALSE : showIcon = TRUE;
LocalFree(szArglist);
}
// Точка входа // Точка входа
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance, _In_opt_ HINSTANCE hPrevInstance,
@@ -53,6 +61,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
return FALSE; return FALSE;
} }
parseCmdLine();
if (showIcon) if (showIcon)
{ {
if (!CreateTrayIcon()) if (!CreateTrayIcon())
@@ -244,4 +253,3 @@ VOID ShowError(HINSTANCE hInstance, UINT uID)
LoadStringW(hInstance, uID, szErrorText, MAX_LOADSTRING); LoadStringW(hInstance, uID, szErrorText, MAX_LOADSTRING);
MessageBox(hWnd, szErrorText, szTitle, MB_OK | MB_ICONERROR); MessageBox(hWnd, szErrorText, szTitle, MB_OK | MB_ICONERROR);
} }

Binary file not shown.