Solved

GetKeyboardState function

Posted on 1997-11-22
1
756 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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