hot202 Posted February 9, 2010 Share Posted February 9, 2010 hi how do i tell if the taskbar is at the top or bottom or left or right i can only know if its on the bottom or left. Opt('WINTITLEMATCHMODE', 4) $pos = ControlGetPos("classname=Shell_TrayWnd", "", "ToolbarWindow322") Switch $pos[0] case 66 ;bottom Case 0 ;left EndSwitch Link to comment Share on other sites More sharing options...
Xand3r Posted February 9, 2010 Share Posted February 9, 2010 Func task_get_pos() $pos = WinGetPos("[CLASS:Shell_TrayWnd]") If $pos[0]<>0 Then Return 3 ; right side If $pos[1] = 0 Then If $pos[2] = @DesktopWidth Then Return 4 ; top Else Return 1 ; left EndIf EndIf Return 2 ; bottom EndFunc Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
hot202 Posted February 9, 2010 Author Share Posted February 9, 2010 thanks but that dont seem to work its just coming up with 3 all the time in a msg box even when imove the task bar Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 9, 2010 Moderators Share Posted February 9, 2010 hot202, This function has found the TaskBar successfully for me and the many others to whom I have given it: expandcollapse popupConsoleWrite(Find_Taskbar() & @CRLF) Func Find_Taskbar() ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0, "") ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] Then Return "Bottom Hidden" Else Return "Bottom" EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT If $aTaskBar_Pos[0] > @DesktopWidth - $aTaskBar_Pos[2] Then Return "Right Hidden" Else Return "Right" EndIf ElseIf $aTaskBar_Pos[2] = @DesktopWidth Then ; Taskbar at TOP If $aTaskBar_Pos[1] < 0 Then Return "Top Hidden" Else Return "Top" EndIf ElseIf $aTaskBar_Pos[3] = @DesktopHeight Then ; Taskbar at LEFT If $aTaskBar_Pos[0] < 0 Then Return "Left Hidden" Else Return "Left" EndIf EndIf EndFunc  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
hot202 Posted February 9, 2010 Author Share Posted February 9, 2010 still have probs with that its finding it on the bottom but says (bottom hidden) same as on the right it works but says its hidden. When its on the top or left it just shows 0 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2010 Moderators Share Posted February 10, 2010 hot202,Use the Au3 Window Info tool to check your taskbar is actually meets the "classname=Shell_TrayWnd" criteria - although I have yet to meet one that does not.What OS are you using?M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
hot202 Posted February 10, 2010 Author Share Posted February 10, 2010 im using win xp. its on a asus eee900 pc so it has a small screen would that have anything to dowith it? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2010 Moderators Share Posted February 10, 2010 hot202,I have no idea. Could you please post the exact script you are trying to use (unless it is the one I posted above!) and then run this short script from SciTE and post what appears in the SciTE console (the bit at the bottom of the SciTE window).ConsoleWrite("Width = " & @DesktopWidth & @CRLF & "Height = " & @DesktopHeight & @CRLF)And have you checked your Taskbar with the Au3 Window Info tool to see if it is a Shell_TrayWnd?M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
hot202 Posted February 10, 2010 Author Share Posted February 10, 2010 i used your script above. and this is what i got with that other thing u asked Width = 1024 Height = 600 and yesi used the info tool and the class was Shell_trayWnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2010 Moderators Share Posted February 10, 2010 hot202,Well, at least the script can use the @DeskTop* macros to read your screen size - not that I thought it could not. Next step, move your task bar to the 4 edges of the screen, run this script each time and tell me what it says:Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) If IsArray($aTaskBar_Pos) Then ConsoleWrite($aTaskBar_Pos[0] & " - " & $aTaskBar_Pos[1] & " - " & $aTaskBar_Pos[2] & " - " & $aTaskBar_Pos[3] & @CRLF) Else ConsoleWrite("Not Found" & @CRLF) EndIfPlease add where your TaskBar was each time (i.e Bottom, Left, Top, Right) so I can see what results come from where. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
hot202 Posted February 10, 2010 Author Share Posted February 10, 2010 bottom = -2 - 572 - 1028 - 30 top = -2 - -2 - 1028 - 30 left = -2 - -2 - 60 - 604 right = 966 - -2 - 60 - 604 ( that was black text the other ones were orange) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2010 Moderators Share Posted February 10, 2010 hot202, Interesting, your taskbar overlaps the screen by 2 pixels in all directions - every other one I have seen fits into the corners! But now that we know about it, try this script - I think I have got the corrections the right way round! expandcollapse popupConsoleWrite(Find_Taskbar() & @CRLF) Func Find_Taskbar() ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0, "") ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] + 2 Then Return "Bottom Hidden" Else Return "Bottom" EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT If $aTaskBar_Pos[0] > @DesktopWidth - $aTaskBar_Pos[2] + 2 Then Return "Right Hidden" Else Return "Right" EndIf ElseIf $aTaskBar_Pos[2] = @DesktopWidth + 4 Then ; Taskbar at TOP If $aTaskBar_Pos[1] < -2 Then Return "Top Hidden" Else Return "Top" EndIf ElseIf $aTaskBar_Pos[3] = @DesktopHeight + 4 Then ; Taskbar at LEFT If $aTaskBar_Pos[0] < -2 Then Return "Left Hidden" Else Return "Left" EndIf EndIf EndFunc By the way, the different colours in the SciTE console are nothing to do with the taskbar - it al depends on the leading character of the string being written. Try running this: ConsoleWrite('! = Red' & @LF) ConsoleWrite('> = Blue' & @LF) ConsoleWrite('- = Orange' & @LF) ConsoleWrite('+ = Green' & @LF) ConsoleWrite('(5) : = Red (jump to line 5 when double-clicked)' & @LF) ConsoleWrite('Start with String or Integer then ' & @TAB & '6' & ' = Pink (jump to line 6 when double-clicked)' & @LF) ; ; ConsoleWrite('(' & @ScriptLineNumber & ') : = Red (jump to line ' & @ScriptLineNumber & ' when double-clicked)' & @CRLF) It is very useful to highlight various lines within the output. And do try double-clicking on the lines - the jumps do work. And you will be pleased to know that the last bit of SciTE knowledge comes at no extra charge to the fee I will be charging you in due course. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
hot202 Posted February 10, 2010 Author Share Posted February 10, 2010 omg thanks heaps:) that worked and thanks 4 the extra help with the colour stuff so if i use the taskbar script that works 4 my computer on a diff computer it will get messed up like it was happining to me before? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2010 Moderators Share Posted February 10, 2010 hot202, You are correct - the new version only works on a TaskBar like yours. Perhaps you are unique in the world? Actually I think it is more a function of the NetBook you are using. I will try and produce a universal script this afternoon. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2010 Moderators Share Posted February 10, 2010 hot202,This works on my "normal" TaskBar - try it on your "abnormal" one. expandcollapse popupConsoleWrite(Find_Taskbar() & @CRLF) Func Find_Taskbar() ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0, "") ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] + 2 Then Return "Bottom Hidden" Else Return "Bottom" EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT If $aTaskBar_Pos[0] > @DesktopWidth - $aTaskBar_Pos[2] + 2 Then Return "Right Hidden" Else Return "Right" EndIf ElseIf $aTaskBar_Pos[2] >= @DesktopWidth Then ; Taskbar at TOP If $aTaskBar_Pos[1] < -2 Then Return "Top Hidden" Else Return "Top" EndIf ElseIf $aTaskBar_Pos[3] >= @DesktopHeight Then ; Taskbar at LEFT If $aTaskBar_Pos[0] < -2 Then Return "Left Hidden" Else Return "Left" EndIf EndIf EndFuncLet me know if you run into any problems on other machines from now on. If you do run across any more ill-behaved TaskBars that do not give the correct response, it would be very helpful to have the same info that I asked you for earlier so I can see where it is actually placed. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
hot202 Posted February 11, 2010 Author Share Posted February 11, 2010 that 1 worked on mine to. U r so smart thanks heaps Link to comment Share on other sites More sharing options...
ivan Posted October 13, 2010 Share Posted October 13, 2010 hot202, This works on my "normal" TaskBar - try it on your "abnormal" one. expandcollapse popupConsoleWrite(Find_Taskbar() & @CRLF) Func Find_Taskbar() ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0, "") ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] + 2 Then Return "Bottom Hidden" Else Return "Bottom" EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT If $aTaskBar_Pos[0] > @DesktopWidth - $aTaskBar_Pos[2] + 2 Then Return "Right Hidden" Else Return "Right" EndIf ElseIf $aTaskBar_Pos[2] >= @DesktopWidth Then ; Taskbar at TOP If $aTaskBar_Pos[1] < -2 Then Return "Top Hidden" Else Return "Top" EndIf ElseIf $aTaskBar_Pos[3] >= @DesktopHeight Then ; Taskbar at LEFT If $aTaskBar_Pos[0] < -2 Then Return "Left Hidden" Else Return "Left" EndIf EndIf EndFunc Let me know if you run into any problems on other machines from now on. If you do run across any more ill-behaved TaskBars that do not give the correct response, it would be very helpful to have the same info that I asked you for earlier so I can see where it is actually placed. M23 I had a similar issue, but your solution worked. I needed the taskbar position, though, so I modified your function a little: expandcollapse popupLocal $aTaskBar_Pos = Find_Taskbar() If @error Then Exit Local $TaskBarInfo ="" For $i=0 To UBound($aTaskBar_Pos)-1 Step 1 $TaskBarInfo &=$aTaskBar_Pos[$i]&@CRLF Next MsgBox(0,'TaskBarInfo',$TaskBarInfo) Func Find_Taskbar() Dim $aTaskBarPos[5] ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0, "") ; Determine position of taskbar Select Case $aTaskBar_Pos[1] > 0 ; TaskBar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] + 2 Then $aTaskBarPos[0] = "Bottom Hidden" Else $aTaskBarPos[0] = "Bottom" EndIf Case $aTaskBar_Pos[0] > 0 ; TaskBar at RIGHT If $aTaskBar_Pos[0] > @DesktopWidth - $aTaskBar_Pos[2] + 2 Then $aTaskBarPos[0] = "Right Hidden" Else $aTaskBarPos[0] = "Right" EndIf Case $aTaskBar_Pos[2] >= @DesktopWidth ; TaskBar at TOP If $aTaskBar_Pos[1] < -2 Then $aTaskBarPos[0] = "Top Hidden" Else $aTaskBarPos[0] = "Top" EndIf Case $aTaskBar_Pos[3] >= @DesktopHeight ; TaskBar at LEFT If $aTaskBar_Pos[0] < -2 Then $aTaskBarPos[0] = "Left Hidden" Else $aTaskBarPos[0] = "Left" EndIf EndSelect For $i=0 To UBound($aTaskBar_Pos)-1 Step 1 $aTaskBarPos[$i+1]=$aTaskBar_Pos[$i] Next Return $aTaskBarPos EndFunc ;==>GetTaskbarPos Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
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