[오토핫키] 예쁜 메시지 박스

2018. 3. 26. 17:47·오토핫키·

;출처: https://autohotkey.com//boards/viewtopic.php?f=6&t=6056


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#SingleInstance force

#NoEnv

PleasantNotify("PleasantNotify", "position vc hc, 3 seconds" , 600, 210, "vc hc", "6")

Sleep, 3000

pn_mod_title("you can change titles")

pn_mod_msg("Also messages")

Sleep, 3000

PleasantNotify("PleasantNotify", "position t hc" , 600, 210, "t hc", "3")

Sleep, 3000

PleasantNotify("PleasantNotify", "position b hc" , 600, 210, "b hc", "3")

Sleep, 3000

PleasantNotify("PleasantNotify", "position default, b r" , 600, 210, "b r", "3")

Sleep, 3000

PleasantNotify("PleasantNotify", "position b l" , 600, 210, "b l", "3")

Sleep, 3000

PleasantNotify("PleasantNotify", "position t l" , 600, 210, "t l", "3")

Sleep, 3000

PleasantNotify("PleasantNotify", "position t r" , 600, 210, "t r", "3")

return


PleasantNotify(title, message, pnW=700, pnH=300, position="b r", time=10) {

    global pn_title, pn_msg, PN_hwnd, w, h

Notify_Destroy()

Gui, Notify: +AlwaysOnTop +ToolWindow -SysMenu -Caption +LastFound

PN_hwnd := WinExist()

WinSet, ExStyle, +0x20

WinSet, Transparent, 0

Gui, Notify: Color, 0xF2F2F0

Gui, Notify: Font, c0x07D82F s18 wBold, Segoe UI

Gui, Notify: Add, Text, % " x" 20 " y" 12 " w" pnW-20 " vpn_title", % title

Gui, Notify: Font, cBlack s15 wRegular

Gui, Notify: Add, Text, % " x" 20 " y" 56 " w" pnW-20 " h" pnH-56 " vpn_msg", % message

RealW := pnW + 50

RealH := pnH + 20

Gui, Notify: Show, W%RealW% H%RealH% NoActivate

WinMove(PN_hwnd, position)

if A_ScreenDPI = 96

WinSet, Region,0-0 w%pnW% h%pnH% R40-40,%A_ScriptName%

/* For Screen text size 125%

if A_ScreenDPI = 120

WinSet, Region, 0-0 w800 h230 R40-40, %A_ScriptName%

*/

winfade("ahk_id " PN_hwnd,210,5)

if (time <> "P")

{

Closetick := time*1000

SetTimer, ByeNotify, % Closetick

}

}


Notify_Destroy() {

global PN_hwnd

ByeNotify:

SetTimer, ByeNotify, Off

    winfade("ahk_id " PN_hwnd,0,5)

    Gui, Notify: Destroy

return

}


pn_mod_title(title) {

global pn_title

GuiControl, Notify: Text,pn_title, % title

}


pn_mod_msg(message) {

global pn_msg

GuiControl, Notify: Text,pn_msg, % message

}


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) {

    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%

    }

}

저작자표시 (새창열림)

'오토핫키' 카테고리의 다른 글

[오토핫키] 알파벳 소문자와 대문자와 숫자로 이루어진 랜덤 문자열  (3) 2018.04.03
[오토핫키] 텍스트를 바이너리값 변환  (0) 2018.04.02
[오토핫키] 특정 시간안에 특정키를 누르는 조건 걸기  (0) 2018.03.21
[오토핫키] 문자열에 숫자만 있는지 검증하기.  (0) 2018.03.16
[오토핫키] 업비트 코인 시세 파싱 예시  (0) 2018.03.08
'오토핫키' 카테고리의 다른 글
  • [오토핫키] 알파벳 소문자와 대문자와 숫자로 이루어진 랜덤 문자열
  • [오토핫키] 텍스트를 바이너리값 변환
  • [오토핫키] 특정 시간안에 특정키를 누르는 조건 걸기
  • [오토핫키] 문자열에 숫자만 있는지 검증하기.
징쟝
징쟝
IT 관련 네트워크 및 기타 자료들을 수집하고 공유하는데 목적이 있음.
  • 징쟝
    네트워커의 보안 티스토리
    징쟝
  • 전체
    오늘
    어제
  • 블로그 메뉴

    • 홈
    • 글쓰기
    • 관리
    • 방명록
    • 분류 전체보기 (153)
      • 정보보안 (54)
      • 리눅스 (10)
      • Windows (6)
      • Cisco (2)
      • Mikrotik (0)
      • Cyberoam (0)
      • Juniper (6)
      • MRTG (0)
      • Sophos (3)
      • SecuWiz (0)
      • Forti (0)
      • SECUI (1)
      • L4 (3)
      • 파이오링크 (0)
      • 오토핫키 (43)
      • 파이썬 (0)
      • 직장 (0)
      • 개인적인 것들 (10)
      • 그 외의 것들 (10)
      • 영화 (0)
      • 테스트 (1)
      • 일기장 (0)
      • 쓰레기통 (3)
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    해킹
    NAT
    spoofing
    MySQL
    SQL
    오토핫키
    정보보안
    php
    웹보안
    CSRF
    웹해킹
    인젝션
    HTML
    web
    보안
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
징쟝
[오토핫키] 예쁜 메시지 박스
상단으로

티스토리툴바