Thread: KeyCode
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default KeyCode

I'm guessing this is connected to the OP's previous request to prevent
PrtScr rather than call it.

NickHK

"Halim" wrote in message
...
Hi,
If you want to capture the screen, maybe more simple if use
API calls :
Option Explicit

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Const VK_SNAPSHOT = &H2C

Sub PRTSCR()
keybd_event VK_SNAPSHOT, 1, 0, 0
End Sub

Rgds,

Halim

"Francis Ang" wrote:

The keys on a keyboard are assigned with 'KeyCode'. Is there a KeyCode

for
'PrtScr'? I cannot seem to find this KeyCode. If there is no such

KeyCode,
can VBA codes detect when the 'PrtScr' key is pressed?

Thanks.