Data transfer via the system keyboard buffer? (VFP9)
Using a Visual FoxPro 9 executable file, (EXE), I need to be able to place data into the syst开发者_如何学运维em keyboard buffer which is then to be picked up by another program, (non-FoxPro). I've already tried using the KEYBOARD command, however, that only seems to work with fields and controls within the FoxPro application! Does anyone have any ideas on how this can be accomplished?
You'll need to call into the Win32 API - keybd_event is probably the call you want as SendInput uses structs, which are a pain in VFP. There's sample code here.
Do you mean to copy to the clipboard? If so, here are two ways. The first example copies a string to the clipboard. The second example copies a table/cursor to the clipboard.
_cliptext = "test"
_vfp.DataToClip(SELECT(ALIAS()), RECCOUNT() + 1, 3)
精彩评论