Skip to content

Commit

Permalink
Better always on top.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Jan 8, 2009
1 parent a7b3aa6 commit e55d645
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions windowfinder.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR szCmdLine, in
RegisterClassEx(&wnd);

//Create window
HWND hwnd=CreateWindowEx(/*WS_EX_LAYERED|*/WS_EX_TOOLWINDOW, wnd.lpszClassName, APP_NAME, WS_POPUP, 0, 0, 0, 0, NULL, NULL, hInst, NULL);
SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE); //Always on top
HWND hwnd=CreateWindowEx(/*WS_EX_LAYERED|*/WS_EX_TOOLWINDOW|WS_EX_TOPMOST, wnd.lpszClassName, APP_NAME, WS_POPUP, 0, 0, 0, 0, NULL, NULL, hInst, NULL);
cursorwnd=hwnd;

//Load icon
Expand Down Expand Up @@ -280,7 +279,7 @@ void ShowContextMenu(HWND hwnd) {

//Track menu
SetForegroundWindow(hwnd);
TrackPopupMenu(hMenu, TPM_BOTTOMALIGN, pt.x, pt.y, 0, hwnd, NULL );
TrackPopupMenu(hMenu, TPM_BOTTOMALIGN, pt.x, pt.y, 0, hwnd, NULL);
DestroyMenu(hMenu);
}

Expand Down

0 comments on commit e55d645

Please sign in to comment.