Jump to content

Keepass AutoType Send to GUICtrlCreateEdit


Recommended Posts

I've been unsuccessful in being able to send Keepass AutoType strings over to a GUICtrlCreateEdit field.  I'm not adding any optional settings so maybe that is why, but I don't know which one(s) I should add if they are necessary.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$sInputText = ""
#Region ### START Koda GUI section ### Form=
$FormSendText = GUICreate("Text To Window", 634, 353, 192, 124)
$EditString = GUICtrlCreateEdit("", 8, 24, 601, 273)
GUICtrlSetData(-1, "")
$ButtonSend = GUICtrlCreateButton("Send Now", 264, 312, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $ButtonSend
            $sInputText = GUICtrlRead($EditString)
            SendTextToWindow($sInputText)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

; The SendTextToWindow() function is not included since it is beyond the scope of the question.

Keepass Autotype sets focus to the target window, but the GUICtrlCreateEdit field doesn't appear to accept it.

Link to comment
Share on other sites

I use KeePass, and in my experience its AutoType feature doesn't set focus itself to anything. One has to manually put the cursor where one wants AutoType to autotype, unless of course it's already where you want it.

If I run this bit of your modified code, then invoke AutoType, Keepass will autotype whatever entry it's on.

#Region ### START Koda GUI section ###
$FormSendText = GUICreate("Text To Window", 634, 353, 192, 124)
$EditString = GUICtrlCreateEdit("", 8, 24, 601, 273)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Sleep(100)
WEnd

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

I've seen some KeePass related scripts on the forum. One is KeeForm to send data to websites. Maybe you can find something that fits your needs.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

×
×
  • Create New...