GaryFrost Posted December 11, 2007 Share Posted December 11, 2007 In my search for information on the pager control (apparently not widely used except in windows itself) I ran across some old vb code. I converted it to autoit and got it working on my XP machines (only tested on XP) expandcollapse popup#include <WinAPI.au3> ;~ #include <WindowsConstants.au3> Global Const $SW_HIDE = 0 Global Const $SW_SHOW = 5 _ShowTaskBar(False) Sleep ( 2000 ) _ShowTaskBar() _ShowStartButton(False) Sleep ( 2000 ) _ShowStartButton() _ShowTaskBarClock(False) Sleep ( 2000 ) _ShowTaskBarClock() _ShowTaskBarIcons(False) Sleep ( 2000 ) _ShowTaskBarIcons() For $x = 1 To _TaskBarIndexCount() _ShowProgramsShowingInTaskBar(False, $x) Sleep(2000) _ShowProgramsShowingInTaskBar(True, $x) Next Func _ShowTaskBar($fShow = True) Local $hTaskBar $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "") If $fShow Then _WinAPI_ShowWindow($hTaskBar, $SW_SHOW) Else _WinAPI_ShowWindow($hTaskBar, $SW_HIDE) EndIf EndFunc ;==>_ShowTaskBar Func _ShowStartButton($fShow = True) Local $hTaskBar, $hStartButton $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "") $hStartButton = ControlGetHandle($hTaskBar, "", "Button1") If $fShow Then _WinAPI_ShowWindow($hStartButton, $SW_SHOW) Else _WinAPI_ShowWindow($hStartButton, $SW_HIDE) EndIf EndFunc ;==>_ShowStartButton Func _ShowTaskBarClock($fShow = True) Local $hTaskBar, $hParent, $hClock $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "") $hParent = ControlGetHandle($hTaskBar, "", "TrayNotifyWnd1") $hClock = ControlGetHandle($hParent, "", "TrayClockWClass1") If $fShow Then _WinAPI_ShowWindow($hClock, $SW_SHOW) Else _WinAPI_ShowWindow($hClock, $SW_HIDE) EndIf EndFunc ;==>_ShowTaskBarClock Func _ShowTaskBarIcons($fShow = True) Local $hTaskBar, $hParent, $hChild $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "") $hParent = ControlGetHandle($hTaskBar, "", "TrayNotifyWnd1") $hChild = ControlGetHandle($hParent, "", "ToolbarWindow321") If $fShow Then _WinAPI_ShowWindow($hChild, $SW_SHOW) Else _WinAPI_ShowWindow($hChild, $SW_HIDE) EndIf EndFunc ;==>_ShowTaskBarIcons Func _ShowProgramsShowingInTaskBar($fShow = True, $iIndex = 1) Local $hTaskBar, $hRebar, $hToolBar $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "") $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321") $hToolBar = ControlGetHandle($hRebar, "", "ToolbarWindow32" & $iIndex) If $hToolBar <> 0x00000000 Then If $fShow Then _WinAPI_ShowWindow($hToolBar, $SW_SHOW) Else _WinAPI_ShowWindow($hToolBar, $SW_HIDE) EndIf EndIf EndFunc ;==>_ShowProgramsShowingInTaskBar Func _TaskBarIndexCount() Local $hTaskBar, $hRebar, $hToolBar, $iCount = 0 $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "") $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321") While 1 $hToolBar = ControlGetHandle($hRebar, "", "ToolbarWindow32" & $iCount + 1) If $hToolBar = 0x00000000 Then ExitLoop $iCount += 1 WEnd Return $iCount EndFunc ;==>_ShowProgramsShowingInTaskBar SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
ResNullius Posted December 12, 2007 Share Posted December 12, 2007 Cool Gary! I can verify all functions working on Win 2000 also. Link to comment Share on other sites More sharing options...
BrettF Posted December 12, 2007 Share Posted December 12, 2007 LOL! Thats awesome! Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Achilles Posted December 12, 2007 Share Posted December 12, 2007 Sweet! I might already have a use for this... I'll give you credit if I do. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
thomaatje Posted December 12, 2007 Share Posted December 12, 2007 Cool! Link to comment Share on other sites More sharing options...
james3mg Posted December 12, 2007 Share Posted December 12, 2007 (edited) Everything works on Vista too, except the Start orb is not hidden in the second demo. Anything where you found this code about rearranging the TaskBarIcons, rather than just showing/hiding them? Or showing/hiding a single particular TaskBarIcon?Cool stuff ThanksEdit: misread a bit of your code. The TaskBarIcons() functions don't work either (it only hides the arrow that allows you to see the 'hidden' icons), and I mistook ProgramsShowingInTaskbar for TaskBarIcons. And your code answered the question I was trying to get at (I think)...hiding a particular program's taskbar task button (for instance, the AutoIt Help window's button that can minimize and restore the window). But in Vista, there's apparently only 1 ProgramShowingInTaskbar - calling _ShowProgramsShowingInTaskbar(False,1) hides all of the programs, not just the 'first' one. But maybe I misunderstood the code.Again, thanks. Fun Stuff! Edited December 12, 2007 by james3mg "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110 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