WiseGui() : Themed splash text UI

Post your working scripts, libraries and tools.
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

WiseGui() : Themed splash text UI

Post by SKAN » 23 Aug 2021, 10:07

WiseGui( Name, Options* )

Name:
 
Parameter Name should be the unique string ID of a WiseGui. This parameter is case-sensitive as the textwill be used as a part of the WinTitle.
For example: WiseGui("unnamed") will create/show the following UI with WinTitle set as WiseGui\unnamed ahk_class AutoHotkeyGUI
 
Image

Note: The UI can be dismissed with Mouse left click
 
Options:
 
Variadic parameters, accepts strings in key=value or key:value format. These individual parameter strings will be converted into proper Map() object internally.
When Options are completely omitted, the function will
  • Create a new GUI if name doesn't exist.
  • or Destroy any existing one.
     
    For eg., the following would splash a WiseGui for 3 seconds
     
    Image
     

    Code: Select all

    WiseGui("unnamed")
    Sleep(3000)
    WiseGui("unnamed")
    
 
When WiseGUI() is called with Options and the Named UI already exists, then the UI will be updated with newer options.
All options would work when creating a GUI.. For updation, only selected options will be processed.
Any unrecognized Key:value pair will be silently ignored
 
Recognized Keys for Gui creation
 
Theme

Four themes are built-in, namely Warning  Info  Success  Error. Or, you may simply use the first letter W  I  S  E
 
The following code would splash all 4 in-built themes, one-by-one. at right-bottom corner of primary monitor. (use Move option for different window placement)
 
Image    Image    Image    Image
 

Code: Select all

WiseGui("Test", "Theme: Warning")
Sleep(2000)
WiseGui("Test") ; Kill

WiseGui("Test", "Theme: Info")
Sleep(2000)
WiseGui("Test") ; Kill

WiseGui("Test", "Theme: Success")
Sleep(2000)
WiseGui("Test") ; Kill

WiseGui("Test", "Theme: Error")
Sleep(2000)
WiseGui("Test") ; Kill
 
Custom theme:
You may pass your own theme with 4 comma separated values and in this exact order: TextColor, WindowColor, BorderColor, [HICON]
 
For eg., WiseGui("Test", "Theme: 0xF0F0F0, 0x778899, 0x556677") will produce
 
Image
 
The left border is thick as WiseGui() will use a 32x32px transparent icon as place holder when HICON is omitted.
Pass 0 as HICON value to suppress this behaviour.
 
WiseGui("Test", "Theme: 0xF0F0F0, 0x778899, 0x556677, 0") will produce
 
Image
 
-Theme:
If colors are omitted, WiseGui() will use System colors. WiseGui("Test", "Theme:,,") will produce
 
Image
 
Again, to suppress thick left border: WiseGui("Test", "Theme:,,,0") will produce
 
Image
 
 
 
MainText
SubText
 
A WiseGui has two text controls, MainText and SubText.
When MainText is omitted, Warning  Info  Success  Error will be used for built-in themes and A_ScriptName for a custom theme.
 
Example 1:
 
Image
 

Code: Select all

WiseGui( "Test"
       , "MainText:  Lorem ipsum"
       , "SubText:   Sed ut perspiciatis unde`nomnis iste natus error sit voluptatem"
       )
 
Example 2: Text alignment -1=Left, 0=Center, 1=Right
 
Image
 

Code: Select all

WiseGui( "Test"
       , "MainText:  Lorem ipsum"
       , "MainAlign: 0"
       , "SubText:   Sed ut perspiciatis unde`nomnis iste natus error sit voluptatem"
       , "SubAlign:  0"
       )
 
Example 3: Applying Font
 
Image
 

Code: Select all

WiseGui( "Test"
       , "FontMain:  s14 Bold Italic Underline, Comic Sans MS"
       , "MainText:  '  Lorem ipsum  '"
       , "MainAlign: 0"

       , "FontSub:   s12 Norm, Consolas"
       , "SubText:   Sed ut perspiciatis unde`nomnis iste natus error sit voluptatem"
       , "SubAlign:  0"
       )
 
Example 4: Applying fixed TextWidth for MainText and SubText
 
Image
 

Code: Select all

WiseGui( "Test"
       , "FontMain:  s14 Bold Italic Underline, Comic Sans MS"
       , "MainText:  '  Lorem ipsum  '"
       , "MainAlign: 0"

       , "FontSub:   s12 Norm, Consolas"
       , "SubText:   Sed ut perspiciatis unde`nomnis iste natus error sit voluptatem"
       , "SubAlign:  0"

       , "TextWidth: 480"       
       )
 
If only a single line is needed, for eg. a ToolTip like splash, MainText height can be set to 0 with Main: 0
Note: Refer Margins option for precise spacing around SubText
 
Image
 

Code: Select all

WiseGui( "Test"
       , "Main:         0"
       , "Theme:        ,,,0"
       , "FontSub:      s10 Norm, Consolas"
       , "SubText:      Sed ut perspiciatis unde omnis iste natus error sit voluptatem"
       , "Shadow:       1"   
       , "Transparency: 192" ; valid range: 64 to 255
       )
 
 
Move
 
Requires 3 values in this order: xAxis, yAxis, Monitor
xAxis: A positive value (0 based index) will move the UI from left to right. A negative value will move the window from right to left.
yAxis: A positive value (0 based index) will move the UI from top to bottom. A negative value will move the window from bottom to top.
The default placement values are -10, -10 and will move the window to the right-bottom corner (or South-East corner, when expressed as a direction).
 
Note: Gui().Show("h200 w400 w500 w600") will show a 600x200 window, because only the final say i.e, w600 is accepted.
WiseGui() options are parsed in a similar manner.

 
The following will show the UI in center screen.
Comment out move lines, one-by-one, from bottom to see how the window placement is done.
 
Image
 

Code: Select all

