Page 1 of 1
More native support for window events (minimize,maximize...)
Posted: Sun Mar 09, 2008 2:55 pm
by Andre
I would like to see more supported window events, which are recognized by the PB commands WindowEvent() and WaitWindowEvent().
That would be: minimizing, maximizing, resizing + probably more events (don't know at the moment)
At the moment this events could only be catched using a callback + related API commands/constants (see help file example at the SetWindowCallback() command). But this isn't cross-plattform.
Thanks!
(Haven't newer topics about this, so made I new one. It partly according to this old topic:
http://www.purebasic.fr/english/viewtop ... t=minimize)
Posted: Sun Mar 09, 2008 5:41 pm
by hellhound66
Removed.
Posted: Thu Mar 13, 2008 7:06 pm
by Straker
+1
I am dealing with this right now. Which is why I landed in this thread doing a search.
I went to the help file for WindowEvent() to look for the right syntax for catching a minimize event, but found nothing. It would be nice to see the following added:
#PB_Event_MinimizeWindow - the window has been minimized.
#PB_Event_MaximizeWindow - the window has been maximized.
Posted: Thu Mar 13, 2008 8:05 pm
by Edwin Knoppert
This seems to work:
Case #PB_Event_MoveWindow
Debug IsIconic_( hWndMain )
Debug IsZoomed_( hWndMain )
Of course, on any move this will be executed as well.
You'll need to track the changes.
Posted: Thu Mar 13, 2008 11:52 pm
by Rescator
That's correct Edwin.
Just catch the #PB_Event_MoveWindow
then do i.e.
If GetWindowState(#Window)=#PB_Window_Minimize
EndIf
One of my app does that currently, works fine.
And #PB_Event_MoveWindow is only triggered on a move end. (after you let go of it) or when the window is minimized or restored (or maximized as well I guess)
At least there is no need for a callback to handle this anymore

Posted: Mon Mar 17, 2008 9:37 pm
by Andre
Rescator wrote:Just catch the #PB_Event_MoveWindow
then do i.e.
If GetWindowState(#Window)=#PB_Window_Minimize
EndIf
Thanks for this great tipp! It's working fine for me too!
Should do also on MacOS / other PB-supported OS.
But a native event support - like suggested from me - should still be done, I think

Posted: Mon Mar 17, 2008 10:01 pm
by freak
Andre wrote:Thanks for this great tipp! It's working fine for me too!
Should do also on MacOS / other PB-supported OS.
But a native event support - like suggested from me - should still be done, I think

Nope, won't work on Linux, because this event is just a side-effect of how Windows minimizes a window.
I have put this on my list for the next version.