Solved

GetKeyboardState function

Posted on 1997-11-22
1
741 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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

13 Experts available now in Live!

Get 1:1 Help Now