WiseGui( "Test"
       , "Theme:     Error"
       , "MainText:  Lorem ipsum"
       , "SubText:   Sed ut perspiciatis unde`nomnis iste natus error sit voluptatem"
       , "Move:      0,  0" ; NorthWest
       , "Move:       ,  0" ; North
       , "Move:     -1,  0" ; NorthEast
       , "Move:     -1,   " ; East
       , "Move:     -1, -1" ; SouthEast
       , "Move:       , -1" ; South
       , "Move:      0, -1" ; SouthWest
       , "Move:      0,   " ; West
       , "Move:       ,   " ; Center
       )
 
Specifying monitor: Pass monitor number as 3rd value.
 
For eg: The following
 

Code: Select all

WiseGui( "Test"
       , "Theme:     Error"
       , "MainText:  Lorem ipsum"
       , "SubText:   Sed ut perspiciatis unde`nomnis iste natus error sit voluptatem"
       , "Move:     -1,, 1" ; East of Secondary monitor
       )
 
moves UI as follows in my multi-monitor setup.
 
Image
 
 
Margins
 
You may specify values in this exact order: xMargin, yMargin, ySpacing, IconMargin
Important Note: These are not pixels values. These values will be multiplied by 4 to convert them to pixel values.
Annoying, I know. Numbers other than multiples of 4 would not DPI scale nicely.

xMargin : The spacing on the left/right sides of MainText / SubText.
yMargin : The spacing above MainText and below SubText.
ySpacing : The vertical spacing between MainText and SubText.
IconMargin : The space surrounding icon.
 
Image
 
Try experimenting with Margins' values in following example.
 

Code: Select all

WiseGui( "Test"
       , "Margins:       4,1,0,3"
       , "Theme:,,," .  LoadPicture(A_AhkPath, "Icon1", &ImageType)
       , "FontMain:     S18, Comic Sans MS"
       , "MainText:     AutoHotkey"
       , "FontSub:      S14, Consolas"
       , "SubText:"  .  A_AhkVersion
       , "SubAlign:     +1"
       )
 
 
Show
Hide
 
You may use this feature to animate when WiseGui is Shown/dismissed.
These keys require 2 parameters, type and duration as a single value: for eg these pair will fade-in fade-out: Show: Fade@500ms Hide: Fade@500ms
Valid duration: 25ms to 2500ms
Valid types:
 
  • Fade
  • Zoom
  • SlideEast
  • SlideNorthEast
  • SlideNorth
  • SlideNorthWest
  • SlideWest
  • SlideSouthWest
  • SlideSouth
  • SlideSouthEast
  • RollEast
  • RollNorthEast
  • RollNorth
  • RollNorthWest
  • RollWest
  • RollSouthWest
  • RollSouth
  • RollSouthEast
The most common use would be toaster-pop animation, and here follows an example:
 
Image
 

Code: Select all

WiseGui( "Test"
       , "MainText:     UTC"
       , "SubText:"  .  FormatTime(A_NowUTC, "hh:mm tt")
       , "Show:         SlideWest@400ms"
       , "Show:         SlideNorth@400ms" ; delete this line to slide west
       , "Hide:         SlideSouth@400ms"
       , "Move:         -1,-1"
       , "Timer:        2000"
       )
 
 
If the second occurrence of Show is deleted from above call:
 
Image
 
 
Close
 
A WiseGui, for eg. WiseGui("MyWiseGui", "SubText: Hello World") would stay on screen forever until dismissed with a Mouse-Left-click.
It can be auto-closed if a timer is specified: WiseGui("MyWiseGui", "SubText: Hello World", "Timer: 3000").. and/or a mouse click, whichever occurs first.
The UI may also be closed from elsewhere on the script, by calling WiseGui("MyWiseGui").
I have the following Hotkey defined in my always-running-script to dismiss any/all WiseGui with Esc.

Code: Select all

HotIfWinExist("WiseGui\ ahk_class AutoHotkeyGUI")
; Hotkey( "Esc", (*) => WinClose() )
Hotkey( "Esc", (*) => WinClose(WinExist()) ) ; WinExist() rqd from atleast Beta10
HotIfWinExist()
 
It isn't wise to allow dismissal of a WiseGui, that is showing some/any progress or is in a wait state. On such a case, use Close: 0 to make the window un-closeable.
Once the task is complete, you have to mark the UI closeable with an explicit Close: 1, or else it would require an ExitApp to kill the UI.
 
Here follows an example:
 
Image
 

Code: Select all

WiseGui( "folderSize"
       , "Close:        0"
       , "MainText:     Computing folder size"
       , "FontSub:      s10 Norm, Consolas"
       , "TextWidth:    240"
       , "Shadow:       1"
       )

FolderSize := 0
Loop Files A_WinDir . "\*.*"
{
    WiseGui( "folderSize", "SubText:" . A_LoopFileFullPath )
    Foldersize += A_LoopFileSize
    Sleep(50)
}

WiseGui( "folderSize"
       , "Close:      1"
       , "MainText:   Folder size in bytes"
       , "SubText:" . FolderSize
       , "Theme:      Success"
       , "Timer:      3000"
       )
 
Use Close: Trigger if you need to know if UI was dismissed with a mouse click. Note: This isn't a callback.. Just an alert.
 

Code: Select all

WiseGui( "MyWiseGui"
       , "Close: Trigger"
       , "Timer: 5000"
       , WiseGuiWasClicked ; or WiseGuiWasClicked.Bind("Auto", "Hot", "Key")
       )

WiseGuiWasClicked(P*) ; Requires variadic params to deal with BoundFunc
{
   Switch( P[1] )                         ; Check first parameter if being called as Func
   {                                      ; Check final parameter if being called as BoundFunc
      Case  0 :                           ; No mouse click
      Case  1 : SoundBeep()               ; Left clicked
      Case -1 : SoundBeep(), SoundBeep()  ; Right clicked
   }
}
 
 
Windows Media Player
 
I have implemented key wmp:<filename> on a test basis.
It uses PlaySound() and has been tested to work in Win 7+.
Use it minimally. Example call: "wmp:" . A_WinDir . "\Media\notify.wav"
 
 
 
 
Simple example script : Splash clock
 
Image
 

Code: Select all

#Requires AutoHotkey v2.0-
#Warn
#SingleInstance
#Include "WiseGui.ah2"

