How can I use SetCapture to get a screen rect. 
Author Message
 How can I use SetCapture to get a screen rect.

I want to set boundaries on the screen based on user input.  I do not want to
make a separate dialog box and have the user draw a rectangle for its boundary.
I would like to capture the mouse cursor and have the user be able to draw or
select two points that would be the enclosing area.  I have tried SetCapture and
the with the MouseDown event there is always a corresponding MouseUp event (I
used Spy++ to receive all Mouse Messages that went to my window).  After the
MouseUp event my program doesn't have the mouse captured.

Any assistance would be appreciated,
-Paul



Tue, 30 Jul 2002 03:00:00 GMT  
 How can I use SetCapture to get a screen rect.

Quote:
> I want to set boundaries on the screen based on user input.  I do not want
to
> make a separate dialog box and have the user draw a rectangle for its
boundary.
> I would like to capture the mouse cursor and have the user be able to draw
or
> select two points that would be the enclosing area.  I have tried
SetCapture and
> the with the MouseDown event there is always a corresponding MouseUp event
(I
> used Spy++ to receive all Mouse Messages that went to my window).  After
the
> MouseUp event my program doesn't have the mouse captured.

I'm not sure that I know exactly what you want to do. But if you want to
limit the user's ability to position the mouse then check the docs for
GetClipCursor() and ClipCursor().

Regards,
Will



Tue, 30 Jul 2002 03:00:00 GMT  
 How can I use SetCapture to get a screen rect.
This is what I will do.  But I want the user to select the region which will be
clipped.  My dialog box is only so big and the user may want to select a large
clipping rectangle.

-Paul



Quote:


> > I want to set boundaries on the screen based on user input.  I do not want
> to
> > make a separate dialog box and have the user draw a rectangle for its
> boundary.
> > I would like to capture the mouse cursor and have the user be able to draw
> or
> > select two points that would be the enclosing area.  I have tried
> SetCapture and
> > the with the MouseDown event there is always a corresponding MouseUp event
> (I
> > used Spy++ to receive all Mouse Messages that went to my window).  After
> the
> > MouseUp event my program doesn't have the mouse captured.

> I'm not sure that I know exactly what you want to do. But if you want to
> limit the user's ability to position the mouse then check the docs for
> GetClipCursor() and ClipCursor().

> Regards,
> Will



Wed, 31 Jul 2002 03:00:00 GMT  
 How can I use SetCapture to get a screen rect.

Quote:
> This is what I will do.  But I want the user to select the region which
will be
> clipped.  My dialog box is only so big and the user may want to select a
large
> clipping rectangle.

So we are talking about capturing mouse messages outside of your own
windows?

If not, as Emily Littella used to say - "nevermind".

 If so you have at least two possibilities:

1) Put up a system-wide hook (check the docs for SetWindowsHookEx() and
MouseProc() )

2) Set a timer and when it fires periodically check on the position of the
cursor and state of the buttons. My guess is that you'd need 5 to 10 timer
ticks per second

Regards,
Will



Wed, 31 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Beginner [Q] Using Canned File Open/Save dialog

2. Question about getting rect dimensions.

3. Getting the desktop rect without taskbar

4. Getting CTabCtrl Rect

5. HOW Getting SCROLL RECT of the EDIT CONTROL?

6. Getting rid of a focus rect???

7. Getting rect or size of title bar

8. Keyboard problem when using SetCapture()

9. Determining what canned preprocessor symbols are available

10. Help with compiling a "canned" program

11. Canned Dialogs

12. PRB: Getting E_NOINTERFACE when using DCOM, everything is OK when used locally

 

 
Powered by phpBB® Forum Software