Solved

How to use the GetKeyState function.

Posted on 1997-11-21
1
640 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
[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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

617 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