[Gambas-user] Selecting a window

Fabien Bodard gambas.fr at ...626...
Wed Dec 4 20:18:50 CET 2013


I'm sure to understand what you want to achieve ... what do you mean
by select a windows ?

2013/12/4 John Rose <john.aaron.rose at ...626...>:
> I want the user to be able to click a point within one of the windows
> displayed on the desktop (i.e. not just Gambas forms) in order to select
> that window. The code below shows how to access properties of all windows:
> 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 each
> dWindow property (i.e. X, Y, Width, Height), one can determine which
> window has been clicked. Is that the best way? But how can one allow for
> the situation where the user has clicked a point which is within 2
> windows i.e. is there a property of dWindow which shows if that window
> is the 'top' one (i.e. covering the other one at that point)?
>
>
>
> ------------------------------------------------------------------------------
> 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




More information about the User mailing list