Reading keyboard events

BlitzPlus Forums/BlitzPlus Programming/Reading keyboard events

VIP3R(Posted 2004) [#1]
-


Eikon(Posted 2004) [#2]
* Disregard the code below. I misunderstood... you said taskbar, I think you mean system tray. I dont think anyone's got the Shell_NotifyIcon API working in B+ yet, so the answer is no.*

On q #2

Program & Taskbar Icon Curtosey of Binary Moon:
; Userlib
.lib "user32.dll"
GetActiveWindow%():"GetActiveWindow"
SetClassLong%( hWnd, nIndex, dwNewLong ):"SetClassLongA"

.lib "shell32.dll"
LoadIcon%(hWND%,File$,Index%) : "ExtractIconA"

; Code (Put right after parent window is created)
hWnd=GetActiveWindow() 
icon=LoadIcon(hWnd,"x.ico", 0)
SetClassLong(hwnd,-14,icon)



soja(Posted 2004) [#3]
See the "win32api and getting hotkeys problem" thread in the Blitz3D forum.


VIP3R(Posted 2004) [#4]
-


soja(Posted 2004) [#5]
No, GetAsyncKeyState will return a value if you specify the PrintScreen virtual key code -- not ASCII -- of $2C (44).
CreateTimer(60)
Repeat
	Select WaitEvent()
		Case $4001
		Print GetAsyncKeyState(44)
	End Select
Forever

Keep in mind, there are disadvantages to using this method, though.


VIP3R(Posted 2004) [#6]
-