Need some help sticking a gui to a program window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
DarkWisk
Posts: 23
Joined: 17 Jul 2022, 19:38

Need some help sticking a gui to a program window

Post by DarkWisk » 07 Aug 2022, 18:22

Hello I would like to "stick" a gui Like in this post viewtopic.php?t=48236 to a program window of my choosing and then click a button that will log me in to the app/program like xsplit, discord, gmail, etc so that I dont need to have my passwords saved within the apps on my laptop in case I forget my laptop somewhere or it gets stolen. I found another script to encrypt my user/email and passwords. The gui button will prompt me for my master password and input the data that is needed for that app I have everything else programed just need to figure out how to get this gui overlay to stick to a specific program and when I change the info in the script in that post it doesn't work is there a much more simplified way of doing this and if so can someone direct me to it that script is much longer then id like. Can this be done with parent/child making the parent a specific program window and for the gui to follow the program thank you

DarkWisk
Posts: 23
Joined: 17 Jul 2022, 19:38

Re: Need some help sticking a gui to a program window

Post by DarkWisk » 07 Aug 2022, 18:36

I found something similar and changed the code a little for my needs from this post https://www.autohotkey.com/board/topic/95788-set-3rd-party-windows-parent-to-ahk-gui/


Here is my code that i changed from that post but soon as i move the notepad window the gui window inside dissappears i need it to always follow and program window i need it to.

Code: Select all


;Start up notepad, for this example it will become the child window
Run, Notepad.exe,,,pid
WinWait, ahk_pid %pid%   ;wait for a notepad window to exist...
Parent := WinExist("ahk_pid " pid)  ;Get the hwnd, you can also just use a window title here or ahk_class

;Create a gui, and store its hwnd in the variable parent
Gui, +hwndChild ;-Caption +ToolWindow
Gui, color, 0x435181
Gui, Add, Button, w40 h25, Login
Gui, Show, w500 h500

;Set notepad to be the child of our gui
DllCall("SetParent", "ptr", Child, "ptr", Parent)

;Move notepad into view
WinMove, ahk_id %Child%,, 1, 1, 200, 200
return

GuiClose:
  ExitApp
return


esc::
ExitApp



Also I want there to be no -caption and for it to be a +toolwindow
Attachments
Annotation 2022-08-07 163619.png
Annotation 2022-08-07 163619.png (20.37 KiB) Viewed 651 times

User avatar
mikeyww
Posts: 27089
Joined: 09 Sep 2014, 18:38

Re: Need some help sticking a gui to a program window

Post by mikeyww » 07 Aug 2022, 18:38

Hi, you could have a look at the +Owner option for the AHK GUI.

Incidentally, KeePass does everything you described. It is already written and is free of charge. You can also sync to Dropbox or whatever, and use a mobile app on your phone to open the encrypted database. It can use passwords, file keys, or both. I've used it for years, and it logs into my Web sites for me (can work with any program). You can also customize it to recognize certain URLs and type customized key sequences.

Today's Web browsers can sync your passwords, so it doesn't usually matter when you change computers, but I just use KeePass instead.
Last edited by mikeyww on 07 Aug 2022, 18:40, edited 1 time in total.

DarkWisk
Posts: 23
Joined: 17 Jul 2022, 19:38

Re: Need some help sticking a gui to a program window

Post by DarkWisk » 07 Aug 2022, 18:40

Ill check it out thank you for your help. And I would rather keep my data encrypted on my system then trust another company with it

User avatar
mikeyww
Posts: 27089
Joined: 09 Sep 2014, 18:38

Re: Need some help sticking a gui to a program window

Post by mikeyww » 07 Aug 2022, 18:42

KeePass will encrypt your data, and you need not sync it in the cloud if you prefer only local data. Having a file key and a password is strong, because someone would need both to open your database.

Post Reply

Return to “Ask for Help (v1)”