Can I change a script taskbar icon of a msgbox?

Get help with using AutoHotkey and its commands and hotkeys
vsub
Posts: 180
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: 1347
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.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
Alguimist
Posts: 347
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”

Who is online

Users browsing this forum: Bing [Bot], Bort P, ElektroBerry, flint, Google [Bot], Gully, KHA, mehrez1989, SuperFoobar and 190 guests