이번 연초에 작성했던 스크립트인데, 여기엔 안 올린거 같아서 올립니다
라운드 처리가 안예뻐서 GDI로 만들고 있는데 귀찮네요 굉장히...
/*
CleanNotify by 예지력 (http://knowledgeisfree.tistory.com)
// Syntax
new CleanNotify("타이틀", "텍스트 " , 넓이, 길이, "포지션", 시간)
시간을 "P" 로 설정할 경우, 오브젝트를 파기하기 전까지 계속 존재합니다
인스턴스.Delete()
→ 오브젝트 제거
*/
#SingleInstance force
#NoEnv
SetBatchLines, -1
new CleanNotify("CleanNotify", "포지션 vc hc, 3초" , 600, 210, "vc hc", 6)
new CleanNotify("CleanNotify", "포지션 t hc" , 600, 210, "t hc", 3)
new CleanNotify("CleanNotify", "포지션 b hc" , 600, 210, "b hc", 3)
new CleanNotify("CleanNotify", "포지션 기본, b r" , 600, 210, "b r", 3)
new CleanNotify("CleanNotify", "포지션 b l" , 600, 210, "b l", 3)
new CleanNotify("CleanNotify", "포지션 t l" , 600, 210, "t l", 3)
return
class CleanNotify {
__New(Title, Msg, pnW := "700", pnH := "300", Pos := "b r", Time := "10")
{
Critical
LastFound := WinExist()
Gui, new, +hwndhNotify -DPIScale
this.hNotify := hNotify
Gui, % this.hNotify ": Default"
Gui, % this.hNotify ": +AlwaysOnTop +ToolWindow -SysMenu -Caption +LastFound"
WinSet, ExStyle, +0x20
WinSet, Transparent, 0
Gui, % this.hNotify ": Color", 0xF2F2F0
Gui, % this.hNotify ": Font", c0x07D82F s18 wBold, Segoe UI
Gui, % this.hNotify ": Add", Text, % " x" 20 " y" 12 " w" pnW-20 " hwndhTitle", % Title
this.hTitle := hTitle
Gui, % this.hNotify ": Font", cBlack s15 wRegular
Gui, % this.hNotify ": Add", Text, % " x" 20 " y" 56 " w" pnW-20 " h" pnH-56 " hwndhMsg", % Msg
this.hMsg := hMsg
Gui, % this.hNotify ": Show", % "W " pnW + 50 " H" pnH + 20 " NoActivate"
this.WinMove(this.hNotify, Pos)
WinSet, Region,0-0 w%pnW% h%pnH% R40-40, % "ahk_id " this.hNotify
Critical Off
this.winfade("ahk_id " this.hNotify, 210, 5)
if (Time != "P")
this.Timer(ObjBindMethod(this, "TimerExpired"), Time * 1000)
if (WinExist(LastFound))
Gui, % LastFound ": Default"
}
__Delete()
{
this.Destroy()
}
Destroy()
{
this.winfade("ahk_id " this.hNotify, 0, 5)
Gui, Destroy
}
Timer(Fir, Sec)
{
SetTimer, % Fir, % "-" Sec
}
TimerExpired()
{
this.Destroy()
}
WinMove(hwnd,position)
{
SysGet, Mon, MonitorWorkArea
WinGetPos,ix,iy,w,h, ahk_id %hwnd%
x := InStr(position,"l") ? MonLeft : InStr(position,"hc") ? (MonRight-w)/2 : InStr(position,"r") ? MonRight - w : ix
y := InStr(position,"t") ? MonTop : InStr(position,"vc") ? (MonBottom-h)/2 : InStr(position,"b") ? MonBottom - h : iy
WinMove, ahk_id %hwnd%,, x, y
}
winfade(w:="",t:=128,i:=1,d:=10) ; Thanks, Joedf
{
w:=(w="")?("ahk_id " WinActive("A")):w
t:=(t>255)?255:(t<0)?0:t
WinGet,s,Transparent,%w%
s:=(s="")?255:s ;prevent trans unset bug
WinSet,Transparent,%s%,%w%
i:=(s<t)?abs(i):-1*abs(i)
while(k:=(i<0)?(s>t):(s<t)&&WinExist(w)) {
WinGet,s,Transparent,%w%
s+=i
WinSet,Transparent,%s%,%w%
sleep %d%
}
}
}
선 추천 후 운동하고와서 시청해봐야겠습니다 ㅎㅎ