F2::WinExist("WiseGui\SplashClock ahk_class AutoHotkeyGUI") ? WinClose() : SplashClock()

SplashClock()
{
    WiseGui("SplashClock"
          , "FontMain:    s24 Norm,      Consolas"
          , "FontSub:     s48 Norm Bold, Consolas"
          , "MainText:" . FormatTime(A_Now, "ddd, dd-MMM-yyyy (") . FormatTime(A_Now, "YDay0") . ")"
          , "SubText:"  . FormatTime(A_Now, "hh:mm:ss tt")
          , "MainAlign:   0"
          , "SubAlign:    0"
          , "Margins:     4,4,2,0"
          , "Move:"                                        ; Center screen
          , "TextWidth:   420"
          , "Theme:       0x856442, 0xFFFFF0, 0xEBB800, 0" ; Same as Warning theme, but no Icon
          , "Show:        Fade@400ms"
          , "Hide:        Fade@400ms"
    )

    SetTimer( SplashClock, 900 )

    SplashClock()
    {
        If ( WinExist("WiseGui\SplashClock ahk_class AutoHotkeyGUI") )
             WiseGui("SplashClock", "SubText:" . FormatTime(A_Now, "hh:mm:ss tt"))
        Else SetTimer( , 0 )
    }
}

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

WiseGui() : Themed splash text UI

Post by SKAN » 23 Aug 2021, 10:59

The function:
 

Code: Select all

