팝업창 - shortkey
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListBoxConstants.au3>
; 포스트잇 생성 함수
Func CreatePostIt()
; GUI 생성
$hGUI = GUICreate("포스트잇", 300, 400)
; 예시 텍스트 레이블
$hLabel = GUICtrlCreateLabel("예시: 할일 목록, 중요한 내용, 메모 등", 10, 10, 280, 25)
GUICtrlSetColor($hLabel, 0x808080)
GUICtrlSetFont($hLabel, 9, 400, 0, "Arial")
; 입력창
$hInput = GUICtrlCreateInput("", 10, 40, 280, 30)
GUICtrlSetFont($hInput, 11)
; 추가 버튼
$hAdd = GUICtrlCreateButton("추가", 10, 75, 60, 30)
; 삭제 버튼
$hDelete = GUICtrlCreateButton("삭제", 230, 75, 60, 30)
; ? 메모 리스트 (ListBox → List)
$hList = GUICtrlCreateList("", 10, 110, 280, 240, $LBS_STANDARD)
GUICtrlSetFont($hList, 10)
; 닫기 버튼
$hClose = GUICtrlCreateButton("닫기", 110, 360, 80, 30)
GUISetState(@SW_SHOW)
; 이벤트 루프
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $hClose
GUIDelete()
ExitLoop
Case $hAdd
$sText = GUICtrlRead($hInput)
If $sText <> "" Then
GUICtrlSetData($hList, $sText)
GUICtrlSetData($hInput, "")
GUICtrlSetFocus($hInput)
Else
MsgBox(48, "알림", "내용을 입력해주세요!")
EndIf
Case $hDelete
$iIndex = GUICtrlSendMsg($hList, $LB_GETCURSEL, 0, 0)
If $iIndex > -1 Then
GUICtrlSendMsg($hList, $LB_DELETESTRING, $iIndex, 0)
Else
MsgBox(48, "알림", "삭제할 항목을 선택해주세요!")
EndIf
EndSwitch
WEnd
EndFunc
; 프로그램 시작
CreatePostIt()
Exit