Solved

GetKeyboardState function

Posted on 1997-11-22
1
746 Views
Last Modified: 2008-03-06
Hi,

I am in dispair. I have tried to use the GetKeyboardState function but it gives
me the error 'Actual parameter not matching formal var parameter. Here is a fragment of my code:


var
KeybStateBuf:TByteArray;
pKeybStateBuf:PByte;


begin

pKeybStateBuf:=addr(KeybStateBuf);
                 
GetKeyboardState(pKeybStateBuf);

end.

This doesn't work and I don't know why. Could anybody give me a solution for that terrific problem, please !!

                  Thanks a lot.

                  Oli
0
Comment
Question by:novowi
1 Comment
 
LVL 1

Accepted Solution

by:
ergates earned 100 total points
ID: 1351464
This applies to D2. Borland have defined

type
  PKeyboardState = ^TKeyboardState;
  TKeyboardState = array[0..255] of Byte;

for you, so you just need:

var
   KeybStateBuf:TKeyboardState;
begin
   GetKeyboardState(KeybStateBuf);

Regards,
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 55
Working this component WebCopy with proxy, help 3 76
Print Graphic and Text to Epson TM-T88v 12 171
how to update exe applicatio from internet ? 6 67
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now