-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowMessage.ahk
76 lines (59 loc) · 1.6 KB
/
showMessage.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
*********************************************************************************
*
* showMessage.ahk
*
* uses UTF-8
*
*
* Copyright (c) 2024 jvr.de. All rights reserved.
*
*
*********************************************************************************
*/
/*
*********************************************************************************
*
* GNU GENERAL PUBLIC LICENSE
*
* A copy is included in the file "license.txt"
*
*********************************************************************************
*/
#Requires AutoHotkey v2
#Warn
#SingleInstance force
Fileencoding "UTF-8-RAW"
SetTitleMatchMode "2"
DetectHiddenWindows false
SendMode "Input"
InstallKeybdHook true
;-------------------------------- read cmdline param --------------------------------
hasParams := A_Args.Length
if (hasParams > 0){
msg := ""
loop hasParams {
msg .= A_Args[A_Index] . " "
}
msg := trim(msg)
showHintColoredTop(msg, 4000 ,,,,12)
}
exitApp
;---------------------------- showHintColoredTop ----------------------------
showHintColoredTop(s := "", n := 3000, fg := "FFFFFF", bg := "a900ff", newfont := "Segoe UI", newfontsize := "9"){
global hintColored
local t
hintColored := Gui("+0x80000000")
hintColored.SetFont("s" newfontsize " c" fg, newfont)
hintColored.BackColor := bg
hintColored.add("Text", , s)
hintColored.Opt("-Caption")
hintColored.Opt("+ToolWindow")
hintColored.Opt("+AlwaysOnTop")
hintColored.Show("y10 xcenter")
if (n > 0){
sleep(n)
hintColored.Destroy()
}
}
;-----------------------------------------------------------------