` Set NumLock from Clarion app (Daan Marais ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Set NumLock from Clarion app
2008-04-25 -- Daan Marais
 
Ok, found the answer I was looking for in comp.lang.clarion, quoted here for completeness: (credit to Markku Niskanen) Module ('Win API') GetKeyboardState(*CSTRING),RAW,PASCAL SetKeyboardState(*CSTRING),LONG,RAW,PASCAL end Global Variables KeyboardState Cstring(257) For your window or application, whichever you wish, set the Timer value to 10 or something like that (that is, the timer message is received every 1/10 seconds, which should be sufficient). Add to the Timer embed the following code: GetKeyBoardState(KeyBoardState) ! Get state to buffer KeyboardState[91H] =80H ! Result# = SetKeyboardState(KeyboardState) ! Set state And that will do the trick!! He (later) adds: MSDN says Because the SetKeyboardState function alters the input state of the calling thread and not the global input state of the system, an application cannot use SetKeyboardState to set the NUM LOCK, CAPS LOCK, or SCROLL LOCK lights on the keyboard etc etc


Today is November 21, 2024, 8:36 am
This article has been viewed 35217 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: