Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AnimateWindow() - easier than ever


  • Please log in to reply
6 replies to this topic
HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
I know there are already several examples for AnimateWindow.

Anyway this might be much easier to use, especially for beginners
AnimateWindow(id,delay,options)

Thanks infogulch for your great examples
AnimateWindow - DllCall Test Script with Code Generator

Easily include the one of the following character in options.

A=ACTIVATE
H=HIDE

C=CENTER
B=BLEND
S=SLIDE
- For slide effect include SD for slide down, SU=Up
- SR to slide from left to right, SL=right to left

For example:


Gui,+LastFound
GuiID:=WinExist()
Gui,Show, Hide Center w200 h200
AnimateWindow(hwnd, 1000,"BA")
sleep, 1000
AnimateWindow(hwnd, 1000,"BH")
sleep, 1000
AnimateWindow(hwnd,1000,"SLA")
sleep, 1000
AnimateWindow(hwnd,1000,"SRH")



options=C|B|SD|SU|SL|SR|SRD|SLU
delay=1000
Loop
Loop,Parse,options,|
{
AnimateWindow(GuiID,delay,A_LoopField . "A")
Sleep, %delay%
AnimateWindow(GuiID,delay,A_LoopField . "H")
Sleep, %delay%
}
GuiClose:
ExitApp

AnimateWindow(hwnd,time,options){
    local H:=0x10000, A:=0x20000,C:=0x10, B:= 0x80000,S:=0x40000,R:= 0x1, L:=0x2, D:=0x4, U:=0x8,O:="HACBSLURD",opt:="",format:=""
    format:= A_FormatInteger
    SetFormat, integerfast, Hex
    opt := 0x0 + 0
    Loop,parse,Options
        If InStr(O,A_LoopField)
            opt |= %A_LoopField%
    If opt
        DllCall("AnimateWindow", "UInt", hwnd, "Int", time, "UInt", opt)
    SetFormat, integerfast,%format%
}
; AHK 1.0.48.00
AnimateWindow(hwnd,time,options) {
   Static H:=0x10000, A:=0x20000, C:=0x10, B:=0x80000, S:=0x40000, R:=0x1
   Static L:=0x2, D:=0x4, U:=0x8, O:="HACBSLURD"
   Loop,Parse,options
      If InStr(O,A_LoopField)
         opt+=(%A_LoopField%)
   If opt
      DllCall("AnimateWindow", "UInt", hwnd, "Int", time, "UInt", opt)
}


Drugwash
  • Members
  • 1078 posts
  • Last active: May 24 2016 04:20 PM
  • Joined: 07 Sep 2008
The 'Blend' option doesn't work in Win98SE (good to know for function documentation). Everything else is OK.
Thank you!

(AHK 1.0.48.05 and Win98SE) forever | My scripts are here


webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005
What are the 'A' and 'H' representing ?

How do I get this effect: "0x00050001"
________
WINNING INTERN

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

The 'Blend' option doesn't work in Win98SE (good to know for function documentation)


Thanks for reporting :wink:

@ webber

Sorry, forgotten to mention these :)

"A" means activate, "H" stands for hide.

"0x00050001" would be HSR (Hide Slide Right)

Matas
  • Members
  • 49 posts
  • Last active: Mar 12 2010 07:29 PM
  • Joined: 07 Mar 2009
It seems that in vista it have some problems

webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005
this sample helped me see some of the coding effects relative to letter combos


Gui,+LastFound
GuiID:=WinExist()
Gui,Show, Center w200 h200

Gui,Hide
	msgbox, Next demo is BA
	sleep, 1000
	AnimateWindow(GuiID, 1000,"BA")
Gui,Show
	msgbox, Next demo is BH
	sleep, 1000
	AnimateWindow(GuiID, 1000,"BH")
Gui,Hide
	msgbox, Next demo is SLA
	sleep, 1000
	AnimateWindow(GuiID,1000,"SLA")
Gui,Show
	msgbox, Next demo is SRH
	sleep, 1000
	AnimateWindow(GuiID,1000,"SRH") 


ExitApp  
________
Fix Ps3

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
You can also use ASLD and HSRU :!:
Gui,+LastFound
GuiID:=WinExist()
Gui,Show, Hide Center w200 h200

   msgbox, Next demo is ASLD
   AnimateWindow(GuiID, 1000,"ASLD")
   msgbox, Next demo is HSRU
   AnimateWindow(GuiID, 1000,"HSRU")