Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send a keystroke to a hwnd window
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00889676
Message ID:
00889948
Views:
22
I receive 'Cannot find entry point SHOWWINDOW in the DLL.' Has it been removed by any chance in XP? Same thing happens with the SETFOCUS declaration...


>>Talk about streamlining! That's terrific. thanks George!
>>
>Tracy,
>
>You're welcome, but I thought you couldn't use the WSH. If you're still interested in a non-WSH solution, open Notepad and then run the code below (it does require Is_Run32, btw)
#DEFINE KEYEVENTF_KEYUP      2
>#DEFINE VK_SHIFT          0x10
>DECLARE INTEGER SetForegroundWindow IN Win32API;
>  INTEGER hWnd
>DECLARE INTEGER SetActiveWindow IN Win32API;
>  INTEGER hWnd
>DECLARE keybd_event IN Win32API;
>  INTEGER bVk, INTEGER bScan,;
>  INTEGER dwFlags, INTEGER dwExtraInfo
>DECLARE INTEGER ShowWindow IN Win32API;
>  INTEGER hWnd, INTEGER uShow
>DECLARE INTEGER SetFocus IN Win32API AS SetKeybdFocus;
>  INTEGER hWnd
>lcsentence = "The quick brown fox jumped over the lazy dogs"
>lnhWnd = Is_Run32("Notepad")
>IF lnhWnd > 0
>  = ShowWindow(lnhWnd, 9)
>  = SetActiveWindow(lnhWnd)
>  = SetForegroundWindow(lnhWnd)
>  = SetKeybdFocus(lnhWnd)
>  FOR lni = 1 TO LEN(lcsentence)
>    lcchar = SUBSTR(lcsentence, lni, 1)
>    llshift = ISUPPER(lcchar)
>    lnchar = ASC(UPPER(lcchar))
>    IF llshift
>      = keybd_event(VK_SHIFT, 0, 0, 0)
>    ENDIF
>    = keybd_event(lnchar, 0, 0, 0)
>    = keybd_event(lnchar, 0, KEYEVENTF_KEYUP, 0)
>    IF llshift
>      = keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0)
>    ENDIF
>  NEXT
>ENDIF
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform