Posted: November 13 2002 at 16:40 | IP Logged
|
|
|
Bob,
Within just the standard Windows Operating System, I know of no way to assign a hotkey to a particular application. Ive seen this kind of thing done with 3rd party applications such as the special keyboards where you can assign an application to a "special" key such as to bring up an MP3 player or Internet Explorer. Once PowerHome is active, then the function hotkeys will work but I guess the trick you're looking for at the moment is to bring PowerHome active.
The WSH or Windows Script Host is just a way to get more programming flexibility out of PowerHome. Instead of writing macros (or in addition to), you can create Windows scripts (in either vbscript or jscript) to perform PowerHome actions.
Yes, other Windows programs can trigger PH macros. This is accomplished through either Windows messaging or the Socket server. If you want the very easiest way to do this, then you can have a Windows application send a message to PowerHome and create a trigger for this message. This trigger could then in turn launch a macro. An example of this would be to execute the Windows API function SendMessage. If you were using VB, you would first need to make a couple of external function declarations:
Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SendMessageA Lib "user32" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
You would then execute this function with this line:
SendMessageA(FindWindowA(0," PowerHome "), 1024, somedata, somemoredata)
Im not a VB programmer so the above may not be "exactly" right but is close enough to get the idea.
You would then create a trigger in PowerHome with a Trigger Type of "WM_USER" and a Trigger ID of "Trigger 1". This trigger could check the somedata and somemoredata fields and execute the appropriate macros or sendkeys.
Hope this helps,
Dave.
|