04-21-2013 02:11 PM
Hi
I use PC Guard for .NET to protect my CVI application. There is a panel with information the
user needs if transfering to another computer. This panel might be invoked by the key combination
CTRL+SHIFT. As CVI reacts on keyboard event how can I pass this along to PC Guard ?
I have a panel callback that process the EVENT_KEYPRESS and if the F12 key is pressed
it issues a FakeKeystroke(VAL_SHIFT_MODIFIER | VAL_MENUKEY_MODIFIER);
It does not work.
04-21-2013 02:45 PM
You could try using Win32 API command SendMessage or PostMessage with message = WM_KEYDOWN and wparam = VK_SHIFT | VK_CONTROL.
I haven't tried myself, but I suppose that FakeKeystroke cannot be used to send modifier keys only.
04-21-2013 03:36 PM
Where do I find that library ?
Can I use a function from shell32.lib ?
Thank you so far...
04-21-2013 05:05 PM
Interface to the Windows 32 API (formerly Windows SDK) is an optional component of CVI. It is not installed by default: you must run custom install to select this option. After that, you have all libraries and files to have access to standard Windows functions and resources, with several examples of what you can do with that. Here a list of functions from those libraries included in the various CVI packages. PostMessage and SendMessage are very basic Windows commands and are included both in Base and Full version of CVI so you should have no problems in using them regardless the version of CVI you are using. Here a small document on how to use them.