What is PB constant for Window Minimize?[SOLVED]
-
- Enthusiast
- Posts: 339
- Joined: Tue Jan 30, 2007 5:47 am
- Location: Hong Kong
What is PB constant for Window Minimize?[SOLVED]
We can detect the window closing with PB constant #PB_Event_CloseWindow.
If I want to detect the window is minimizing by the user, what will be the PB constant? #PB_Event_MinimizeWindow?
If I want to detect the window is minimizing by the user, what will be the PB constant? #PB_Event_MinimizeWindow?
Last edited by SkyManager on Sun Mar 11, 2007 3:54 am, edited 1 time in total.
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Check the wParam of #WM_SIZE wich can be:
SIZE_MAXHIDE
Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXIMIZED
The window has been maximized.
SIZE_MAXSHOW
Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED
The window has been minimized.
SIZE_RESTORED
The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.
SIZE_MAXHIDE
Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXIMIZED
The window has been maximized.
SIZE_MAXSHOW
Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED
The window has been minimized.
SIZE_RESTORED
The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
minimizing seems to be a #PB_Event_MoveWindow.
check it out:
to determine if it is a move or a minimize you may have to check the messages like Fluid said...
check it out:
Code: Select all
If OpenWindow(0, 0, 0, 500, 400, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget )
Repeat
Event = WaitWindowEvent()
Debug event
Until Event = #PB_Event_CloseWindow
EndIf
oh... and have a nice day.
Code: Select all
#APPNAME = ""
#WndMain = 0
OpenWindow(#WndMain, 0, 0, 640, 480, #APPNAME, #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
CreateGadgetList(WindowID(#WndMain))
Repeat
Select WaitWindowEvent()
Case #PB_Event_DeactivateWindow
If GetWindowState(#WndMain) = #PB_Window_Minimize
Debug "Minimized"
EndIf
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
#PB_Event_MoveWindow works, too:
Code: Select all
OpenWindow(0, 0, 0, 500, 400, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget )
OldState = GetWindowState(0)
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_MoveWindow
State = GetWindowState(0)
If State <> OldState
OldState = State
Select State
Case #PB_Window_Minimize
Debug "just minimized"
Case #PB_Window_Maximize
Debug "just maximized"
Case #PB_Window_Normal
Debug "original size"
EndSelect
EndIf
EndSelect
Until Event = #PB_Event_CloseWindow
oh... and have a nice day.
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
the code by trond works only on linux (the constant is'nt available in windows) ,
and the code by kaeru works only in windows
and the code by kaeru works only in windows

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
No, it should be crossplatform compatible. Everything used is available on both systems.ts-soft wrote:and the code by kaeru works only in windows
But the question is if this is required at all.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
>> it should
but is it
but is it

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

-
- Enthusiast
- Posts: 339
- Joined: Tue Jan 30, 2007 5:47 am
- Location: Hong Kong
-
- Enthusiast
- Posts: 339
- Joined: Tue Jan 30, 2007 5:47 am
- Location: Hong Kong
Finally, I find a very brief/straight-forward answer
Code: Select all
if IsIconic_(WindowID(MainWindow))
. . . .
endif
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
SkyManager wrote:Finally, I find a very brief/straight-forward answerCode: Select all
if IsIconic_(WindowID(MainWindow)) . . . . endif

oh... and have a nice day.