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

x
?
Solved

How to use the GetKeyState function.

Posted on 1997-11-21
1
Medium Priority
?
642 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 300 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline
Suggested Courses

773 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