2020-09-29

How do you focus on a specific window using winapi?

My goal is to make a function similar to this but using an HWND window object as the parameter.

Things I've tried:

ShowWindow(hwnd, SW_RESTORE);
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
SetActiveWindow(hwnd);
SetForegroundWindow(hwnd)
SetFocus(hwnd);
SendMessage(hwnd, WM_SETFOCUS, 0, 0);
PostMessage(hwnd, WM_SETFOCUS, 0, 0);


from Recent Questions - Stack Overflow https://ift.tt/3cQB757
https://ift.tt/eA8V8J

No comments:

Post a Comment