minimize+Restore Loses all my gadgets

Just starting out? Need help? Post your questions and find answers here.
User avatar
HeX0R
Addict
Addict
Posts: 1224
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: minimize+Restore Loses all my gadgets

Post by HeX0R »

There is nothing wrong to stay with old PB versions, I also have very old tools, I didn't touch for ages and just am too lazy to get them pushed to the latest updates.
But as a matter of fact, none of my hundreds of tools, no matter how old, "break" when minimizing.
Which means, the reason for the effect is not PB per se, but something in your code.
But without seeing the effect with an example code, no one will be able to help you.

My crystal ball tells me you might make use of SetGadgetColor().

BarryG is right, try to shrink it down to a small example showing the effect, only then you'll receive useful help.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 5006
Joined: Sun Apr 12, 2009 6:27 am

Re: minimize+Restore Loses all my gadgets

Post by RASHAD »

Hi Randy
I have a feeling about your use of #WM_SIZE
Next is my last shoot
Use one of them in your window callback
I wish you luck

Code: Select all

   Case #WM_SYSCOMMAND
      Select wParam
        Case #SC_MAXIMIZE
          Debug WindowX(?)
          Debug WindowWidth(?)
          
        Case #SC_RESTORE
          ShowWindow_(WindowID(?),#SW_HIDE)
          ResizeWindow(?,0,0,400,400)
          ShowWindow_(WindowID(?),#SW_SHOW)
      EndSelect       

    Case #WM_SIZE
      Select wParam 
        Case #SIZE_MINIMIZED 
          Debug "Window was minimized" 
        Case #SIZE_RESTORED
;           ShowWindow_(WindowID(0),#SW_HIDE)
;           ResizeWindow(0,0,0,400,400)
;           ShowWindow_(WindowID(0),#SW_SHOW)
          ;Debug "Window was restored" 
        Case #SIZE_MAXIMIZED 
          ;Debug "Window was maximized" 
      EndSelect
Egypt my love
Post Reply