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)