Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

GetKeyboardState function

Posted on 1997-11-22
1
Medium Priority
?
781 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 200 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

876 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