flat assembler
Message board for the users of flat assembler.
Index
> Windows > Moving window |
Author |
|
RedGhost 19 May 2006, 20:20
the first thing that i can think of is GetWindowRect( ), there is also the WM_MOVE message and the low word of lParam is the x, the high word of lParam is the y, but i am not sure if this can move with SendMessage( ) or is simply a notification
_________________ redghost.ca |
|||
19 May 2006, 20:20 |
|
OzzY 19 May 2006, 21:09
Thanks, I think it will work!
WM_MOVE must be the notification message. If x and y are in lParam, I can then use MoveWindow() API to move the window. Although I have no idea on how to implement this, it seems that it's the way... |
|||
19 May 2006, 21:09 |
|
Vasilev Vjacheslav 20 May 2006, 06:09
try this (masm):
Code: ... cmp ax,WM_MOUSEMOVE jz @@wmmousemove ... @@wmmousemove: invoke _domove,[hWnd] jmp @@processed ... _domove proc hWnd:dword local pt:POINT local rct:RECT lea esi,[pt] invoke GetCursorPos,esi lea edi,[rct] invoke GetWindowRect,[hWnd],edi mov eax,[pt.x] sub eax,[ptmove.x] add eax,[rct.left] mov edx,[pt.y] sub edx,[ptmove.y] add edx,[rct.top] m2m [ptmove.x],[pt.x] m2m [ptmove.y],[pt.y] mov ecx,[rct.right] sub ecx,[rct.left] mov ebx,[rct.bottom] sub ebx,[rct.top] invoke MoveWindow,[hWnd],eax,edx,ecx,ebx,TRUE ret _domove endp |
|||
20 May 2006, 06:09 |
|
WytRaven 01 Jun 2006, 03:51
In your message handling loop catch mouse down events (WM_LBUTTONDOWN) and check if the pointer is within the area of your 'title bar' if it is then post a WM_NCLBUTTONDOWN event to the window specifiying that the button is down on the real (and nonexistant) title bar (HTCAPTION) using SendMessage API. the OS will do the rest.
eg. SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, NULL) I hope that made sense _________________ All your opcodes are belong to us |
|||
01 Jun 2006, 03:51 |
|
OzzY 01 Jun 2006, 18:52
Thanks WytRaven!
Your way is the easiest and works!
|
||||||||||
01 Jun 2006, 18:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.