WiseGui(Name, Options*) ;  v0.96a by SKAN for ah2 on D48F/D491 @ autohotkey.com/r?t=94044   -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  RM145
{ 
    If ( StrLen(Name) = 0 )
        Return

    Static Names := Map()
    Local  MyGui

    If ( Options.Length=0 && Names.Has(Name) )
         Return GuiClose( Names[Name] )

    If ( Names.Has(Name) )
    {
        MyGui := Names[Name]
        UpdateGui(&MyGui)
    }
    Else CreateGui(&MyGui)



    ParseOptions(&UsrOpts)  ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        Local Value
        For Value in Options
        {
            Switch Type(Value)
            {
                Case "String" :
                {
                    Value := StrSplit(Value, ["=", ":"], A_Space, 2)
                    If ( Value.Length > 1 )
                         UsrOpts[ SubStr(Value[1], 1, 5) ] := Trim( Value[2], "'" . '"')
                }

                Case "Func", "BoundFunc" :
                {
                    UsrOpts["Trigger"] := Value
                }
            }
        }
    }


    UpdateGui(&MyGui) ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        Local UsrOpts, Value, GuiP, Period

        UsrOpts := MyGui.UsrOpts
        If ( Options.Length )
             ParseOptions(&UsrOpts)

        If ( UsrOpts.Has("Theme") )
        {
            GuiP :=  GetTheme( UsrOpts["Theme"] )
            MyGui.BackColor := GuiP["WindowColor"]
            MyGui["LineL"].Opt("Background" . GuiP["BorderColor"])
            MyGui["LineT"].Opt("Background" . GuiP["BorderColor"])
            MyGui["LineB"].Opt("Background" . GuiP["BorderColor"])
            MyGui["LineR"].Opt("Background" . GuiP["BorderColor"])
            MyGui["MainText"].Opt("c" . GuiP["TextColor"])
            MyGui["SubText" ].Opt("c" . GuiP["TextColor"])
            If MyGui["Icon"].Value
               MyGui["Icon"].Value := "HICON:" . GuiP["HICON"]
            WinRedraw(MyGui.Hwnd)
            MyGui.Show("NA")
        }

        If ( MyGui.UsrOpts.Has("MainT") )
        {
            If MyGui["MainText"].Text != UsrOpts["MainT"]
               MyGui["MainText"].Text := UsrOpts["MainT"]
            MyGui.UsrOpts.Delete("MainT")
        }

        If ( MyGui.UsrOpts.Has("SubTe") )
        {
            If MyGui["SubText"].Text != UsrOpts["SubTe"]
               MyGui["SubText"].Text := UsrOpts["SubTe"]
            MyGui.UsrOpts.Delete("SubTe")
        }

        OnClose(&MyGui)
        ApplySettings(&MyGui)

        If MyGui.UsrOpts.Has("Timer")
        {
            Period := 0 - Min(20000, Max(200, Format("{:d}", MyGui.UsrOpts["Timer"])))
            SetTimer( MyGui.MyTimer, Period )
            MyGui.UsrOpts.Delete("Timer")
        }
    }


    CreateGui(&MyGui) ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        Local Value, Theme, GuiP, TxtP, UsrOpts, Font, Period, DHW, XY
        MyGui := Gui("+DpiScale -Caption +AlwaysOnTop +Owner +E0x08000000", "WiseGui\" . Name)
        Names[Name]       :=  MyGui
        MyGui.Name        :=  Name
        MyGui.MyTimer     :=  GuiClose.Bind(MyGui)
        MyGui.UsrOpts     :=  Map()

        UsrOpts           :=  MyGui.UsrOpts
        UsrOpts.CaseSense :=  "Off"

        If ( Options.Length )
             ParseOptions(&UsrOpts)

        XY := UsrOpts.Has("Margi") ? StrSplit(UsrOpts["Margi"] . ",,,,", ",", A_Space, 5) : [2,1,0,0]
        Loop( 4 )
          XY[A_Index] := Format("{:d}", XY[A_Index]) * 4

        MyGui.MarginX    :=  0
        MyGui.MarginY    :=  0

        GuiP             :=  GetTheme( UsrOpts.Has("Theme") ? UsrOpts["Theme"] : "Info")
        MyGui.BackColor  :=  GuiP["WindowColor"]

        ; Icon
        If   GuiP["HICON"]
        {
             MyGui.Add("Text",    "x0 y0 w" . (XY[4]*2)+32 " h" (XY[4]*2)+32 . " vLineL Background" . GuiP["BorderColor"])
             MyGui.Add("Picture", "xp+" . XY[4] . " yp+" . XY[4] . " w32 h32 BackgroundTrans vIcon", "HICON:" . GuiP["HICON"])
             MyGui.Add("Text", "x+" . XY[4] . " w0 h0")
        }
        Else
        {
             MyGui.Add("Text",    "x0 y0   w1 h1 vLineL Background" . GuiP["BorderColor"])
             MyGui.Add("Picture", "xp yp w0 h0 vIcon")
        }

        MyGui.Add("Text", "x+0 ym w10 h1 Section vLineT Background" . GuiP["BorderColor"])

        ; MainText
        If (  UsrOpts.Has("MainT")  )
        {
              Value := UsrOpts["MainT"]
              MyGui.UsrOpts.Delete("MainT")
        }
        Else  Value := ["Warning", "Information", "Success", "Error", A_ScriptName][InStr("WISEU", GuiP["T"])]

        MyGui.MarginX   :=  XY[1]
        MyGui.MarginY   :=  XY[2]

        Font :=  UsrOpts.Has("FontM")  ?  StrSplit( UsrOpts["FontM"], ",", " ")  :  ["s10 Bold", "Segoe UI"]
        MyGui.SetFont( Font* )
        TxtP := "xp+" . MyGui.MarginX . " y+m vMainText BackgroundTrans c" . GuiP["TextColor"]
        TxtP .= UsrOpts.Has("TextW") ? ( " w" . UsrOpts["TextW"] ) : ""
        TxtP .= UsrOpts.Has("MainA") ? ( UsrOpts["MainA"]=0 ? " Center" : UsrOpts["MainA"]=1 ? " Right" : "" ) : ""

        If ( UsrOpts.Has("Main") && UsrOpts["Main"]=0 )
             MyGui.Add("Text", "vMainText w0 h0 y+0 xp+" . MyGui.MarginX)
        Else MyGui.Add("Text", TxtP, Value)

        ; SubText
        If (  UsrOpts.Has("SubTe")  )
        {
              Value := UsrOpts["SubTe"]
              MyGui.UsrOpts.Delete("SubTe")
        }
        Else  Value := ""

        MyGui.MarginY   :=  XY[3]
        Font :=  UsrOpts.Has("FontS")  ?  StrSplit( UsrOpts["FontS"], ",", " ")  :  ["s10 Norm", "Segoe UI"]
        MyGui.SetFont( Font* )
        TxtP := "xp y+m vSubText BackgroundTrans c" . GuiP["TextColor"]
        TxtP .= UsrOpts.Has("TextW") ? " w" . UsrOpts["TextW"] : ""
        TxtP .= UsrOpts.Has("SubAl") ? ( UsrOpts["SubAl"]=0 ? " Center" : UsrOpts["SubAl"]=1 ? " Right" : "" ) : ""
        MyGui.Add("Text", TxtP, Value)

        MyGui.MarginY   :=  XY[2]
        ; Right / Bottom lines
        MyGui.Add("Text", "x+0 yp  w1  hp vLineR Background" . GuiP["BorderColor"])
        MyGui.Add("Text", "xs  y+m w10 h1 vLineB Background" . GuiP["BorderColor"])

        MyGui.MarginX   :=  XY[1]
        MyGui.MarginY   :=  0
        MyGui.Show("AutoSize Hide")
        Local X, Y, W, H, LX
        MyGui.GetPos(&X, &Y, &W, &H)

        MyGui["LineL"].Move(,,,H)
        MyGui["LineR"].Move(W-1,0,,H)
        MyGui["LineT"].GetPos(&LX)
        MyGui["LineT"].Move(,,W-LX)
        MyGui["LineB"].Move(,H-1,W-LX)

        Local MW, SW
        MyGui["MainText"].GetPos(,,&MW)
        MyGui["SubText" ].GetPos(,,&SW)
        If ( MW > SW )
             MyGui["SubText" ].Move(,,MW)
        Else MyGui["MainText"].Move(,,SW)

        MyGui.Add("Text", "x0 y0 w" . W . " h" . H . " vClick BackgroundTrans")

        If UsrOpts.Has("Shado") && UsrOpts["Shado"]
        {
           dwOldLong := SetClassLong(MyGui.Hwnd, -26)           ; Save GCL_STYLE
           SetClassLong(MyGui.Hwnd, -26, dwOldLong | 0x20000)   ; Apply CS_DROPSHADOW
        }

        OnClose(&MyGui)
        ApplySettings(&MyGui, True)

        If UsrOpts.Has("Show")
           AnimateWindow( MyGui.Hwnd, UsrOpts["Show"] )

        MyGui.Show("NA")

        If UsrOpts.Has("Shado") && UsrOpts["Shado"]
           SetClassLong(MyGui.Hwnd, -26, dwOldLong)             ; Restore GCL_STYLE


        If MyGui.UsrOpts.Has("Timer")
        {
            Period := 0 - Min(20000, Max(200, Format("{:d}", MyGui.UsrOpts["Timer"])))
            SetTimer( MyGui.MyTimer, Period )
            MyGui.UsrOpts.Delete("Timer")
        }
    }


    ApplySettings(&MyGui, Create:=0)
    {
        Local UsrOpts := MyGui.UsrOpts
        If UsrOpts.Has("WMP")
        {
            PlaySound( Name, UsrOpts["WMP"] )
            Sleep(100)
            MyGui.UsrOpts.Delete("WMP")
        }

        If ( UsrOpts.Has("Move") )
        {
            GuiSetPos( MyGui.Hwnd, StrSplit( UsrOpts["Move"], ",", A_Space, 3)* )
            MyGui.UsrOpts.Delete("Move")
        }
        Else
        If ( Create = True )
        {
            GuiSetPos( MyGui.Hwnd, "-10", "-10" )
        }

        Local Trans, DHW
        If ( MyGui.UsrOpts.Has("Trans") )
        {
             Trans :=  Min(255, Max(64, Format("{:d}", MyGui.UsrOpts["Trans"])))
             DHW   :=  A_DetectHiddenWindows
             DetectHiddenWindows(True)
             WinSetTransparent(Trans, MyGui.Hwnd)
             DetectHiddenWindows(DHW)
        }
    }


    GetTheme(Theme)   ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        If ( Not InStr(Theme, ",") )
        {
             Theme := Format( "{:U}", SubStr(Theme, 1,1) )
             Return ( Theme="W" ?  Map( "T","W",  "TextColor","856442", "WindowColor","FFFFF0", "BorderColor","EBB800",  "HICON",GetIcon(Theme) )
                    : Theme="I" ?  Map( "T","I",  "TextColor","194499", "WindowColor","F0F8FF", "BorderColor","3399FF",  "HICON",GetIcon(Theme) )
                    : Theme="S" ?  Map( "T","S",  "TextColor","155724", "WindowColor","F0FFE9", "BorderColor","429300",  "HICON",GetIcon(Theme) )
                    : Theme="E" ?  Map( "T","E",  "TextColor","721C24", "WindowColor","FFF4F4", "BorderColor","E40000",  "HICON",GetIcon(Theme) )
                                :  Map( "T","I",  "TextColor","194499", "WindowColor","F0F8FF", "BorderColor","3399FF",  "HICON",GetIcon("I") ) )
        }

        Local Arr := StrSplit(Theme . ",,,,", ",", A_Space, 5)
        Return Map( "T","U"
                  , "TextColor",    StrLen( Arr[1] ) ? Format( "{:06X}", Arr[1] ) : GetSysColor( 8)
                  , "WindowColor",  StrLen( Arr[2] ) ? Format( "{:06X}", Arr[2] ) : GetSysColor(15)
                  , "BorderColor",  StrLen( Arr[3] ) ? Format( "{:06X}", Arr[3] ) : GetSysColor( 6)
                  , "HICON",        StrLen( Arr[4] ) = 0 ? GetIcon("") : Arr[4] )
    }


    GetSysColor(nIndex)  ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        Return Format("{5:}{6:}{3:}{4:}{1:}{2:}", StrSplit(Format("{:06X}", DllCall("User32.dll\GetSysColor", "Int",nIndex)))*)
    }


    GetIcon(Theme, W:=0, H:=0)    ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    { ; v1.10
        Local B64, B64Len, nBytes, Bin

        B64 := ( Theme="W" ? "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEXruAD//+KFZEL13HH+/NiPclLsuwr9+c789cH887v46Jj45pP02GbtvhPEt5"
        . "ruwh/67ar67amii22Zf2Dyz0rxz0nb1LfUyq7MwaSzooTuwiD499rx7tHn4sWrl3l1GphJAAABHUlEQVRYw+2WybLCIBBF3wUyCZmMUfMc/v8zLXeaC0IXW86+T9FAD3+FQiH"
        . "Gv7NTa0w7WTfKo3vd4YNO96LwWhvsMLpOjz818NCsqfEaAXTa8Q8IckhJ4zOeDdLzy7M4IcIauYDv+38qpa67t6glCVQkiCTRGxY8dgLT/zwAC+6Se+xYUGFP96P+wIIFRLg2"
        . "nUewgXBBgfUIBhA2KJg8giuIOShoPYIziDYoMB7BA4QRCW4CAadwVBUkKUwsWCC5RMuCIxib/pGeagPj0r/yZbiAGZOLyU8na4iMTm8oZ6WWO7ihJB9hUZ5i0oKmWnkETS1o6"
        . "5viYlolg+U20DPq3NGWPVwzx3vugpG74uQuWWJGZ+f3mje/17xCoRDhBWODDIHAQPWnAAAAAElFTkSuQmCC" : Theme="I" ? "iVBORw0KGgoAAAANSUhEUgAAAEAAAABAC"
        . "AMAAACdt4HsAAAAVFBMVEUzmf/w+P8ZRJmSyf/o9P/c5vOks9Pg8P/V6v/P6P/B4f+y2f+u1v+IxP9wuP9Npv9Eof88nv9tg7jH0ue7yOA6nf80VqFKZqmRosrR3O18kL9cdb"
        . "Au8FSxAAABHElEQVRYw+2WyZaEIAxFO4JhKMSpyp7+/z9bdzYRk2xqxd2/e+AkIXw0Gg2OcUjRW+tjGkZ9ejIBTgQzqeKzsVBgzSzPZwcXuCzNG6hgRPHXA6o8XgLBvzwxKM/"
        . "f/3bdortFhjNf3c4TzmSmfo4TuFlTANzzm1WUYir7BxH7sqMm+QH03RAkgnAzfyCiPpuDTDBUBQkKfkgVD1JVEKFguxTEqsBDQbfzTQS+KrBXgp4IrFjQHwJQCPyF4BMUV4gy"
        . "QbwpIxUsVJDEjbQSAdNIo0wwMsPECQIzzqzAMA8KJ7C3S86QKmy67TI70onrE5E8qnUymYWimbJqsSxHfENyAfFq6xFxFa82/XLVr/d3fTD0Xxz9J0v/zWs0Ggx/07kMr8YqP"
        . "fYAAAAASUVORK5CYII=" : Theme="S" ? "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAY1BMVEVCkwDw/+kVVySZyXXo+t/c7dbh9tTS7MHF5K+325yz2"
        . "ZiQxGl6tktRnBRKmAvG28Jrj24yZzujvaHm9uBaoiDR5MzX78fW78avx62WspWJp4lbg19IdU5IlwlboiG70bd7m3xysmd2AAABTUlEQVRYw+2W226EIBCGOwMqKyqeD6tr+/"
        . "5PWeO2oSjEsdzyJV5o8v+ZgzDzEQgErlhlKnrOe5HK9r46Zwn8IWH5LXnBOBzgrKDrsxgsxBlVz8ABI8lfD3DyeBEMtN7m4BE/MYsMLsgu+heDFTWVXz+9KP6TwIiIMyWJnIO"
        . "NqEKsInjD8/sBlIhYk+qYOBMo9Wvi1q9go6kQMQKN+2xKsFEbCWxIp0FqreCmX4wvqdNAgIUnIn4aX4TToHcEUILB4DTgjgAUGHCSQaQDeIIJJ6TQLVh1vy2IwGQgFHFCfDtU"
        . "5wBAENrYzIg4NzDqClDaKMF0mKDULaD8SOvhBGK9PSMcaWmHSeHOctIn1OM87QY1HGHkC2VBo4f6QqGGoNBWQnbjUu2Uak4DrvC91n0Hi+9o8x6uvuPdf8HwX3H8lyw6rUzFw"
        . "Pmwr3mBQOCCb5bODse1hzUgAAAAAElFTkSuQmCC" : Theme="E" ? "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAS1BMVEXkAAD/7u1yHCTyd3eziovFo"
        . "6T+5OPlCgqfbW/92dj7y8v6xcT4s7LOr6/2m5rwa2voISHmFRT2oJ/tTU3tTUy8l5ipfH6UXWD2oaDGo2xeAAABGUlEQVRYw+2W3W7DIAyFdyCB8VMIdN32/k+6SZ3SZBSbyr"
        . "d8d1F0TmxiG79NJhOOLafojfEx5e11ddEBB4IuL8mtNviH0XZcf3V4gvsY1Wt00GPhV3SpI2l8g6AK4h/M4goG5iStA4OzfAKCJMqjfpYLjqzrXlFlKIBFqctRr9Q6EkI4CP4"
        . "c2sdA9B923pV6fPSmfln2d/3ezHjqsJz1yF2DhNah1SN1DSJah1aP2DXwaB2+Gj1818DgzKe6c8MJM2yARd3TGDXwtAGfQqRT4A8xjR1ioguJ/42ZLmW+kDaymfhSDlQ7t/rW"
        . "QZMDhW9nU8iRxg8UzQxVbqQ5Kx3r4ouFpYKgii9X4fUuXTCkK45wyRKueZPJhOEHEsMMXLgJ8a8AAAAASUVORK5CYII=" : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYA"
        . "AAAfFcSJAAAADUlEQVQImWOor69nBgAEfwGBGWiMoAAAAABJRU5ErkJggg==" )

        nBytes :=  Floor((B64Len := StrLen(B64 := RTrim(B64,"=")))*3/4)
        Bin    :=  Buffer(nBytes)

        DllCall("Crypt32.dll\CryptStringToBinary", "str",B64, "int",B64Len, "int",1, "ptr",Bin,"uintp",nBytes, "Int",0, "Int",0)
        Return DllCall("User32.dll\CreateIconFromResourceEx", "ptr",Bin, "int",nBytes, "int",1, "int",0x30000, "Int",W, "Int",H, "Int",0, "ptr")
    }


    PlaySound(Name, Filename:="")    ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {                                ; by SKAN for ah2 on D48J/D48K @ autohotkey.com/r?t=93918
        Static Names := Map()

        If ( Filename="" )
        {
            If Names.Has(Name)
            {
                Names[Name].Controls.Stop
              , Names.Delete(Name)
            }
            Return
        }

        Names[Name]     :=  ComObject("WMPlayer.OCX")
      , Names[Name].Url :=  FileName

        While( Names.Has(Name)
           &&  Names[Name].controls.isAvailable("stop")
           && !Names[Name].controls.currentPosition )
               Sleep 10

        Try SetTimer(CheckSound.Bind(Name), 2000)

        CheckSound(_Name)
        {
            If ( Not Names.Has(_Name) )
                 Return SetTimer(, 0)

            If ( Names[_Name].playState != 3 )
            {
                 SetTimer(, 0)
               , Names.Delete(_Name)
            }
        }
    }


    SetClassLong(Hwnd, nIndex, dwNewLong:="")
    {
        If ! IsInteger(dwNewLong)
             Return A_PtrSize=8  ? DllCall("User32.dll\GetClassLongPtr", "ptr",Hwnd, "int",nIndex, "uint")
                                 : DllCall("User32.dll\GetClassLong",    "ptr",Hwnd, "int",nIndex, "uint")

        Else Return A_PtrSize=8  ? DllCall("User32.dll\SetClassLongPtr", "ptr",Hwnd, "int",nIndex, "ptr",dwNewLong, "uint")
                                 : DllCall("User32.dll\SetClassLong",    "ptr",Hwnd, "int",nIndex, "ptr",dwNewLong, "uint")
    }


    GuiSetPos(Hwnd, X:="", Y:="", M:="")   ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        Local DPI_AWARENESS_CONTEXT_UNAWARE, DPI_AWARENESS_CONTEXT := 0

        Try
        {
            DPI_AWARENESS_CONTEXT         := DllCall("User32.dll\GetThreadDpiAwarenessContext", "ptr")
            DPI_AWARENESS_CONTEXT_UNAWARE := DPI_AWARENESS_CONTEXT - 1
            DllCall("User32.dll\SetThreadDpiAwarenessContext", "ptr",DPI_AWARENESS_CONTEXT_UNAWARE, "ptr")
        }

        Local Err, mLeft, mTop, mRight, mBottom
        Try M := MonitorGetWorkArea(M,  &mLeft, &mTop, &mRight, &mBottom)
        Catch Error as Err
            M := MonitorGetWorkArea(, &mLeft, &mTop, &mRight, &mBottom)

        Local RECT := Buffer(16, 0)
        DllCall("User32.dll\GetWindowRect", "ptr",Hwnd, "ptr",RECT)
        Local W := NumGet(RECT,  8, "int") - NumGet(RECT, 0, "int")
        Local H := NumGet(RECT, 12, "int") - NumGet(RECT, 4, "int")

        X := mLeft + (StrLen(X)=0 ? ( (mRight  - mLeft)//2 ) - (W//2) : X<0 ? mRight  - mLeft - W + 1 + X : X)
        Y := mTop  + (StrLen(Y)=0 ? ( (mBottom - mTop )//2 ) - (H//2) : Y<0 ? mBottom - mTop  - H + 1 + Y : Y)

        DllCall("User32.dll\MoveWindow", "ptr",Hwnd, "int",X, "int",Y, "int",W, "int",H, "int",1)
        If ( DPI_AWARENESS_CONTEXT )
             DllCall("User32.dll\SetThreadDpiAwarenessContext", "ptr",DPI_AWARENESS_CONTEXT)
    }


    AnimateWindow(Hwnd, P)  ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        Local Flags := Map()
        Flags.CaseSense := "Off"
        Flags.Set("Fade",      "0x00080000",    "Zoom",           "0x00000010"
                , "SlideEast", "0x00040001",    "SlideNorthEast", "0x00040009",    "SlideNorth", "0x00040008",    "SlideNorthWest", "0x0004000A"
                , "SlideWest", "0x00040002",    "SlideSouthWest", "0x00040006",    "SlideSouth", "0x00040004",    "SlideSouthEast", "0x00040005"
                , "RollEast",  "0x00000001",    "RollNorthEast",  "0x00000009",    "RollNorth",  "0x00000008",    "RollNorthWest",  "0x0000000A"
                , "RollWest",  "0x00000002",    "RollSouthWest",  "0x00000006",    "RollSouth",  "0x00000004",    "RollSouthEast",  "0x00000005")

        P    :=  StrSplit(P, ["@", "ms"], "- ")
        P[1] :=  Flags.Has(P[1]) ? Flags[P[1]] : Flags["Fade"]
        P[1] |=  DllCall("User32.dll\IsWindowVisible", "ptr",Hwnd) ? 0x10000 : 0
        P[2] :=  Min(2500, Max(25, Format("{:d}", P[2])))


        DllCall("User32.dll\AnimateWindow", "ptr",Hwnd, "int",P[2], "int",P[1] )
    }


    OnClose(&MyGui)   ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        Local UsrOpts := MyGui.UsrOpts
        If ( UsrOpts.Has("Close") )
        {
             If ( UsrOpts["Close"] )
                  MyGui["Click"].OnEvent("Click", GuiClose.Bind(MyGui, True))
        }
        Else
        {
             MyGui["Click"].OnEvent("Click", GuiClose.Bind(MyGui, True))
             UsrOpts["Close"] := 1
        }

        MyGui.OnEvent("Close",  (*) => GuiClose(MyGui, "*"))
        MyGui.OnEvent("ContextMenu",  (*) => GuiClose(MyGui, "-1"))
    }


    GuiClose(thisGui, Clicked:="0", *)  ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    {
        SetTimer(thisGui.MyTimer, 0)

        If ( ! thisGui.UsrOpts["Close"] )
        {
            Sleep(0)
            Return 1
        }

        Local err
        Try thisGui.Title := ""
        Catch Error as err
            Return

        Names.Delete(thisGui.Name)

        If thisGui.UsrOpts.Has("Hide")
           AnimateWindow( ThisGui.Hwnd, thisGui.UsrOpts["Hide"] )

        SetTimer( PlaySound.Bind(thisGui.Name), -1 )

        If thisGui.UsrOpts.Has("Close")
        If thisGui.UsrOpts["Close"] = "Trigger"
        If thisGui.UsrOpts.Has("Trigger")
           SetTimer( thisGui.UsrOpts["Trigger"].Bind(Clicked), -1)

        thisGui.Destroy()
    }
}   ; -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
My Scripts and Functions: V1  V2

tranht17
Posts: 52
Joined: 03 May 2017, 02:55

Re: WiseGui() : Themed splash text UI

Post by tranht17 » 23 Aug 2021, 20:44

Nice code, thank SKAN !

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: WiseGui() : Themed splash text UI

Post by SKAN » 24 Aug 2021, 05:37

@tranht17 :thumbup:

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: WiseGui() : Themed splash text UI

Post by SKAN » 01 Sep 2021, 04:55

Code updated.
Closing WiseGui with rapidly called WinClose() was throwing errors owing to mis-timing.
Have inserted a Try to suppress any such throw.

User avatar
smrt1
Posts: 30
Joined: 27 Mar 2022, 04:47

Re: WiseGui() : Themed splash text UI

Post by smrt1 » 27 Mar 2022, 16:46

Impressive !
SKAN, you are the one that made me switch to ahkV2 ;)

Noblish
Posts: 28
Joined: 22 Mar 2020, 06:10

Re: WiseGui() : Themed splash text UI

Post by Noblish » 04 Apr 2022, 14:35

This is crazy! Definitely implementing on my imgui project.
Thanks

User avatar
cyruz
Posts: 346
Joined: 30 Sep 2013, 13:31

Re: WiseGui() : Themed splash text UI

Post by cyruz » 21 Jan 2023, 19:05

Great stuff as usual SKAN.

There is a little bug that can be triggered with this code, clicking on the WiseGui before clicking on the message box:

Code: Select all

#Include <WiseGui>

mon := MonitorGetPrimary()

WiseGui("Test", "Theme: Info"
              , "MainText: Test"
              , "SubText: Subtext test"
              , "Move: -10, -10, " mon )

msgbox "clickme"

WiseGui("Test")
Error: Parameter #1 of MonitorGetWorkArea requires a Number, but received an empty string.

---- C:\Users\itoff\Desktop\Ciro\AutoHotkey\V2\Lib\WiseGui.ahk
378: M := MonitorGetWorkArea(M, &mLeft, &mTop, &mRight, &mBottom)
379: Catch Error as Err
▶ 380: M := MonitorGetWorkArea("", &mLeft, &mTop, &mRight, &mBottom)
382: RECT := Buffer(16, 0)
383: DllCall("User32.dll\GetWindowRect", "ptr",Hwnd, "ptr",RECT)

Call stack:
C:\Users\itoff\Desktop\Ciro\AutoHotkey\V2\Lib\WiseGui.ahk (380) : [MonitorGetWorkArea] M := MonitorGetWorkArea("", &mLeft, &mTop, &mRight, &mBottom)
C:\Users\itoff\Desktop\Ciro\AutoHotkey\V2\Lib\WiseGui.ahk (380) : [GuiSetPos] M := MonitorGetWorkArea("", &mLeft, &mTop, &mRight, &mBottom)
C:\Users\itoff\Desktop\Ciro\AutoHotkey\V2\Lib\WiseGui.ahk (242) : [ApplySettings] GuiSetPos( MyGui.Hwnd, "-10", "-10" )
C:\Users\itoff\Desktop\Ciro\AutoHotkey\V2\Lib\WiseGui.ahk (204) : [CreateGui] ApplySettings(&MyGui, True)
C:\Users\itoff\Desktop\Ciro\AutoHotkey\V2\Lib\WiseGui.ahk (17) : [WiseGui] CreateGui(&MyGui)
C:\Users\itoff\Desktop\Ciro\AutoHotkey\Scripts\work\CmRcLauncher\src\test.ah2 (14) : [] WiseGui("Test")
> Auto-execute

