Restored from previous forum. Originally posted by Franco.Code:
; (c) 2001 - Franco's template - absolutely freeware
; IsIconic checks if a window is minimized or not.
; So if to store the window size and position is needed
; you can prevent to save minimized values when you close
; a minimized window.
Procedure.l ScreenWidth ()
ProcedureReturn GetSystemMetrics_(#SM_CXSCREEN)
EndProcedure
Procedure.l ScreenHeight ()
ProcedureReturn GetSystemMetrics_ (#SM_CYSCREEN)
EndProcedure
; draw a window and place it outside the desktop
If OpenWindow(0, ScreenWidth (), ScreenHeight (), 320, 240, "Test if Window is minimized or not", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
xPos = (ScreenWidth () / 2) - (WindowWidth(0) / 2)
yPos = (ScreenHeight () / 2) - (WindowHeight(0) / 2)
; move the window to the center of the desktop
ResizeWindow(0, xPos, yPos, #PB_Ignore, #PB_Ignore)
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_CloseWindow
Quit = 1
EndIf
Until Quit = 1
If IsIconic_(WindowID(0))
MessageRequester("Information","Window is minimized")
ShowWindow_(WindowID(0),1)
;now it's a good time to save the window size and position if needed
Else
MessageRequester("Information","Window is not minimized")
EndIf
EndIf
End
Have a nice day...
Franco