Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4586599d2c | ||
| dfdbd6a94b | |||
| 5ef184bee3 | |||
| ce31a7d6e0 | |||
|
|
00a949f502 | ||
|
|
703fccaa15 |
@@ -1,2 +1,6 @@
|
||||
# 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.
|
||||
|
||||
@@ -28,6 +28,14 @@ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK KeyboardHookProc(int, WPARAM, LPARAM);
|
||||
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,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
@@ -53,6 +61,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
parseCmdLine();
|
||||
if (showIcon)
|
||||
{
|
||||
if (!CreateTrayIcon())
|
||||
@@ -244,4 +253,3 @@ VOID ShowError(HINSTANCE hInstance, UINT uID)
|
||||
LoadStringW(hInstance, uID, szErrorText, MAX_LOADSTRING);
|
||||
MessageBox(hWnd, szErrorText, szTitle, MB_OK | MB_ICONERROR);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user