Now, I'm developing the app to reset the position of window. One thing to notice is that I used the global mouse hook to listen the desktop mouse event. Global Mouse hook is working well. My issue is that SetWindowPos() method is working strangely. The following is my code:
case WM_LBUTTONUP:
mouselbut_clicked = false;
if (mousewnd_drag)
{
TRACE("mouse - lbutton release\n");
if ( window_moved )
{
::SetWindowPos(hWnd, 0, 0, 0, 500, 500, SWP_ASYNCWINDOWPOS | SWP_NOZORDER);
window_moved = false;
}
}
break;
When I build the app, the window goes into the top-left corner of the desktop, but suddenly, it comes back into original position.
Would you like to help me to resolve this issue?