Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Capser
- a$=Space(999) : GetModuleFileName_(0,@a$,999) : appname$=GetFilePart(a$)
- Global SpaceKey = #False
- Procedure KeyPressed()
- SpaceKey = #False
- For i=48 To 90
- If GetAsyncKeyState_(i) = -32767
- ProcedureReturn #True
- EndIf
- Next
- If GetAsyncKeyState_(#VK_SPACE) = -32767
- SpaceKey = #True
- ProcedureReturn #True
- EndIf
- ProcedureReturn #False
- EndProcedure
- Procedure Capser(dummy)
- Repeat
- RandFunc.i = Random(99) + 1
- If KeyPressed()
- If RandFunc > 40
- keybd_event_(#VK_CAPITAL,0,0,0)
- keybd_event_(#VK_CAPITAL,0,#KEYEVENTF_KEYUP,0)
- Else
- If SpaceKey = #True
- SpaceKey = #False
- Select Random(9) + 1
- Case 1
- SetClipboardText(" ^__^ ")
- Case 2
- SetClipboardText(" *~~^__^~~* ")
- Case 3
- SetClipboardText(" :-* ")
- Case 4
- SetClipboardText(" xD ")
- Case 5
- SetClipboardText(" <3 ")
- Case 6
- SetClipboardText(" :) ")
- Case 7
- SetClipboardText("!!1 ")
- Case 8
- SetClipboardText("!?? ")
- Case 9
- SetClipboardText("))) ")
- Case 10
- SetClipboardText(". ")
- EndSelect
- keybd_event_(#VK_BACK,0,0,0)
- keybd_event_(#VK_BACK,0,#KEYEVENTF_KEYUP,0)
- keybd_event_(#VK_CONTROL,0,0,0)
- keybd_event_(#VK_V,0,0,0)
- keybd_event_(#VK_V,0,#KEYEVENTF_KEYUP,0)
- keybd_event_(#VK_CONTROL,0,#KEYEVENTF_KEYUP,0)
- EndIf
- EndIf
- EndIf
- Sleep_(1)
- ForEver
- EndProcedure
- If OpenWindow(0,1,1,1,1,"Capser",#PB_Window_Invisible|#PB_Window_BorderLess)
- Icon = ExtractIcon_(WindowID(0),appname$,0)
- AddSysTrayIcon(1,WindowID(0),Icon)
- SysTrayIconToolTip(1,"Capser")
- If CreatePopupMenu(0)
- MenuItem(1,"Capser")
- DisableMenuItem(0,1,1)
- MenuBar()
- MenuItem(2,"Exit")
- EndIf
- CapserThread = CreateThread(@Capser(),dummy)
- EndIf
- Repeat
- ev = WaitWindowEvent()
- If ev = #PB_Event_SysTray And EventType() = #PB_EventType_RightClick
- DisplayPopupMenu(0, WindowID(0))
- EndIf
- If ev = #PB_Event_Menu And EventMenu() = 2
- ev = #PB_Event_CloseWindow
- EndIf
- If ev = #PB_Event_CloseWindow
- KillThread(CapserThread)
- EndIf
- Until ev = #PB_Event_CloseWindow
- ; IDE Options = PureBasic 4.51 (Windows - x86)
- ; CursorPosition = 47
- ; FirstLine = 20
- ; Folding = -
- ; EnableXP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement