Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; KeePassXC AutoIt3 Script to give the possibility to activate KeePassXC by HotKeySet
- ; Currently tested with Win10 x64 and KeePassXC 2.3.3
- ; CTRL-ALT-k will toggle KeePassXC (if in tray)
- ; if KeePassXC is focused ESC Key will minimize it to Tray
- ;
- ; feel free to improve this script
- ; www.solariz.de
- ;
- #Include <GuiToolBar.au3>
- HotKeySet("^!k", "ShowKeePassXC") ; Ctrl-Alt-k
- HotKeySet("{Esc}", "captureEsc")
- While 1
- Sleep(500)
- WEnd
- func captureEsc()
- ; if KeePassXC is focused toggle window minimize
- if StringInStr(WinGetTitle("[ACTIVE]"),"KeePassXC") Then
- ShowKeePassXC()
- EndIf
- EndFunc
- func ShowKeePassXC()
- $hSysTray = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Text:User Promoted Notification Area]');
- For $i = 1 To _GUICtrlToolbar_ButtonCount($hSystray)
- ; KeePassXC do not set a button text so we need to use some trick
- $sCurrent = _GUICtrlToolbar_GetButtonText($hSystray,$i)
- if $sCurrent = "" Then
- $sCurrent = _GUICtrlToolbar_GetButtonBitmap($hSystray,$i)
- ;ConsoleWrite($i & ": " & $sCurrent & @CRLF)
- If $sCurrent = 13 Then
- _GUICtrlToolbar_ClickButton($hSystray, $i, "left")
- WinWaitActive("[CLASS:Qt5QWindowIcon]", "")
- send("^f")
- ExitLoop
- EndIf
- EndIf
- Next
- EndFunc
Add Comment
Please, Sign In to add comment