Setting active window
I want to make my window the active window as soon as the mouse passes over it. I tried using SetActiveWindow() and SetForegroundWindow() but those functions didn't do it, they just made the taskbar entry flash. I then did this:
And it works fine. Is there a more efficient way to do it? Maybe I'm not using SetActiveWindow() correctly?
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
When i use multiple forms, i set focus like this(ws is a WinStack that keeps the HWND's):
Window that receives focus:
Window that loses focus: