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

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation