I've assigned a keyboard shortcut to start the Calculator utility, I
do not want many calculator instances to start. I just want it to
bring up the existing started calculator if I press the keys (if calc
is started and running in the background)
Possible ?
Some applications, e.g. Outlook Express, are written so that only a single
instance of them will run. Others, e.g. notepad, can run in multiple
instances. The native Windows calculater belongs to the second group. To get
around the issue you could program your shortcut so that invokes the file
below. Note that the method is a little sluggish becaus it takes time to
check if the Calculator is already active.
Set WShell = WScript.CreateObject("WScript.Shell")
Set cTasks = CreateObject("Word.Application").Tasks
For Each oTask In cTasks
If InStr(1, oTask, "Calculator", 1) > 0 Then
WShell.AppActivate "Calc"
WScript.Quit
End If
Next
WShell.Exec("calc")
Instructions:
1. Save the above code to c:\MyCalc.vbs.
2. Link your calculator shortcut to c:\MyCalc.vbs.