Author |
Topic |
|
plunt
Italy
88 Posts |
Posted - 01/09/2013 : 03:35:05
|
do it is possible add function to S+ receive command via WM_COPYDATA? f.e. acCopyData("acToggleTrayIcon()") immediately, you can issue the command "acToggleTrayIcon()" via sendmessage instead of send key? |
|
Rob
USA
2615 Posts |
Posted - 01/09/2013 : 09:02:27
|
I don't feel most people would ever use this functionality to make it worth adding.
However, if you really want to avoid sending S+ a keystroke, create a hotkey for the desired script and send the STROKESPLUS (class) window a WM_HOTKEY message where wParam = the <HotkeyID> stored in StrokesPlus.xml for that hotkey (lParam is ignored). While the hotkeyID is stored during run-time, it is pretty static. Basically, each <Hotkey> in the <Hotkeys> element is processed in the order which they exist in the file, if it's a valid and active hotkey, it will be assigned a hotkeyID. Once you have your hotkeys defined, the hotkeyID won't change each time S+ runs, so it's safe to use as the wParam parameter for WM_HOTKEY. Even if you add new hotkeys, they will be created at the end so previous hotkeyIDs will remain the same. The only time hotkeyID would change is if a hotkey processed before the hotkey in question is disabled or deleted, since this causes it to be skipped and the hotkeyID in the loop is hotkeyID++ for each valid hotkey (starting at hotkeyID = 1).
Keep in mind that if you're running S+ with elevated privileges, non-elevated processes cannot send messages to S+. Note that if you're running the signed version from a protected folder (Program Files), it is considered elevated even if you don't directly open S+ as admin.
Also note that since S+ is always processing its main window messages, it will process these hotkey messages and fire the action even if S+ is disabled. |
|
|
|
Topic |
|
|
|