Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FileInstall(".\bkg.bmp",@tempdir & "\bkgforstickenotes.bmp")
- FileSetAttrib(".\bkgforstickenotes.bmp","+H")
- If winexists("stickenotes") = 0 Then
- Opt("TrayMenuMode",1)
- TraySetIcon(".\tray.ico")
- TraySetToolTip("Stick-E-Notes is running :-)")
- Else
- Opt("TrayIconHide",1)
- EndIf
- #include<WindowsConstants.au3>
- #include<GUIConstantsEx.au3>
- #include<TrayConstants.au3>
- Opt("MouseCoordMode",0)
- GUICreate("stickenotes",200,200,-1,-1,BitOr($WS_POPUP,$WS_BORDER),$WS_EX_TOOLWINDOW)
- GUICtrlCreatePic(@tempdir & "\bkgforstickenotes.bmp",0,0,200,200)
- GUICtrlSetState(-1, $GUI_DISABLE)
- $title_label=GUICtrlCreateLabel("",0,10,200,15,0x01)
- GUICtrlSetFont(-1,-1,-1,-1,"Fixedsys")
- GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
- GUICtrlSetState(-1,$GUI_HIDE)
- $memo_label=GUICtrlCreateLabel("",10,44,180,160)
- GUICtrlSetFont(-1,-1,-1,-1,"Verdana")
- GUICtrlSetBkColor(-1,0xEFE4B0)
- GUICtrlSetState(-1,$GUI_HIDE)
- GUISetState(@SW_SHOW)
- While 1
- $msg = GUIGetMsg()
- Select
- Case $msg=$GUI_EVENT_PRIMARYUP
- $primpos=MouseGetPos(1)
- $primpos2=MouseGetPos(0)
- If $primpos < 34 then
- If $primpos2 > 173 then
- $a=Msgbox(36,"Confirm action","Do you want to delete this note?")
- If $a=6 then Exit
- If $a=7 then ContinueLoop
- EndIf
- If $primpos2 < 26 Then
- msgbox(64,"Stick-E-Notes: Usage","- Click the title bar to rename the note." & @CRLF & "- Press Del Note to delete and close the note (after confirmation)" & @CRLF & "- Click the note body to change the contents of the note." & @CRLF & "- Right click the note body to move the note around on the desktop." & @CRLF & "- To create multiple notes, simply open another instance of this app :-)" & @CRLF & "- To bring focus to your notes, click the tray icon.")
- ContinueLoop
- EndIf
- $title=InputBox("Stick-E-Notes","Define note title","")
- If $title <> "" Then
- If StringLen($title) > 18 then $title=StringTrimRight($title,StringLen($title)-18)
- GUICtrlSetData($title_label,$title)
- GUICtrlSetState($title_label,$GUI_SHOW)
- EndIf
- EndIf
- If $primpos > 34 then
- $memo=InputBox("Stick-E-Notes","Define note text",GUICtrlRead($memo_label))
- If not @error Then
- GUICtrlSetData($memo_label,$memo)
- GUICtrlSetState($memo_label,$GUI_SHOW)
- EndIf
- EndIf
- Case $msg = $GUI_EVENT_SECONDARYDOWN
- $mprimcords=mousegetpos()
- Opt("MouseCoordMode",1)
- Do
- $msg=guigetmsg()
- $cords=MouseGetPos()
- WinMove("stickenotes","",$cords[0]-$mprimcords[0],$cords[1]-$mprimcords[1])
- Until $msg = $GUI_EVENT_SECONDARYUP
- Opt("MouseCoordMode",2)
- EndSelect
- $tmsg=TrayGetMsg()
- If $tmsg=$TRAY_EVENT_PRIMARYDOWN then
- WinActivate("stickenotes")
- Endif
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement