Hi,
what's the best way to fix a window agains moving by the user?
Best regards,
Nordwind64
Probably to intercept WM_MOVING and return TRUE (indicating that you've handled it). Though I haven't tried this before.
Nope, that doesn't work. Neither does WM_MOVE.
The following is a bit of a hack, but it does work. It causes the titlebar to be seen as the client area, but the buttons still work. You can easily add extra checks to prevent sizing, etc - if you need to.
WndProc proc hwnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
mov eax,uMsg
.IF (eax==WM_NCHITTEST)
invoke DefWindowProc, hwnd,uMsg,wParam,lParam ;this will return the HT_ value for where the pointer currently is
.IF (eax==HTCAPTION)
mov eax,HTCLIENT ;if it's on the caption, say it's on the client-area
.ENDIF
ret
.
.
.
Hi,
I tried WM_MOVE and WM_MOVING before. Don't work.
Tedd, the close button don't work with your solution. And I can open system menu and move window from there. Sorry.
What about removing "Move window" from system menu? Could that work?
Hehe, found the solution:
.elseif uMsg==WM_MOVING
invoke ReleaseCapture
mov eax,FALSE
ret
Best regards,
Nordwind64