Maximize animation on XP

Windows specific forum
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Maximize animation on XP

Post by chi »

If you maximize a window on XP and the visual style option "Animate windows when minimizing and maximizing" is enabled, you'll get an ugly theme-colored titelbar to visualize the animation...
Any chance to suppress/ownerdraw that animation? I'm drawing the whole window by myself (|on my own???) and it looks kinda lame ;).

Image

thx, chi
Et cetera is my worst enemy
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4997
Joined: Sun Apr 12, 2009 6:27 am

Re: Maximize animation on XP

Post by RASHAD »

Hi

Code: Select all

Global Animflag

OpenWindow(0,0,0,100,100,"Test",#PB_Window_SystemMenu| #PB_Window_ScreenCentered|#PB_Window_MaximizeGadget)
anm.ANIMATIONINFO
anm\cbSize = SizeOf(anm)
SystemParametersInfo_(#SPI_GETANIMATION, SizeOf(anm), @anm, 0)
Animflag = anm\iMinAnimate

If Animflag = 1
      anm\iMinAnimate = 0
      SystemParametersInfo_(#SPI_SETANIMATION, SizeOf(anm), @anm, 0)
EndIf
;ShowWindow_(WindowID(0),#SW_MAXIMIZE) 

ButtonGadget(1,10,10,80,25,"Test")

Repeat
  Select WaitWindowEvent()
     
    Case #PB_Event_CloseWindow
            anm\iMinAnimate = Animflag
            SystemParametersInfo_(#SPI_SETANIMATION, SizeOf(anm), @anm, 0)
            Q = 1   
       
    Case #PB_Event_Gadget
        Select EventGadget()
          Case 1
               
        EndSelect
             
  EndSelect
Until Q = 1
Egypt my love
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: Maximize animation on XP

Post by chi »

I was hoping for a more app-wide (rather than system-wide) solution but since it's only buggin' me on XP's maximize animation I can definitely live with that!

:arrow: Thanks a lot RASHAD!
Et cetera is my worst enemy
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4997
Joined: Sun Apr 12, 2009 6:27 am

Re: Maximize animation on XP

Post by RASHAD »

Hi chi
Check the next and report please

Code: Select all

#SC_CLOSE         = $F060
#SC_MAXIMIZE    = $F030
#SC_MINIMIZE    =  $F020
#SC_RESTORE     =  $F120

Procedure WndProc(hwnd, uMsg, wParam, lParam)
      result = #PB_ProcessPureBasicEvents 

 Select uMsg   
   Case #WM_SYSCOMMAND
   Select wParam
         Case #SC_CLOSE,#SC_MAXIMIZE,#SC_MAXIMIZE,#SC_MINIMIZE
                  SendMessage_(WindowID(0),#WM_SETREDRAW,1,0)
    EndSelect         
 EndSelect   
  ProcedureReturn result 
EndProcedure

OpenWindow(0,0,0,100,100,"Test",#PB_Window_SystemMenu| #PB_Window_MinimizeGadget| #PB_Window_MaximizeGadget |#PB_Window_ScreenCentered)

ButtonGadget(1,10,10,80,25,"Test")
SetWindowCallback(@WndProc())
Repeat
  Select WaitWindowEvent()
     
    Case #PB_Event_CloseWindow
      Q = 1  
       
    Case #PB_Event_Gadget
        Select EventGadget()
          Case 1
               
        EndSelect
             
  EndSelect
Until Q = 1
Egypt my love
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: Maximize animation on XP

Post by chi »

Hello and thanks again!

Unfortunately your last example didn't work BUT it led me to DrawAnimatedRects() https://msdn.microsoft.com/en-us/librar ... 85%29.aspx...
I'll let you know if it works ^^

Edit: Nope, not what I expected ;). Guess I'll have to stick with your first solution!
Et cetera is my worst enemy
Post Reply