Hello,All

MOUSEHOOKSTRUCT STRUCT
  pt            POINT      <>
  hwnd          DWORD      ?
  wHitTestCode  DWORD      ?
  dwExtraInfo  DWORD      ?
MOUSEHOOKSTRUCT ENDS


i'v known use the MOUSEHOOKSTRUCT to get the mouse's x, y coordinates, but i don't know how get the mouse's LBUTTONDOWN,LBUTTONUP at same time.

could you anybody help me?

regards
Posted on 2005-09-06 11:23:54 by dcskm4200
dcskm4200,
    Look at WM_MOUSEMOVE.  It gives cursor coordinates and mouse keys status at the same time. Same thing with WM_LBUTTONDOWN, WM_LBUTTONUP, and all the other mouse status key messages.  Ratch
Posted on 2005-09-06 23:41:28 by Ratch
Hello,Ratch
Thanks you for response.

if I use the WM_LBUTTONDOWN,WM_LBUTTONUP... I can't get any message when the mouse is outside the window. F-four gave us an example in KMD16, but the example can't work with USB port's Mouse.

regards
Posted on 2005-09-07 00:35:30 by dcskm4200
dcskm4200,

     You need to catch the rodent with the SetCapture API.  Then all messages from it will be sent to your thread regardless of where it wanders.  RWA
Posted on 2005-09-07 10:55:46 by Ratch
Hello,Ratch

Thanks you for respose.

i did't know how use the SetCapture.
plz help me.

regards
Attachments:
Posted on 2005-09-17 07:18:15 by dcskm4200
dcskm4200,
    Easy to use.  Look in the API documentation.  Ratch
Posted on 2005-09-17 07:37:03 by Ratch
hello,Ratch

it is easy to you, difficult to me. I'v already read the SetCapture documentation. source code is there, Plz modify it.

regards
Posted on 2005-09-17 07:43:32 by dcskm4200
dcskm4200,
     Enclosed is a ZIP file of a program from chapter 7 of Charles Petzold's book Programming Windows, 5th edition.  I converted it from its C source to MASM.  I included Petzold's C source and executable also.  Everything you need to build my MASM version is included.  Hold down the left mouse key and drag it around.  After releasing the button, you will see a black rectangle.  Notice that the mouse controls the rectangle even if the mouse if it is moved outside the client window.  You can comment out the lines of code line pertaining to mouse capture and release capture.  They are designated with a ########## in the comment field.  You will then notice that the rectangle does not move if the mouse is moved outside the client window.  Also notice the difference in size between the MASM version and the C version executable.  Ask if you have any questions.  Ratch
Attachments:
Posted on 2005-09-18 03:56:35 by Ratch
Hello,Ratch

thanks you very much.
This is the needness what i want.

regards
Posted on 2005-09-18 06:59:19 by dcskm4200
Hello,Ratch

I used two days for understanding your code. i'm still mazing.
Hutch-- has written a code in attachment.

question:
1. the window system can't react any action when mouse is outside the client window, Only the client exe can react some actions.
2. if the client exe read the mouse coordinates, the mouse coordinates should be read in the screen, no the client window.

regards 
Attachments:
Posted on 2005-09-19 08:51:01 by dcskm4200
dcskm4200,
    What are your questions?  Ratch
Posted on 2005-09-19 09:29:18 by Ratch
Hello,Ratch

sorry for my poor English. I did not give you an accurate expression of my question.

I want to write a simple code like as the professional windows screen capture utility( ACS Capture 2.0 )

regards
Posted on 2005-09-20 01:24:50 by dcskm4200


   

question:
1. the window system can't react any action when mouse is outside the client window, Only the client exe can react some actions.
2. if the client exe read the mouse coordinates, the mouse coordinates should be read in the screen, no the client window.

sorry for my poor English. I did not give you an accurate expression of my question.
I want to write a simple code like as the professional windows screen capture utility( ACS Capture 2.0 )



dcskm4200 ,
    What are your questions?  I know nothing about the program you mentioned.  Ratch
Posted on 2005-09-20 10:24:39 by Ratch
Hello,Ratch

1.
I hope your BLOKOUT.exe which can display the selected Rectangle's parameters ( Rct.left,Rct.top,Rct.right,Rct.bottom ) in the caption of BLOKOUT.exe, whether the mouse is any position.

2.
while your BLOKOUT.exe is running, if the mouse is outside the client window, I hope the mouse do nothing besides it can select the Rectangle.

the question is that BLOKOUT.exe can't do the thing which I hope. or How i modify the BLOKOUT.ASM to do the above thing?

regards
Posted on 2005-09-20 11:08:21 by dcskm4200