매크로

정보
2015.10.22 18:07

팝업 알림, CleanNotify

조회 수 433 추천 4 댓글 3
hqdefault.jpg hqdefault.jpg

이번 연초에 작성했던 스크립트인데, 여기엔 안 올린거 같아서 올립니다



라운드 처리가 안예뻐서 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%
}
}
}




List of Articles
분류 제목 글쓴이 최근변경 추천
질문 오토핫키 초보입니다 2 이리오리오 2015.11.15 0/0
자유 오토핫키나 그외 매크로 정보공유 톡방 1 최원태 2015.10.26 0/0
질문 controlclick 이용한 비활성 드래그 질문드려요 6 poerty 2015.10.30 0/0
질문 Dropdownlist 연동관련 질문드리겠습니다 22 최원태 2015.10.25 0/0
정보 팝업 알림, CleanNotify 3 예지력1 2015.11.11 4/0
질문 오토핫키 FTP 이용 다운로드 시 질문입니다. 5 2Yrs 2015.11.12 0/0
질문 오토핫키 이미지 서치 질문하려구 합니다~ 2 서영욱 2015.10.22 0/0
자유 비활성 이미지서치 팁좀 주실 분 있나요... 4 sica 2016.01.22 0/0
질문 document 엔터입력 1 _Crash 2016.04.16 0/0
질문 SciTE4AutoHotkey 질문드립니다. 2 doprop 2015.10.18 0/0
질문 Gui ActiveX 에 Send,{Enter} 가 안들어가네요 ㅠㅠ. 3 _Crash 2015.10.20 0/0
자유 오토핫키 질문좀 할ㄹ려고하는데 어디해야할지 몰라서 ... 수지가좋아 2015.10.17 0/0
질문 Nox 에서 PostMessage 가 안되요. 4 마천루 2015.10.18 0/0
질문 비활성 붙여넣기 명령어 좀 알려주세요 ㅠㅠ 1 KAZUYA 2015.10.17 0/0
질문 Gui ActiveX. 에서 Tab입력시 입력이들어가질않네요. ... 5 _Crash 2015.10.17 0/0
질문 Nox 비활성입력 해보신분? 2 _Crash 2015.10.15 0/0
질문 이 오류좀 도와주세요..ㅠㅠ 2 횬히 2015.10.21 0/0
질문 gdip 이미지서치 질문입니다. 2 비빔면 2015.10.14 0/0
자유 GUI만들기 너무 귀찮네요. 15 외치기 2015.10.21 0/0
질문 님들 윈도우10에서 이미지서치나 픽셀서치 겟픽셀 어떤... 6 MC하얀늑대 2015.10.21 0/0
Board Pagination Prev 1 ... 140141142143144145146147148 ... 209 Next
/ 209

전체 최신 인기글

전체 주간 인기글