Jump to content

Recommended Posts

Posted

hello, i´m currently working on little script with should make the vista sidebar to smth like the max dashboard:

when pressing alt+s , sidebar.exe starts with all my widgets

when pressing alt+c the process will be closed.

the only problem: the sidebar icon keeps in the tray until i move the mouse on it. how can i solve this?

script:

#include <reducemem.au3>

#include <Constants.au3>

Func sidebar()

run(@ProgramFilesDir & "\Windows Sidebar\sidebar.exe")

EndFunc

Func sidebar2()

ProcessClose("sidebar.exe")

EndFunc

while 1

_ReduceMemory()

HotKeySet("!s", "sidebar")

HotKeySet("!c", "sidebar2")

;some other stuff here too

WEnd

Posted

right click tray icon -> left click exit (not alt-shortcut possible)

thats all i know about closeing the sidebar correctly.

i thought about processclose + tray refresh but i think smth like that doesnt exist ^_^

Posted (edited)

You can use Winspector or Spy++ to see which message it sends (which may be constant) and send it to the window or the control. You can also use _GUICtrlToolBar_* to preform a mouse click to show the dialog window and preform another click to click on the exit menu.

Edited by Authenticity
Posted

i never used one of these programms and also i never coded something like that. so i atm have absolutly no clue what you guys are talking about ;)

a programm which spys what happens when i press exit in windows sidebar. And then i can use this somehow in autoit to exit it without clicking on exit.

will dl this programms and try my luck ^_^

thanks

Posted

Requires a little understanding of API and control messages. If you don't have those you can read on MSDN or use the second method of using _GUICtrlToolBar_* functions to click the program tray icon to open the dialog and then just use WinSpy to get something to help you uniquely identify the new dialog characteristics and wait for it to be active... then just Send("{UP}{ENTER}") or something. ;]

Posted

hmm dont really want smth like send/mouseclick as this would rly stop the feeling oh a dashboard ^_^

but i havent check these things yet.. will do it tonight as i´m going into the sun now. if anyone got an example or smth , would rly need it ;)

thx

Posted

#include <GuiButton.au3>
#include <GuiToolBar.au3>

Dim $hToolBar = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', 'ToolbarWindow321')
Dim $hButton = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', 'Button2')

For $i = 0 to _GUICtrlToolbar_ButtonCount($hToolBar)-1
    If StringInStr(_GUICtrlToolbar_GetButtonText($hToolBar, _
            _GUICtrlToolbar_IndexToCommand($hToolBar, $i)), 'vol') Then ExitLoop
Next

_GUICtrlButton_Click($hButton)
_GUICtrlToolbar_ClickIndex($hToolBar, $i, 'right')

WinWait('[W:164; H:40]')
ConsoleWrite('Test' & @LF)

Dim $hMenu = WinGetHandle('[W:164; H:40]')
ControlSend($hMenu, '', '', '+a')

If the size of the menu is not the same which may happen you'll need to wait for [CLASS:#32678] or something.

Posted

Not necessary. It's likely that the right click dialog height and width are constants. The tray icon doesn't need to be anywhere specific because $i will be the index of the tray icon to click on. You can change the loop a little bit to be more correct:

For $i = 0 To _GUICtrlToolbar_ButtonCount($hToolBar)-1
   ; If something Then
   ;    ; Click the toolbar button index and exit the loop.
   ;     ExitLoop
   ; EndIf
   ;....
Next
Posted (edited)

for me it opens the "safely remove hardware" thingy.. hmm

Dim $hToolBar = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', 'ToolbarWindow321')

Dim $hButton = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', 'Button2')

MsgBox(0,"", $hToolBar)

MsgBox(0,"", $hButton )

htoolbar seems to be right but hbutton = empty Edited by aphesia
Posted
^_^ Interesting... and the code is not working? So if it you don't need to expand the toolbar then just remove the code that relating to the button and test again. First do an output loop to see if you can successfully see the toolbar buttons text and if you can it may be necessary to change "vol" in the loop to what you need. What is your OS?
Posted

vista 64 home premium

dont rly knwo what this "vol" even means.

also:

Dim $hButton = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', 'Button2')

MsgBox(0,"", $hButton )

the msgbox is empty

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...