There is also a small glitch when the WiseGui gets destroyed. It happens even when using animations.
ABCza on the old forum.
My GitHub.

gianozdp
Posts: 8
Joined: 29 Feb 2020, 23:36

Re: WiseGui() : Themed splash text UI

Post by gianozdp » 07 Mar 2023, 21:07

I found the same issue on 2.0.2
Error: Parameter #1 of MonitorGetWorkArea requires a Number, but received an empty string.

User avatar
NPerovic
Posts: 32
Joined: 31 Dec 2022, 01:25
Contact:

Re: WiseGui() : Themed splash text UI

Post by NPerovic » 09 Mar 2023, 13:18

@gianozdp
@cyruz
Find the following line in the

Code: Select all

WiseGui.ahk

Code: Select all

M := MonitorGetWorkArea("", &mLeft, &mTop, &mRight, &mBottom)
And then, replace it with:

Code: Select all

M := MonitorGetWorkArea(, &mLeft, &mTop, &mRight, &mBottom)
Fixed.
230310 021254.gif
230310 021254.gif (385.96 KiB) Viewed 4577 times

gianozdp
Posts: 8
Joined: 29 Feb 2020, 23:36

Re: WiseGui() : Themed splash text UI

Post by gianozdp » 09 Mar 2023, 21:33

