aslani Posted May 19, 2008 Posted May 19, 2008 Is it posible to sticky the UI to the active window? I've created a UI that have all the data entry commands as a button and it will be very helpful to have it attached at the bottom of the active window...only if it's posible. Thanks is advance. [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version
monoceres Posted May 19, 2008 Posted May 19, 2008 This should get you started, it snaps window to the screens edges #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Opt("GUiOnEventMode", 1) GUICreate("test", 300, 300) GUISetState() GUISetOnEvent(-3, "close") GUIRegisterMsg($WM_MOVE, "moved") While 1 Sleep(100) WEnd Func close() Exit EndFunc ;==>close Func moved() $pos = WinGetPos("test") If $pos[0] < 25 Then WinMove("test", "", 0, $pos[1]) If $pos[1] < 25 Then WinMove("test", "", $pos[0], 0) If $pos[0] + 300 > @DesktopWidth - 25 Then WinMove("test", "", @DesktopWidth - 300, $pos[1]) If $pos[1] + 300 > @DesktopHeight - 25 Then WinMove("test", "", $pos[0], @DesktopHeight - 300) Return $GUI_RUNDEFMSG EndFunc ;==>moved Good Luck! Broken link? PM me and I'll send you the file!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now