Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2006 Mar : Using the TInput Record
| Subject: | Using the TInput Record |
| Posted by: | "Sean Farrow" (s02016..@newi.ac.uk) |
| Date: | 23 Mar 2006 15:22:10 |
Hi:
I am currently needing to use the win32 api sendInput and TInput function and structure respectively to send input to an application. When I use the following code the project does not compile, with out the code my activex project compiles successfully.
The following variables are declared in the units header:
HalStart, HalStop: array[0..7] of TInput;
Then In a Procedure the following code does not seem to compile:
//HalStart.
HalStart[0].Itype :=INPUT_KEYBOARD;
HalStart[0].ki.wVk :=VK_CONTROL;
HalStart[1].Itype :=INPUT_KEYBOARD;
HalStart[1].ki.wVk :=VK_SHIFT;
HalStart[2].Itype :=INPUT_KEYBOARD;
HalStart[2].ki.wVk :=VK_MENU;
HalStart[3].Itype :=INPUT_KEYBOARD;
HalStart[3].ki.wVk :=VK_F5;
HalStart[4].Itype :=INPUT_KEYBOARD;
HalStart[4].ki.wVk :=VK_F5;
HalStart[4].ki.dwFlags :=KEYEVENTF_KEYUP;
HalStart[5].Itype :=INPUT_KEYBOARD;
HalStart[5].ki.wVk :=VK_SHIFT;
HalStart[5].ki.dwFlags :=KEYEVENTF_KEYUP;
HalStart[6].Itype :=INPUT_KEYBOARD;
HalStart[6].ki.wVk :=VK_MENU;
HalStart[6].ki.dwFlags :=KEYEVENTF_KEYUP;
HalStart[7].Itype :=INPUT_KEYBOARD;
HalStart[7].ki.wVk :=VK_CONTROL;
HalStart[7].ki.dwFlags :=KEYEVENTF_KEYUP;
//HalStop.
HalStop[0].Itype :=INPUT_KEYBOARD;
HalStop[0].ki.wVk :=VK_CONTROL;
HalStop[1].Itype :=INPUT_KEYBOARD;
HalStop[1].ki.wVk :=VK_SHIFT;
HalStop[2].Itype :=INPUT_KEYBOARD;
HalStop[2].ki.wVk :=VK_MENU;
HalStop[3].Itype :=INPUT_KEYBOARD;
HalStop[3].ki.wVk :=VK_F6;
HalStop[4].Itype :=INPUT_KEYBOARD;
HalStop[4].ki.wVk :=VK_F6;
HalStop[4].ki.dwFlags :=KEYEVENTF_KEYUP;
HalStop[5].Itype :=INPUT_KEYBOARD;
HalStop[5].ki.wVk :=VK_SHIFT;
HalStop[5].ki.dwFlags :=KEYEVENTF_KEYUP;
HalStop[6].Itype :=INPUT_KEYBOARD;
HalStop[6].ki.wVk :=VK_MENU;
HalStop[6].ki.dwFlags :=KEYEVENTF_KEYUP;
HalStop[7].Itype :=INPUT_KEYBOARD;
HalStop[7].ki.wVk :=VK_CONTROL;
HalStop[7].ki.dwFlags :=KEYEVENTF_KEYUP;
If anyone has any idea why this code is not working I'd be grateful.
Regards
Sean