Hi!
I just do not know. Maybe "Alt+P" is processed by VFP by menu when KEYBOARD is used? THere might be special logic for all "Alt+*" keys.
>Thanks for your response. I'll be following your suggestions about looking into the API.
>
>However, what is it about the way the KEYBOARD buffer is handled so that {TAB} and {ENTER} and {UPARROW}, etc. work but {ALT+P} and {SPACEBAR} won't?
>
>Thanks.........Rich
>
>
>>Hi!
>>
>>KEYBOARD place the keystrokes into the
internal VFP keyboard buffer. This means that KEYBOARD will affect only VFP forms, controls, dialog boxes and other windows. ActiveX controls work from their own exeutable/DLL modules and use separate window handles, never related to VFP internal buffers. As a resul, KEYBOARD does not works for any ActiveX controls or any windows opened by ActiveX.
>>
>>You should use the Windows API functions to simulate keystrokes on the Windows level, so Windows will pass keys to the active window. Take a look to the "keybd_event" Windows API function.
>>
>>HTH.
>>
>>>I've placed the MS Common Dialog Control on a form so that I can manipulate some printer properties. I'm finding that sending keystrokes via the KEYBOARD command does not give the same result as manually keyboarding the entries. For example
>>>
>>>MsComDiagCtl.ShowPrinter() followed by manually pressing ALT-P brings up the properties screen. However
>>>
>>>KEYBOARD "{ALT+P}"
>>>MsComDiagCtl.ShowPrinter()
>>>
>>>has no effect. Neither "{ALT-P}" nor "{ALT P}" work. However
>>>
>>>KEYBOARD "{TAB}{ENTER}"
>>>MsComDiagCtl.ShowPrinter()
>>>
>>>does work. In the same way, once I get to the properties screen I can tab (3 tabs) into the checkbox field I want and press SpaceBar to toggle it. But.....
>>>
>>>
>>>KEYBOARD "{TAB}{TAB}{TAB}{SPACEBAR}"
>>>msComDiagCtl.ShowPrinter()
>>>
>>>shows the correct checkbox having focus, but the toggle not having been done.
>>>
>>>I've been able to replicate this on another workstation.
>>>
>>>Have I missed something in the way I'm assuming KEYBOARD to work? Has anyone else come across this?
>>>
>>>Thanks to all..........Rich
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.