Number lock

kim at martel.com.au kim at martel.com.au
Tue May 25 13:02:43 UTC 2021


Hi Kelly
   Register DLL ('user32','GetKeyState','JJ') Returns err
   Call DLL ('user32','GetKeyState',144) Returns result

Works in both Win10 and Win Server 16

But
   Register DLL ('user32','keybd_event','VJJJJ')
   Call DLL ('user32','keybd_event',144,69,1,0)      ;; key press
   Call DLL ('user32','keybd_event',144,69,3,0)      ;; key release

Works in Win10 but NOT Win server 16

I have now set it to open a message if Number Lock turned OFF to advise user
to turn Number Lock - ON
When running Win server 16

(I was hoping to turn it on automatically if it was OFF)

If any one knows if 'keybd_event' for this works with Win Server 16 I would
be appreciated.

Regards
Kim

-----Original Message-----
From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> On Behalf Of
Kelly Burgess
Sent: Tuesday, 25 May 2021 9:50 PM
To: OmnisList <omnisdev-en at lists.omnis-dev.com>
Subject: Re: Number lock

Hi Kim,

Which function?  Both?  They're both in the same user32.dll and have the
same minimum Win2000 requirements, and no exceptions are indicated.

I have no experience with or access to Win server 16.  Maybe others on the
list can say whether or not they've succeeded with Register / Call DLL in
general in that environment.

I do see on the MS page documenting keybd_event that it says "Note  This
function has been superseded. Use SendInput instead." so maybe Win server 16
doesn't support it.  That would be tough luck because you can't use Call DLL
with structures as parameters like SendInput requires.  No indication that
GetKeyState has been superseded.

Kelly
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com Start a new
message -> mailto:omnisdev-en at lists.omnis-dev.com 


-- 
This email has been checked for viruses by AVG.
https://www.avg.com



More information about the omnisdev-en mailing list