Skip to content

Commit

Permalink
Handle explorer.exe created correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
alvesvaren committed Nov 8, 2024
1 parent b0f5cd4 commit ec972df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions resizer2/resizer2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ static void RemoveTrayIcon() {
}

LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
if (uMsg == WM_TASKBARCREATED) {
AddTrayIcon(hWnd);
return 0;
}

switch (uMsg) {
case WM_TRAYICON:
if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN) {
Expand Down Expand Up @@ -191,6 +196,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
return 0;
}

WM_TASKBARCREATED = RegisterWindowMessage(TEXT("TaskbarCreated"));

AddTrayIcon(hWnd);

hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, NULL, 0);
Expand Down
1 change: 1 addition & 0 deletions resizer2/resizer2.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ extern NOTIFYICONDATA nid;
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK LowLevelMouseProc(int nCode, WPARAM wParam, LPARAM lParam);
DWORD WINAPI WindowOperationThreadProc(LPVOID lpParam);
UINT WM_TASKBARCREATED;

void adjustWindowOpacity(int change);
void minimizeWindow();
Expand Down

0 comments on commit ec972df

Please sign in to comment.