Sign in to follow this  
Followers 0
Queener

Click on Toolbar icon

6 posts in this topic

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.")

Share this post


Link to post
Share on other sites



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

 

Share this post


Link to post
Share on other sites

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.")

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 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.")

Share this post


Link to post
Share on other sites

Dending from Instances of ToolbarWindow32 and the ID on your System it may run or not. Use Au3InfoTool to get the right parameters.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Similar Content

    • OtenMoten
      By OtenMoten
      Hello dear community,
       
      definitely I need external help now. I've did all 'ControlClick() - Tutorials' and read a lot of topics about interaction betweend AutoIT and external programs.
      The most of them are about "Clicking a button ...". In my case it's different because I need to click a specific element within the program.
       
      The 'program' what I am talking about is called Mendeley. It's library software for documents administration.
       
      In the attachements in picture '1.jpg' you can see the red marked Help element. 
      In the picture '2.jpg' you see the context menu of the Help element. This is what I'm trying to do with the ControlClick() function.
       
      Following I represent my code which not worked for me:
      #include <MsgBoxConstants.au3> Opt("WinTitleMatchMode", 2) $hWnd = WinGetHandle("Mendeley Desktop", "") MsgBox($MB_SYSTEMMODAL, "handle check", $hWnd) ControlClick($hWnd, "Mendeley Desktop", "Help") The MsgBox tells me the number of the handle of the Mendeley window. It's not 0 so for me it means the window is recognized correctly.
       
      When I'm execute the script the Help element is not clicked.
      Any suggestions for me?
       
      Kind regards
      OtenMoten


    • WoodGrain
      By WoodGrain
      Hi All,
      I'm using UseTraySetIcon("shell32.dll", xx) to set my tray icon to a specific icon while running, is there a way I can specify this icon when I compile my script into an exe so my exe icon is the same?
      Thanks!
    • nacerbaaziz
      By nacerbaaziz
      Hi guys
      I have an inquiry please
      I want an example of how to add an icon file to the compiled autoit file and how to use it in GUICtrlCreateIcon
      Preferably in a separate list within the resourceFor example myIcons
      I hope my request is clear and I hope you will help me solve this problem
      Because I found an example in the help files but I did not understand the method well
    • boy233
      By boy233
      I need to click on the text "Batch submission" but I can not!
      <div class="batchmenu2" onclick="Go('/lot/')" style="background-color: rgb(255, 255, 255);"> <span class="iconep">l</span> <div class="menu"> <b>Batch submission</b> <br> Bulk messages via file </div> </div> How could I do it?
      How can I click the specific OnClick?
       
    • SkysLastChance
      By SkysLastChance
      <input name="VsMasterPage$MainContent$LoginUserControl$LoginForm$FormsAuthLoginContainer$LoginButton$InternalButton" class="Button" id="VsMasterPage_MainContent_LoginUserControl_LoginForm_FormsAuthLoginContainer_LoginButton_InternalButton" onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("VsMasterPage$MainContent$LoginUserControl$LoginForm$FormsAuthLoginContainer$LoginButton$InternalButton", "", true, "Login", "", false, false))' type="submit" value="Sign In"> I am trying to click the sign in button on this page. 
      I have tried by class, text, etc 
      Here was my last attempt
      $oButtons = _IETagNameAllGetCollection($o_IE, "button") For $oButton in $oButtons If String($oButton.value) = "Sign In" Then Sleep (1000) _IEAction($oButton, "click") ExitLoop EndIf Next This did not work either.