Solved

How to use the GetKeyState function.

Posted on 1997-11-21
1
636 Views
Last Modified: 2012-05-04
Hi,

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


var
KeyStateBuf:TByteArray;
pKeyStateBuf:PByte;


begin

pKeyStateBuf:=addr(KeyStateBuf);
GetKeyStateBuf(pKeyStateBuf);

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 3

Accepted Solution

by:
mirek071497 earned 100 total points
ID: 1351397
This is definition :

function GetKeyState(nVirtKey: Integer): SHORT; stdcall;


so you need to use integer to retrive the virtual key code.
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

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…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

919 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

18 Experts available now in Live!

Get 1:1 Help Now