It is currently Sun May 19, 2013 7:52 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [Windows] Check if a window is minimized
PostPosted: Tue Oct 09, 2001 11:12 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777210
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2001 12:13 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777210
Restored from previous forum. Originally posted by Fangbeast.

Quote:
; (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.

Have a nice day...
Franco



Franco, Just a query for those of us still learning PB...can your functions be converted to callable libraries? Can you bundle up your temples for us relative beginners and add them to the PB resource site?

Cutting and pasting from Internet Explorer does some strange things to the PB IDE so it might be easier this way.

Regards, Fangles

Fangles


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2001 4:16 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777210
Restored from previous forum. Originally posted by Franco.

Oh Fangles, this would be great...
but I'm not a asm or C coder.
The only thing I can do now is, to write Procedures so you can call these and benefit from them.
I hope that, some fine day, PureBasic is able to create lib's itself. (Please Fred )
OK, a library created with PB can't be as good as a good asm coder would make it, but it's better (IMHO) than Procedures in Include files (...I like Includes files).

I began to organize some PB code on my HD and, you have right, it is a good idea to bundle it up and to put it on Pauls Server.
I will do that, stay tuned...




Have a nice day...
Franco


Edited by - franco on 16 October 2001 17:17:46


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2001 7:25 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777210
Restored from previous forum. Originally posted by Fangbeast.

Quote:

I began to organize some PB code on my HD and, you have right, it is a good idea to bundle it up and to put it on Pauls Server.
I will do that, stay tuned...


You and Mr Skunk make some great stuff and it's been of help to me, that's why I wanted to see it on the resource site. Thanks. If I ever get this IncrediMail cataloguer working, I can post that as well.

Fangles


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye