I want to be able to drag an image from my application window over controls on other windows, and releasing it, get the handle of the control I released it over.
Any ideas?
Any ideas?
You can use SetCapture to direct all the mouse input to your window, and ReleaseCapture when done with the drag.
Typically, you can call SetCapture when you receive WM_LBUTTONDOWN with the cursor's coordinates being within your image. And upon the receipt of WM_LBUTTONUP, check to see if the mouse input is already captured. If yes, release the capture. Since all WM_MOUSEMOVEs and the WM_LBUTTONUP are sent to your own window, you can easily proceed them as you like. WindowFromPoint would suit most of the needs.
Typically, you can call SetCapture when you receive WM_LBUTTONDOWN with the cursor's coordinates being within your image. And upon the receipt of WM_LBUTTONUP, check to see if the mouse input is already captured. If yes, release the capture. Since all WM_MOUSEMOVEs and the WM_LBUTTONUP are sent to your own window, you can easily proceed them as you like. WindowFromPoint would suit most of the needs.
Bomb01, pretty well said all that is needed to say, but you can look at my TopMost tool source, as it has all this done in code...
http://www.asmcommunity.net/board/index.php?topic=5476&perpage=15&pagenumber=2
:alright:
NaN
http://www.asmcommunity.net/board/index.php?topic=5476&perpage=15&pagenumber=2
:alright:
NaN
I had a problem when it came to using WindowFromPoint.
My MASM Include (user32) specifies two parameters for this call.
But the Windows API says just a pointer to a POINTS structure.
What's the other parameter ??
My MASM Include (user32) specifies two parameters for this call.
But the Windows API says just a pointer to a POINTS structure.
What's the other parameter ??
It doesnt POINT to the structure... it IS the structure..
You see this in other C++ doc's of the API.
I dunno why for sure, i guess the "smart' HLL compilers know in this case that the "POINTER" is really unpacking the structure into separate params... kinda stupid to break the steadfast rules...
anyways.. just pass: Point.x, Point.y instead of addr Point :rolleyes:
This is a cut from the source, linked above.. (modified by f0dder)
:NaN:
You see this in other C++ doc's of the API.
I dunno why for sure, i guess the "smart' HLL compilers know in this case that the "POINTER" is really unpacking the structure into separate params... kinda stupid to break the steadfast rules...
anyways.. just pass: Point.x, Point.y instead of addr Point :rolleyes:
This is a cut from the source, linked above.. (modified by f0dder)
invoke ClientToScreen, [hWnd], addr PT
invoke WindowFromPoint, [PT.x], [PT.y]
:NaN:
Thanks for the source, I'll explain what I meant...
m$ declared two structs : POINT and POINTS.
One uses dwords, and the other uses words.
When I looked up GetWindowFromPoint in the microsoft win32 api helpfile, it stated to use a POINTS struct, not POINT.
That was dealt with deftly in the source you referred.
I coded a quickie but decent popup killer..
Here is the fruit of my labors.
The Capture is a little wiggy, I'd appreciate beta testing.
It seems to work when it darn well wants to...
...but the rest of it works like a charm
:)
m$ declared two structs : POINT and POINTS.
One uses dwords, and the other uses words.
When I looked up GetWindowFromPoint in the microsoft win32 api helpfile, it stated to use a POINTS struct, not POINT.
That was dealt with deftly in the source you referred.
I coded a quickie but decent popup killer..
Here is the fruit of my labors.
The Capture is a little wiggy, I'd appreciate beta testing.
It seems to work when it darn well wants to...
...but the rest of it works like a charm
:)