Hello everyone!
How are you doing?
I spent the whole day on this problem, searched Google and the board anda tried many different ways to try to simulate an 'uppercase key' press. But for some reason, the VK_SHIFT gets pressed but is not released.
Here is my code:

MOUSEINPUT struct
mdx DWORD ?
mdy DWORD ?
mouseData DWORD ?
dwFlags DWORD ?
time DWORD ?
dwExtraInfo DWORD ?
MOUSEINPUT ends

KEYBDINPUT struct
wVk WORD ?
wScan WORD ?
mouseData DWORD ?
dwFlags DWORD ?
time DWORD ?
dwExtraInfo DWORD ?
KEYBDINPUT ends

HARDWAREINPUT struct
uMsg DWORD ?
wParamL WORD ?
wParamH WORD ?
HARDWAREINPUT ends

INPUT struct
dwType DWORD ?
union
mi MOUSEINPUT <>
ki KEYBDINPUT <>
hi HARDWAREINPUT <>
ends
INPUT ends

UCKeyPress proc UKey:DWORD
LOCAL KBInput[4]:INPUT
invoke RtlZeroMemory, addr KBInput, SIZEOF KBInput
push esi
lea esi, KBInput
assume esi:PTR INPUT
mov .dwType, INPUT_KEYBOARD
mov .ki.wVk, VK_SHIFT
add esi, SIZEOF INPUT
mov .dwType, INPUT_KEYBOARD
push UKey
pop .ki.wVk
add esi, SIZEOF INPUT
mov .dwType, INPUT_KEYBOARD
push UKey
pop .ki.wVk
mov .ki.dwFlags, KEYEVENTF_KEYUP
add esi, SIZEOF INPUT
mov .dwType, INPUT_KEYBOARD
mov .ki.wVk, VK_SHIFT
mov .ki.dwFlags, KEYEVENTF_KEYUP
invoke SendInput, 4, addr KBInput, SIZEOF INPUT
pop esi
ret
UCKeyPress endp

Can anyone help me with this?
Thanks in advance.
Posted on 2002-08-06 22:03:28 by dilau