Cyote101 Posted February 28, 2008 Posted February 28, 2008 Hello, I have a question. I have made a toolbar for another program, I would like to know how i would create the following behavior of the toolbar 1. When application/Window "TPS REPORT" is maximized, visible to the user, so is "Extras" 2. when application/window "TPS Report" is minimized so is "extras" 3. When application/window "TPS Report" is closed so is "Extras" I would also like to know what I could do to make it so the Extras window is centered to TPS Report, but can be moved up and down, not side to side. I plan to have the toolbar program start this application, the one i'm now looking to make. Thanks,
FreeFry Posted February 28, 2008 Posted February 28, 2008 This could be achieved with WinMove, WinGetState, and WinExist. WinGetState, and WinExist for the First, Second, and Third behaviours, and WinMove for the centering behaviour..
Cyote101 Posted February 29, 2008 Author Posted February 29, 2008 Thanks, Perfect! Would you know what I could do to make it so the bottom of my Extras window rests 30 pixals from the bottom of the screen? Thanks
FreeFry Posted February 29, 2008 Posted February 29, 2008 Read about the WinMove function in the helpfile...
Moderators SmOke_N Posted March 15, 2008 Moderators Posted March 15, 2008 (edited) Thanks, Perfect! Would you know what I could do to make it so the bottom of my Extras window rests 30 pixals from the bottom of the screen? ThanksWhen you say "30 pixels", I'm going to assume you want it on top of your toolbar. Mine is 60+ so I'd suggest maybe doing something like:$hgui = GUICreate("") GUISetState() Sleep(2000) _WinMoveToolBarTop($hgui);No 2nd param for current x position Sleep(2000) _WinMoveToolBarTop($hgui, 50) Sleep(2000) Func _WinMoveToolBarTop($hWnd, $nXCoord = False) Local $aWPos = WinGetPos($hWnd) Local $aCPos = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "ToolbarWindow321") If IsArray($aWPos) = 0 OR IsArray($aCPos) = 0 Then Return SetError(1, 0, 0) If $nXCoord Then Return WinMove($hWnd, "", $nXCoord, (@DesktopHeight - $aWPos[3]) - ($aCpos[3] + 5)) Return WinMove($hWnd, "", $aWPos[0], (@DesktopHeight - $aWPos[3]) - ($aCpos[3] + 5)) EndFuncIf I am in fact correct in my assumption. Edited March 15, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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