Gambas India Forum

Select Window & Select Area

Do you like this program?

I think there are problems with the app as stripped down by you. The image shown in the FMain form's PictureBox includes a 'border' (from the desktop, typically part of another window) around the selected window: could this be due to the If line in the above code?. I've amended the app and put print statements back in to see what's going on. I removed the 'If .Desktop' and 'End If' lines in the FMain form's Open event as they stopped windows being stored in the aWindow: shown by results of the Print Statements. I also put back coding to draw a border around the selected desktop window (with a wait of 10 seconds) as I wanted to see which window was selected when I clicked in the overlapping area of 2 desktop windows: this will also be required in the StreamRecorder app which will use the SelectWindow & SelectArea forms & Class coding from the corresponding apps. However, I forgot until now to alter the Opacity setting back to 35 so that didn't work. Could you explain in detail what the 2 lines shown below do? IMO a window shoulld be selectable even if it is overlapped by another window provided that the overlap area is not clicked on: does that coding achieve that? I've been wondering if the Shaded property of the Desktop window object has anything to do with a window which is overlapped.

If Mouse.ScreenX > hWindow.X - 20 And Mouse.ScreenX < hWindow.X + hWindow.Width And Mouse.ScreenY > hWindow.Y - 20 And Mouse.ScreenY < hWindow.Y + hWindow.Height Then Shell "wmctrl -a " & hWindow.Name

I took a look at the Wikibooks Programming Gambas from Zip. I liked the fact that it looked like a Reference manual. Whereas the other 4 book set is what I would call a Learning Manual/Guide (i.e. it doesn't cover everything in depth but it allows the beginner to get going: problem with that is, especially at my age, is forgetting the detail of topics and/or not knowing enough detail.