apollo13 Posted July 27, 2012 Author Posted July 27, 2012 The height of taskbar with default size have the same number of pixels under Win7 and WinXP and for all screen resolutions? (24 pixel on Bottom and Top / 48 pixel Left Right position of taskbar) or i must use @height and @width to compare if its dimension is more that default therefore comeback to default size?
apollo13 Posted July 27, 2012 Author Posted July 27, 2012 (edited) Thinking.. Only in my case is 24 and 48 pixels but if i change desktop aspect i can increase all parametres of borders … therefore how i can know how is the default dimension of taskbar if i increase it and i want to comeback to small default dimension?? Edited July 27, 2012 by apollo13
apollo13 Posted July 28, 2012 Author Posted July 28, 2012 I come back to home, and i proved your script. It works very well and mouse go in central of clock using whichever position of taskbar that i want. Unfortunately I have tried to complete script, (that i have inserted to the end of this post), adding what i want to do but i have proved so lot times that i lose every hope. Is more than 4 hours that i proved and i'm thinking for solutions but nothing to do. I have hoped, for every position of taskbar in the screen (Left, Top, Right, Bottom), to do this: - If i increase height dimension of TaskBar and i run script, program bring-back the dimension to default small dimension - If Taskbar have default height dimension then program "MouseClickDrag" on clock position the taskbar to reduce its dimension to zero in order to hide it. - If taskbar have zero dimension therefore is hide, then program "MouseClickDrag" on clock position and bring-back the dimension to default small dimension (Visible) but i don't have sufficient knowledge of AutoIT also if for little script as this. :-((( Forum's people is been very gentile to help me but also if with their big help i can't complete script. My script attached, runs but very badly, using always same settings of screen aspect and dimension of characheters. If i change something don't run and i have proved also using BOTTOM and TOP position. ; ----------------- Begin your perfect script ----------------- Global $_Positions[4]=["Left","Top","Right","Bottom"] Global $tag_AppBarData="LONG;HWND;INT;INT;STRUCT;INT;INT;INT;INT;ENDSTRUCT" Func GetTaskBarDockedEdge() Local $ABM_GETTASKBARPOS=0x00000005 Local $pData=DllStructCreate($tag_AppBarData) DllStructSetData($pData,1,DllStructGetSize($pData)) DllStructSetData($pData,2,WinGetHandle("[CLASS:Shell_TrayWnd]","")) Local $aResult=DllCall("Shell32.dll","BOOL","SHAppBarMessage","DWORD",$ABM_GETTASKBARPOS,"ptr",DllStructGetPtr($pData)) If @error Then Return SetError(@error,0,-1) If Not $aResult[0] Then Return SetError($aResult[0],0,-2) Return SetError(0,0,DllStructGetData($pData,4)) EndFunc Local $_Struct=GetTaskBarDockedEdge() ConsoleWrite("Taskbar Position - Docked at "&$_Positions[$_Struct]&@CR&"--------"&@CR) $aPosHwnd = WinGetPos("[CLASS:Shell_TrayWnd]") $aPosCtrl = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:TrayClockWClass; INSTANCE:1]") ; ----------------- End of your perfect script ------------------- ; ////// adding my awful script ////// Select Case $_Struct=0 ; -- LEFT Position -- $xBorderClock=-$aPosHwnd[0] + $aPosCtrl[0]*2 + $aPosCtrl[2] $yBorderClock=$aPosHwnd[1] + $aPosCtrl[1] + $aPosCtrl[3] / 2 Case $_Struct=1 ; -- TOP Position -- $xBorderClock=$aPosHwnd[0] + $aPosCtrl[0] + $aPosCtrl[2] / 2 $yBorderClock=-$aPosHwnd[1] + $aPosCtrl[1]*2 + $aPosCtrl[3] if $yBorderClock=24 then MouseClickDrag("left", $xBorderClock, $yBorderClock, $xBorderClock, $yBorderClock-24, 2) else $correction=0 if $yBorderClock<10 then $correction=-2 MouseClickDrag("left", $xBorderClock, $yBorderClock+$correction, $xBorderClock, 24, 2) endif Case $_Struct=2 ; -- RIGHT Position -- $xBorderClock=$aPosHwnd[0] $yBorderClock=$aPosHwnd[1] + $aPosCtrl[1] + $aPosCtrl[3] / 2 Case $_Struct=3 ; -- BOTTOM Position -- $xBorderClock=$aPosHwnd[0] + $aPosCtrl[0] + $aPosCtrl[2] / 2 $yBorderClock=$aPosHwnd[1] if $yBorderClock=@Desktopheight-28 then MouseClickDrag("left", $xBorderClock, $yBorderClock, $xBorderClock, $yBorderClock+24, 2) else MouseClickDrag("left", $xBorderClock, $yBorderClock, $xBorderClock, @Desktopheight-24, 2) endif Endselect ==================================================================== If i use fix quote and i never change Windows aspect, the follow script runs under my XP virtualized, also if with Taskbar only on bottom and infinite other limitation compared with original project. #NoTrayIcon #include <Misc.au3> If _Singleton("Bar", 1) = 0 Then MouseClickDrag("left", 1000, 737, 1000, 713, 2) ; Visible TaskBar -using Mouse Double click- Processclose("TaskBar.exe") exit EndIf MouseClickDrag("left", 1000, 713, 1000, 737, 2) ; Hide TaskBar While 1 sleep(1000) wend
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