On Mon, Jan 9, 2012 at 12:32 PM, Oliver Sims <
[email protected]> wrote:

> **
> Many thanks for the "rough working example."
> I see now where I was going wrong. I had thought that "mouse~capture"
> would as it were "prime" a dialog to capture the mouse whenever the mouse
> was moved over it. I now see from your example that when a dialog captures
> the mouse, that dialog keeps a-hold of it until it lets go.
>
>

Yes, exactly.



>
>
> Which makes me think - is there any way in Windows for a window to
> forcibly capture the mouse? Just curious.
>
>
>



This may be more detail than most ooDialog programmers will understand, but
...

In Windows, you can only capture the mouse of a window that was created in
the same thread you are executing in.  In ooDialog, each top level dialog
has a message processing procedure running in its own thread.  All dialog
controls of that dialog are created (by the operating system) in that
thread.

So, for your program that has 2 different dialogs running, in dialog A you
can only capture the mouse for dialog A's window and its dialog control
windows.  Vice verse for dialog B.

In Windows, to capture the mouse, you explicitly use the window handle of
the window that is capturing the mouse.  In ooDialog, a .Mouse object is
tied to a specific window, so the window handle is implicit in the object
that is capturing the mouse.

The long and short of it is, in Windows you can not forcibly capture the
mouse for a window that does not belong to your program.  For instance, if
a Microsoft Word application is running, you can get the window handle of
that running application, but you can not use that window handle to capture
the mouse.

And, it would be silly if you could.  When you capture the mouse, all mouse
messages are sent to the window whose window handle is used in the
SetCapture() API.  So, if you used the window handle of the Word
application (if that worked) then the Word application would get all the
mouse messages.  But, in your program, there is nothing you can do with
that situation.  You have no way of influencing what Word does, or
even knowing anything about those messages.

--
Mark Miesfeld
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to