More native support for window events (minimize,maximize...)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

More native support for window events (minimize,maximize...)

Post 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)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
hellhound66
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Feb 21, 2006 12:37 pm

Post by hellhound66 »

Removed.
Last edited by hellhound66 on Wed Mar 19, 2008 11:28 pm, edited 1 time in total.
Straker
Enthusiast
Enthusiast
Posts: 701
Joined: Wed Apr 13, 2005 10:45 pm
Location: Idaho, USA

Post 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.
Image Image
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post 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.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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 :)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post 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! :D
Should do also on MacOS / other PB-supported OS.

But a native event support - like suggested from me - should still be done, I think :)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Andre wrote:Thanks for this great tipp! It's working fine for me too! :D
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.
quidquid Latine dictum sit altum videtur
Post Reply