Hide the AHK icon on InputBox dialogs

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
HBinswanger
Posts: 17
Joined: 14 Feb 2016, 00:45

Hide the AHK icon on InputBox dialogs

Post by HBinswanger » 04 Jul 2019, 17:39

I want to get user input without the user knowing that AHK is involved, for security reasons. Using InputBox, I can set the title to be innocuous but how do I get rid of or change the H icon? I have Resource Hacker, so maybe you can tell me what to change in that to get this effect. Thanks.
Last edited by HBinswanger on 04 Jul 2019, 17:52, edited 1 time in total.

gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Hide the AHK icon on InputBox dialogs

Post by gregster » 04 Jul 2019, 17:48

HBinswanger wrote:
04 Jul 2019, 17:39
I want to get user input without the user knowing that AHK is involved, for security reasons.
Sounds odd and rather like a potential security risk/problem for the user than for you. What is the reason to hide AHK from the user?

Anyway, there is https://www.autohotkey.com/docs/commands/Menu.htm#NoIcon and https://www.autohotkey.com/docs/commands/_NoTrayIcon.htm

HBinswanger
Posts: 17
Joined: 14 Feb 2016, 00:45

Re: Hide the AHK icon on InputBox dialogs

Post by HBinswanger » 04 Jul 2019, 17:55

I'm using AHK to run a python script that will manufacture a password for me, and if someone gets my computer, figures out that the code is in AHK (which is dead easy to do, because the same H icon is in the tray--so he just needs to right-click and do "Edit this script") then he will have the key for ALL the passwords I will make using this script. Paranoid? A little.

HBinswanger
Posts: 17
Joined: 14 Feb 2016, 00:45

Re: Hide the AHK icon on InputBox dialogs

Post by HBinswanger » 04 Jul 2019, 18:04

Thanks for the NoIcon reference. Looks great, but I can't figure out how to use Menu to control InputBox. Is that possible? Or do I have to make a GUI control to get an input field that has no H icon?

gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Hide the AHK icon on InputBox dialogs

Post by gregster » 04 Jul 2019, 18:14

I see. Like this?

Code: Select all

#NoTrayIcon	; hides tray icon
Menu, Tray, Icon, Shell32.dll, 174	; also changes Inputbox icon
inputbox, var
https://www.autohotkey.com/docs/commands/Menu.htm#Icon:
Changing the tray icon also changes the icon displayed by InputBox, Progress, and subsequently-created GUI windows. Compiled scripts are also affected even if a custom icon was specified at the time of compiling.

HBinswanger
Posts: 17
Joined: 14 Feb 2016, 00:45

Re: Hide the AHK icon on InputBox dialogs

Post by HBinswanger » 04 Jul 2019, 18:20

Yes!!! That's it. Did you learn this from study of the Help file info? (It's usually excellent but in some cases, like NoIcon, it doesn't give examples).

User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Hide the AHK icon on InputBox dialogs

Post by JoeWinograd » 04 Jul 2019, 18:24

First, do this to remove the system tray icon:

Code: Select all

#NoTrayIcon
Then this to put whatever icon you want on the InputBox:

Code: Select all

Menu,Tray,Icon,c:\temp\MyIcon.ico ; make this icon location whatever you want
Obviously, that won't affect the tray icon, because there is no tray icon. :) But InputBox will use it as its icon. Regards, Joe

gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Hide the AHK icon on InputBox dialogs

Post by gregster » 04 Jul 2019, 18:25

Did you learn this from study of the Help file info?
In this case I just looked it up, but probably there was something in the back of my mind that I remembered :geek:
But usually I don't care about icons. I rarely use any GUI... :)

User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Hide the AHK icon on InputBox dialogs

Post by JoeWinograd » 04 Jul 2019, 18:26

Ah, gregster got it...our posts crossed. Cheers, Joe

Post Reply

Return to “Ask for Help (v1)”