@NPerovic Great, Thanks a lot.

User avatar
cyruz
Posts: 346
Joined: 30 Sep 2013, 13:31

Re: WiseGui() : Themed splash text UI

Post by cyruz » 13 Mar 2023, 12:36

Thanks @NPerovic, I already fixed it that way, I didn't review the code though.
ABCza on the old forum.
My GitHub.

elbitjusticiero
Posts: 75
Joined: 06 May 2017, 11:07

Re: WiseGui() : Themed splash text UI

Post by elbitjusticiero » 25 Mar 2023, 08:24

This is really cool.

One thing I noticed is that if I want to update the WiseGui like the example you give for processing files in a loop, it doesn't allow for more lines than the first use. i.e. if I try to display one line of information initially, and then two or more lines, it doesn't work.

My use case is that it would be ideal to have a WiseGui appear at the top left of the screen and show at first, say,

PROCESSING DOCUMENT
------------------------------
Writing header

and then change to

PROCESSING DOCUMENT
------------------------------
Writing header ✓
Writing table of contents

and then to

PROCESSING DOCUMENT
------------------------------
Writing header ✓
Writing table of contents ✓
Writing section 1

and so on.

It looks like it isn't possible with WiseGui as it is? Or am I missing something?

EDIT: This minimal example

Code: Select all

F1::
{
	WiseGui("HELLO", "MainText: Writing", "SubText: Phase 1"
	       , "Move: 22, 22", "Close: 0")
	Sleep 333
	WiseGui("HELLO", "MainText: Writing", "SubText: Phase 2`nPhase 3")
	WiseGui("HELLO", "Close: 1", "Timer: 1111")
}
shows the problem. "Phase 3" is not displayed.

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: WiseGui() : Themed splash text UI

Post by SKAN » 16 May 2023, 10:34

@NPerovic : Thanks. I had fixed it in my copy but didn't update here.

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: WiseGui() : Themed splash text UI

Post by SKAN » 16 May 2023, 10:36

@elbitjusticiero

Create SubText 2 lines before hand:
WiseGui("HELLO", "MainText: Writing", "SubText: Phase 1`n"
, "Move: 22, 22", "Close: 0")
Edit: Or, you will have to kill and recreate the UI.

User avatar
josephthom12
Posts: 5
Joined: 21 May 2023, 18:55

Re: WiseGui() : Themed splash text UI

Post by josephthom12 » 21 May 2023, 19:00

Hi! Thanks for all your hard work. But how do I setup WiseGui to use in my project? I assume you have to save the WiseGui function to ahk file and reference elsewhere it but the process is not clear. Where dose the function go? In all my scripts? Notepad++ is throwing a bunch of syntax's errors with local variables. Can you please help. Thanks!

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: WiseGui() : Themed splash text UI

Post by SKAN » 21 May 2023, 22:08

@josephthom12
Are you using V2 version of AutoHotkey?

Edit:
Image
 
Unzip WiseGui_Demo.zip into a folder and run main.ahk
 
 

Code: Select all

; main.ahk

#Requires AutoHotkey v2.0
#Warn
#SingleInstance

#Include "WiseGui.ahk"
#Include "SplashClock.ahk"

; Use Hotkey Win+F2 to show/hide the clock.

#F2:: WinExist("WiseGui\SplashClock ahk_class AutoHotkeyGUI")
    ? WinClose()
    : SplashClock()

; Use  Hotkey Win+F3 to exit application.

#F3:: ExitApp
Attachments
WiseGui_Demo.zip
(7.12 KiB) Downloaded 148 times

User avatar
josephthom12
Posts: 5
Joined: 21 May 2023, 18:55

Re: WiseGui() : Themed splash text UI

Post by josephthom12 » 22 May 2023, 06:23

Still errors for most variables. Yes only Autohotkey V2 is installed.Image

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: WiseGui() : Themed splash text UI

Post by SKAN » 22 May 2023, 06:47

josephthom12 wrote:
22 May 2023, 06:23
Still errors for most variables.
WiseGui isn't a variable.. It is a function.
Can't imagine whats incorrect on your end. :(

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

Re: WiseGui() : Themed splash text UI

Post by gregster » 22 May 2023, 06:52

@josephthom12, did you #include the libraries? (lines 7 and 8 in SKAN'S example)

Post Reply

Return to “Scripts and Functions (v2)”