Solved

GetKeyboardState function

Posted on 1997-11-22
1
762 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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