OSDTIP()

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

Re: OSDTIP()

07 Jul 2021, 00:16

ozzii wrote:
06 Jul 2021, 04:26
@SKAN
I just saw that the OSDTIP_Alert() is showing on the primary monitor.
Is there any option to show the alert where the mouse is located?
Hi @ozzii
That is the only OSDTIP my always-running-script doesn't use. I wrote it because @tuzi suggested.
I will look into it, but I need time.
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: OSDTIP()

07 Jul 2021, 07:28

No problemo @SKAN, no hurry.
I thank you in advance.
fenchai
Posts: 292
Joined: 28 Mar 2016, 07:57

Re: OSDTIP()

14 Jul 2021, 10:57

Wow, this is another gem I have found out about in less than a month @SKAN great job man. I'm glad ahk veterans like you continue to give awesome functions.
  • I am surprised you didn't use a class for this, as I believe it looks cooler :D
  • Also if the pop notifications could be stacked as more and more notifications pop, that would look cool.
User avatar
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

Re: OSDTIP()

24 Sep 2021, 08:06

Is there a way to add an image (Hicon) to OSDTIP_pop? I'm aware progress does not support images, but SplashImage does.

Image

Code: Select all

#Persistent
#SingleInstance Force

hIcon3 := LoadPicture("shell32.dll", "w64 Icon22", _) ; Full recycle bin
Gui, Add, Picture, x10 y15, % "HICON:" hIcon3
Gui, show, w200 

OSDTIP_Pop("Test with icon", "HICON:" hIcon3, -8000, "C11 CW101010 CTF0F0F0 FM22 FS20")
return

Guiclose:
exitapp

OSDTIP_Pop(P*) {                            ; OSDTIP_Pop v0.55 by SKAN on D361/D36E @ tiny.cc/osdtip 
Local
Static FN:="", ID:=0, PM:="", PS:="" 

  If !IsObject(FN)
    FN := Func(A_ThisFunc).Bind(A_ThisFunc) 

  If (P.Count()=0 || P[1]==A_ThisFunc) {
    OnMessage(0x202, FN, 0),  OnMessage(0x010, FN, 0)                   ; WM_LBUTTONUP, WM_CLOSE 
    SetTimer, %FN%, OFF
    DllCall("AnimateWindow", "Ptr",ID, "Int",200, "Int",0x50004)        ; AW_VER_POSITIVE | AW_SLIDE
    Progress, 10:OFF                                                    ; | AW_HIDE
    Return ID:=0
  }

  MT:=P[1], ST:=P[2], TMR:=P[3], OP:=P[4], FONT:=P[5] ? P[5] : "Segoe UI"
  Title := (TMR=0 ? "0x0" : A_ScriptHwnd) . ":" . A_ThisFunc
  
  If (ID) {
    Progress, 10:, % (ST=PS ? "" : PS:=ST), % (MT=PM ? "" : PM:=MT), %Title%
    OnMessage(0x202, FN, TMR=0 ? 0 : -1)                                ; v0.55
    SetTimer, %FN%, % Round(TMR)<0 ? TMR : "OFF" 
    Return ID
  }                                                                                                        

  If ( InStr(OP,"U2",1) && FileExist(WAV:=A_WinDir . "\Media\Windows Notify.wav") )
    DllCall("winmm\PlaySoundW", "WStr",WAV, "Ptr",0, "Int",0x220013)    ; SND_FILENAME | SND_ASYNC   
                                                                        ; | SND_NODEFAULT   
  DetectHiddenWindows, % ("On", DHW:=A_DetectHiddenWindows)             ; | SND_NOSTOP | SND_SYSTEM  
  SetWinDelay, % (-1, SWD:=A_WinDelay)                            
  DllCall("uxtheme\SetThemeAppProperties", "Int",0)
  Progress, 10:C00 ZH1 FM9 FS10 CWF0F0F0 CT101010 %OP% B1 M HIDE,% PS:=ST, % PM:=MT, %Title%, %FONT%
  DllCall("uxtheme\SetThemeAppProperties", "Int",7)                     ; STAP_ALLOW_NONCLIENT
                                                                        ; | STAP_ALLOW_CONTROLS
  WinWait, %Title% ahk_class AutoHotkey2                                ; | STAP_ALLOW_WEBCONTENT
  WinGetPos, X, Y, W, H                                                 
  SysGet, M, MonitorWorkArea
  WinMove,% "ahk_id" . WinExist(),,% MRight-W,% MBottom-(H:=InStr(OP,"U1",1) ? H : Max(H,100)), W, H
  If ( TRN:=Round(P[6]) & 255 )
    WinSet, Transparent, %TRN% 
  ControlGetPos,,,,H, msctls_progress321       
  If (H>2) {
    ColorMQ:=Round(P[7]),  ColorBG:=P[8]!="" ? Round(P[8]) : 0xF0F0F0,  SpeedMQ:=Round(P[9])
    Control, ExStyle, -0x20000,        msctls_progress321               ; v0.55 WS_EX_STATICEDGE
    Control, Style, +0x8,              msctls_progress321               ; PBS_MARQUEE
    SendMessage, 0x040A, 1, %SpeedMQ%, msctls_progress321               ; PBM_SETMARQUEE
    SendMessage, 0x0409, 1, %ColorMQ%, msctls_progress321               ; PBM_SETBARCOLOR
    SendMessage, 0x2001, 1, %ColorBG%, msctls_progress321               ; PBM_SETBACKCOLOR
  }  
  DllCall("AnimateWindow", "Ptr",WinExist(), "Int",200, "Int",0x40008)  ; AW_VER_NEGATIVE | AW_SLIDE
  SetWinDelay, %SWD%
  DetectHiddenWindows, %DHW%
  If (Round(TMR)<0)
    SetTimer, %FN%, %TMR%
  OnMessage(0x202, FN, TMR=0 ? 0 : -1),  OnMessage(0x010, FN)           ; WM_LBUTTONUP,  WM_CLOSE
Return ID:=WinExist()
}
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: OSDTIP()

25 Sep 2021, 03:31

SKAN wrote:
07 Jul 2021, 00:16
ozzii wrote:
06 Jul 2021, 04:26
@SKAN
I just saw that the OSDTIP_Alert() is showing on the primary monitor.
Is there any option to show the alert where the mouse is located?
Hi @ozzii
That is the only OSDTIP my always-running-script doesn't use. I wrote it because @tuzi suggested.
I will look into it, but I need time.
Hi @SKAN,
Did you have some time to look into this? :oops:
murataygun
Posts: 104
Joined: 07 Aug 2015, 15:53

Re: OSDTIP()

30 Nov 2023, 10:52

Where is the code? Cant find it.
gregster
Posts: 8989
Joined: 30 Sep 2013, 06:48

Re: OSDTIP()

30 Nov 2023, 11:59

murataygun wrote:
30 Nov 2023, 10:52
Where is the code? Cant find it.
This topic has 5 pages so far. I would recommend to start on the first one.
Its first post links to several other posts with various functions...

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 70 guests