Queener Posted July 21, 2016 Share Posted July 21, 2016 This is the info of the interface: Window Title: Password Safe Class: #32770 Control Class: ToolbarWindow32 Instance: 2 ClassnameNN: ToolbarWindow322 Name: Advanced (Class): [CLASS:ToolbarWindow32; INSTANCE:2] ToolsBar 1: 32003 Make New Database 2: 32002 Open Another Database 3: 32004 Close Database 4: 32005 Save Database 5: 0 6: 32066 Copy Password to Clipboard 7: 32068 Copy Username to Clipboard 8: 32069 Copy Notes to Clipboard 9: 32065 Clear the clipboard contents 10: 0 I wanted to click on 1: 32003 Make New Database. But unfortunately, I'm unable to click on that. Any help is much appreciated. Below are the code I tried: $Title = "Password Safe" $Class = "[CLASS:ToolbarWindow32; INSTANCE:2]" WinWaitActive($Title) Sleep(500) Dim $hWnd = WinGetHandle($Title,"") Dim $hToolBar = ControlGetHandle($hWnd, '', $Class) ConsoleWrite($hWnd & @TAB & $hToolBar & @LF) _GUICtrlToolbar_ClickIndex($hToolBar, 32003) Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Terenz Posted July 21, 2016 Share Posted July 21, 2016 Local $sTitle = "Password Safe" Local $sClass = "[CLASS:ToolbarWindow32; INSTANCE:2]" WinWaitActive($sTitle) Local $hWnd = WinGetHandle($sTitle, "") Local $hToolBar = ControlGetHandle($hWnd, "", $sClass) ConsoleWrite($hWnd & @TAB & $hToolBar & @LF) ControlCommand($hWnd, "", $hToolBar, "SendCommandID", 32003) ; "SendCommandID", Command ID ; Simulates the WM_COMMAND message. Usually used for ToolbarWindow32 controls - use the ToolBar tab of Au3Info to get the Command ID. Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Queener Posted July 22, 2016 Author Share Posted July 22, 2016 nah, that didn't work. Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Terenz Posted July 22, 2016 Share Posted July 22, 2016 Nah, i have test it that before post on a VM and work for that software https://pwsafe.org/ Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Queener Posted July 22, 2016 Author Share Posted July 22, 2016 (edited) I really appreciate the help, but I tested multiple times with no success. Nothing happen when I run the script. EDIT: I'm not sure what's going on, but after I added: #include <MsgBoxConstants.au3> it's working now... scratching my head... Edited July 22, 2016 by Queener Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
AutoBert Posted July 22, 2016 Share Posted July 22, 2016 Dending from Instances of ToolbarWindow32 and the ID on your System it may run or not. Use Au3InfoTool to get the right parameters. 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