Can I change a script taskbar icon of a msgbox?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Can I change a script taskbar icon of a msgbox?

20 Jul 2019, 06:06

The tray icon is not visible and the script don't have a gui,just a simple msgbox that appears on a condition
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Can I change a script taskbar icon of a msgbox?

22 Jul 2019, 11:56

Courtesy of StackOverflow.
https://stackoverflow.com/questions/12573868/how-do-i-set-the-autohotkey-msgbox-taskbar-icon

Since you're not using a Gui for your script, it seems this would best achieve the results you requested.

Code: Select all

#SingleInstance, Force
#NoTrayIcon

Menu, Tray, Icon, Shell32.dll, 5  ; Folder icon
Gui, +OwnDialogs
Gui, Show ; Since it has zero dimensions, it should be invisible.
MsgBox, Testing...
ExitApp

+OwnDialogs hides the MsgBox's taskbar item, and we compensate using an "invisible" Gui with a custom icon to imitate the MsgBox taskbar item.
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Can I change a script taskbar icon of a msgbox?

22 Jul 2019, 12:10

Simply precede the MsgBox line with "Gui +OwnDialogs". AHK hidden window becomes the owner of the MsgBox, suppressing the taskbar button.

Code: Select all

#SingleInstance Force
#NoEnv
#NoTrayIcon

Gui +OwnDialogs
MsgBox
ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: erann, Playa 01, rubeusmalfoy and 240 guests