[Gambas-user] Selecting a window

Fabien Bodard gambas.fr at ...626...
Thu Dec 5 18:25:30 CET 2013


Like this ?



2013/12/5 John Rose <john.aaron.rose at ...626...>:
> Fabien,
>
> I've looked at your "quick & dirty way". I don't think that it's what I
> want. I want the user to be able to select a window on the desktop (i.e.
> not just Gambas forms in a Gambas app) by clicking on any point in that
> window, not selecting it by dragging on the corners of a rectangle to
> its corners before clicking. Below is shown the method that I identified
> but is it the best/only way? Also, I don't see how to allow for the
> situation where the user has clicked a point which is within 2 or more
> windows i.e. is there a property of dWindow which shows if that window
> is the 'top' one (i.e. covering the other one(s) at that point)? This
> means that the user has to first ensure that the required window in on
> 'top'.
>
> As I previously said, the code below shows how to access properties of
> all windows (i.e. not just Gambas forms in a Gambas app):
> Dim dWindow As DesktopWindow = Null
> Desktop.Windows.Refresh()
> For Each dWindow In Desktop.Windows
>    If dWindow.Minimized = False Then
>       Print "Window: Name=" & dWindow.Name & ", " & "X=" & dWindow.X &
> ", Y=" & dWindow.Y & ", " & "Width=" & dWindow.Width & ", Height=" &
> dWindow.Height
>    Endif
> Next
>
> The only way I've thought of is to define a transparent form covering
> the whole desktop with an associated mouse click event, which supplies
> the co-ordinates of the point clicked. Then by examination of the
> properties (i.e. X, Y, Width, Height) of each dWindow, one can determine
> which window has been clicked by the user.
>
> --
> Regards, John
>
> ------------------------------------------------------------------------------
> Sponsored by Intel(R) XDK
> Develop, test and display web and hybrid apps with a single code base.
> Download it for free now!
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Windowsselector-0.0.1.tar.gz
Type: application/x-gzip
Size: 5614 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20131205/6f69dafb/attachment.bin>


More information about the User mailing list