Skip to content

Instantly share code, notes, and snippets.

@nimdahk
Created September 8, 2011 17:24
Show Gist options
  • Save nimdahk/1204001 to your computer and use it in GitHub Desktop.
Save nimdahk/1204001 to your computer and use it in GitHub Desktop.
AnimateWindow wrapper and demonstration
Gui, Add, Text,, hi`nBye`nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh`n`n`n
Gui, +LastFound
Gui Show, hide
H := WinExist()
AnimateWindow(H, "Center BT Activate")
; Gui Show
return
GuiClose:
AnimateWindow(H, "Hide Slide TB", 100)
ExitApp
; AHK_L AnimateWindow wrapper 6L by nimda
; returns: nonzero on success, false on failure
; MSDN http://msdn.microsoft.com/en-us/library/ms632669(v=vs.85).aspx
; license: WTFPL as published by Sam Hocevar; void of all warranty
AnimateWindow(HWND, Options, t=200){
o := 0, op := {Activate : 0x00020000, Fade : 0x00080000, Center : 0x00000010, Hide : 0x00010000, LR : 0x00000001, RL : 0x00000002, Slide : 0x00040000, TB : 0x00000004, BT : 0x00000008}
List = Activate|Blend|Center|Hide|LR|RL|Slide|TB|BT
Loop Parse, List,|
If InStr(Options, A_LoopField, false)
o |= op[A_LoopField]
return DllCall("AnimateWindow", "UInt", HWND, "Int", t, "UInt", o)
}
@nimdahk
Copy link
Author

nimdahk commented Sep 8, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment