TaskDialog() - the other 'MsgBox' for Win Vista+
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
Think about all the options if possiable.
- Joe Glines
- Posts: 770
- Joined: 30 Sep 2013, 20:49
- Location: Dallas
- Contact:
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
It's nice having some easy options that look like they were built in the last decade.
Sign-up for the HK Newsletter
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
- Joe Glines
- Posts: 770
- Joined: 30 Sep 2013, 20:49
- Location: Dallas
- Contact:
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
Could somebody post an example using a custom icon? I think this is a cool feature but I'm not following how to implement it.
Sign-up for the HK Newsletter
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
Code: Select all
#NoEnv
#Include TaskDialog.ahk
HICON := LoadIcon("Shell32.dll", 14)
Main := "This is the main instruction."
Extra := "This is the content text providing extra informations."
Title := "Custom Icon"
MsgBox, 262144, %A_ScriptName%, % TaskDialog(Main, Extra, Title, , HICON)
ExitApp
LoadIcon(FullFilePath, IconNumber := 1, LargeIcon := 1) {
HIL := IL_Create(1, 1, !!LargeIcon)
IL_Add(HIL, FullFilePath, IconNumber)
HICON := DllCall("Comctl32.dll\ImageList_GetIcon", "Ptr", HIL, "Int", 0, "UInt", 0, "UPtr")
IL_Destroy(HIL)
Return HICON
}
- Joe Glines
- Posts: 770
- Joined: 30 Sep 2013, 20:49
- Location: Dallas
- Contact:
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
@just me Thank you! I sure never would have got that on my own!
Sign-up for the HK Newsletter
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
- Joe Glines
- Posts: 770
- Joined: 30 Sep 2013, 20:49
- Location: Dallas
- Contact:
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
I played around with that and it is pretty cool! Is there a way to either
1) show the color w/o the associated icon
2) use the color with the custom icon
When I say "color" I'm referring to the color displayed in the top part of the taskDialog as in the following call:
1) show the color w/o the associated icon
2) use the color with the custom icon
When I say "color" I'm referring to the color displayed in the top part of the taskDialog as in the following call:
Code: Select all
TaskDialog(Main, Extra, , 0x3F, "Red", , HGUI)
Sign-up for the HK Newsletter
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
"Red", "Green", etc. are names for system-defined icons which are not documented in task dialog reference on the MSDN but accepted by task dialogs. The whole drawing is done by the "control" and there's no parameter to pass a background color. I don't have a clue why background colors are drawn for those icons.
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
@huyaowen
An idea for the taskdialog creator.
Maybe a possibility to customize the icon?
What do you think? So This will be even more complete.
An idea for the taskdialog creator.
Maybe a possibility to customize the icon?
What do you think? So This will be even more complete.
- Joe Glines
- Posts: 770
- Joined: 30 Sep 2013, 20:49
- Location: Dallas
- Contact:
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
I was playing with this just so I'd understand how to use it and have a go-to with examples. People new to programming might find it helpful so I thought I'd post it. These are merely examples of calling the function.
Code: Select all
#SingleInstance, Force
#NoEnv
RAlt::Reload
RControl::
Time_Out:=2 ;set to zero for none
gosub Adjust_Widths
gosub Various_Buttons
gosub Builtin_Icons
gosub Backgrounds
gosub Custom_Icons
return
;*******************************************************
Adjust_Widths:
;**********************adjusting width*********************************
loop, 10{
Width:=350+(A_Index*25)
TaskDialog("Main: A_Index="A_Index, "Extra: Width=" Width,"Title: Ajusting Width", , ,Width,,Time_Out)
}
return
;*******************************************************
Various_Buttons:
;**********************buttons*********************************
TaskDialog("Main: Words for buttons", "Extra: Showing all buttons possible" ,"Title: Buttons-using text" ,"Yes,No,Cancel,Retry,Close",,,400,Time_Out)
TaskDialog("Main: Yes=1, No=4, Cancel=8, Retry=16, Close=32", "Extra: 1+4=5" ,"Title: Buttons-using addition", 5,,,400,Time_Out)
TaskDialog("Main: Yes=1, No=4, Cancel=8, Retry=16, Close=32", "Extra: 1+4+8=13" ,"Title: Buttons-using addition", 13,,,400,Time_Out)
TaskDialog("Main: Yes=1, No=4, Cancel=8, Retry=16, Close=32", "Extra: 1+4+8+32=45" ,"Title: Buttons-using addition", 45,,,400,Time_Out)
return
;*******************************************************
Builtin_Icons:
;**********************Icons*********************************
Loop, 4
TaskDialog("Main: WARN=1, ERROR=2, INFO=3, ", "Extra: A_Index=" A_Index ,"Title: Main Icons",1,A_Index,,400,Time_Out)
TaskDialog("Main: Question needs the string with quotes ", "Extra: ""Question""" ,"Title: Main Icons",1,"Question",,400,Time_Out)
return
;*******************************************************
Backgrounds:
;*******************************************************
Main :="Main from " A_ThisLabel , Title:="Title from " A_ThisLabel , Extra:="Extra from " A_ThisLabel
TaskDialog(Main,Extra,Title ,, "Blue" ,400,HGUI,Time_Out)
TaskDialog(Main,Extra,Title ,, "Yellow",450,HGUI,Time_Out)
TaskDialog(Main,Extra,Title ,, "Red" ,500,HGUI,Time_Out)
TaskDialog(Main,Extra,Title ,, "Green" ,550,HGUI,Time_Out)
TaskDialog(Main,Extra,Title ,, "Gray" ,600,HGUI,Time_Out)
return
Custom_Icons:
Main :="Main from " A_ThisLabel , Title:="Title from " A_ThisLabel , Extra:="Extra from " A_ThisLabel
LoadIcon("H:\Progs\SPSS 13\spsswin.exe",1,0)
TaskDialog(Main, Extra, Title,, LoadIcon(A_WinDir "\explorer.exe",1,0)) ; first icon, small icon
TaskDialog(Main, Extra, Title,, LoadIcon(A_WinDir "\explorer.exe",1,1)) ; first icon, large icon
TaskDialog(Main, Extra, Title,, LoadIcon(A_WinDir "\explorer.exe",2,0)) ; Second icon, small icon
TaskDialog(Main, Extra, Title,, LoadIcon(A_WinDir "\explorer.exe",3,1)) ; Third icon, large icon
;~ TaskDialog(Main, Extra, Title,, LoadIcon("H:\Progs\SPSS 13\spsswin.exe",1,0), 1) ;you can put in your own programs too...
LoadIcon(FullFilePath, IconNumber := 1, LargeIcon := 1) {
;~ --Proived by "just me" http://ahkscript.org/boards/viewtopic.php?f=6&t=4635&start=40#p32968 ;
HIL := IL_Create(1, 1, !!LargeIcon)
IL_Add(HIL, FullFilePath, IconNumber)
HICON := DllCall("Comctl32.dll\ImageList_GetIcon", "Ptr", HIL, "Int", 0, "UInt", 0, "UPtr")
IL_Destroy(HIL)
Return HICON
}
Sign-up for the HK Newsletter
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
TaskDialog Designer?
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
Could I show custom icon with green background?
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
thanks, good tool.
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
Make seperate topic!
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: TaskDialog() - the other 'MsgBox' for Win Vista+
I think it should be added to Examples of Non-Standard GUIs (ActiveX, GDI, etc.) thread.
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 231 guests