Tech Support > Microsoft Windows > Customizing > How to run only single instance of Calculator
How to run only single instance of Calculator
Posted by Cindy Winegarden on April 12th, 2006


I found a Registry hack once that would only allow a single instance of
Calculator. Pressing the Calculator button on my keyboard would activate the
Calculator window but not start a new instance. But, I've forgotten how to
do it, and a web/Google search didn't help me find it.

Can anyone help? Thanks!


--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com




Posted by David Candy on April 12th, 2006


You must have started it from a shortcut perhaps. If a hotkey is assigned to a shortcut then it is applied to the window of an app started from it. Hotkey here is Ctrl + Alt + something or an F key rather than calc key.

A C program may be able to assign the calc button to a shortcut. VB and varients can't as the components check to see it's a key listed in help. This is in XP anyway. Before I think it didn't check (for programs - it always checked in the UI).

Internet shortcuts can also have hotkeys. For me till I gave one a shortcut by hand the field didn't appear in the dialog at all for any internet shortcut. Others have reported when upgrading that only existing IS with hotkeys have the field. Go figure that one. IS are text files unlike other shortcuts. This used to be to google and is now to calc (the hotkey is a F key).

[DEFAULT]
BASEURL=file:\\c:\windows\system32\calc.exe
[InternetShortcut]
URL=file:\\c:\windows\system32\calc.exe
Modified=408154AB045EC601E9
IconFile=http://www.google.com.au/favicon.ico
IconIndex=1
Hotkey=122

Feel free to ask more as it will require more research to give more details but this may be enough.



--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
"Cindy Winegarden" <CindyWinegarden@community.nospam> wrote in message news:uBfylufXGHA.4248@TK2MSFTNGP05.phx.gbl...

Posted by Cindy Winegarden on April 13th, 2006


I found the following script which can be the target of the Calculator
shortcut but it's got an error in it and I'm not very good with VBS:

If WindowsFound(Window(Executable:"Calc.exe" Class:"SciCalc"
Title:"Calculator")) Then
SwitchToWindow(Window(Executable:"Calc.exe" Class:"SciCalc"
Title:"Calculator"))
Else
Run(File:"C:\WINDOWS\system32\Calc.exe" StartIn:"C:\WINDOWS\system32\")
End If

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


"David Candy" <.> wrote in message
news:%23GWbTdgXGHA.4120@TK2MSFTNGP03.phx.gbl...
You must have started it from a shortcut perhaps. ....


Posted by David Candy on April 13th, 2006


It calling unknown commands in VBS. There must be more to it. WindowsFound and SwitchToWindow I don't recognise. You probably need this program, which is where your script (http://s10.invisionfree.com/Hotkey_M...ew=getlastpost) came from.

http://s10.invisionfree.com/Hotkey_M...php?act=SC&c=2

--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
"Cindy Winegarden" <CindyWinegarden@community.nospam> wrote in message news:ue3ts8wXGHA.1084@TK2MSFTNGP04.phx.gbl...

Posted by Cindy Winegarden on April 13th, 2006


Yes, that's where I found it and missed the part about the Hotkey Master
program. It wasn't what I had before because I never use stuff that isn't
freeware.

I still can't remember whether the modification was a Registry hack or a
script.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


"David Candy" <.> wrote in message
news:Ox9UTGxXGHA.4920@TK2MSFTNGP02.phx.gbl...
It calling unknown commands in VBS. There must be more to it. WindowsFound
and SwitchToWindow I don't recognise. You probably need this program, which
is where your script
(http://s10.invisionfree.com/Hotkey_M...ew=getlastpost)
came from.


Posted by David Candy on April 14th, 2006


set WshShell = WScript.CreateObject("WScript.Shell")
If WSHShell.AppActivate("Calculator")=False then
WshShell.Run "C:\windows\System32\calc.exe", 1, false
End If

--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
"Cindy Winegarden" <CindyWinegarden@community.nospam> wrote in message news:eGrYsrxXGHA.4432@TK2MSFTNGP04.phx.gbl...

Posted by Cindy Winegarden on April 14th, 2006


Thanks.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


"David Candy" <.> wrote in message
news:%23kHuTf6XGHA.3704@TK2MSFTNGP03.phx.gbl...
set WshShell = WScript.CreateObject("WScript.Shell")
If WSHShell.AppActivate("Calculator")=False then
WshShell.Run "C:\windows\System32\calc.exe", 1, false
End If


Posted by David Candy on April 15th, 2006


I was running late when I posted that and didn't have time to write anything. AppActivate cannot restore windows. If minimised it stays minimised. It can only bring a window to the top of the windows, it can't otherwise change the window.

--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
"Cindy Winegarden" <CindyWinegarden@community.nospam> wrote in message news:%23G9jZP9XGHA.4324@TK2MSFTNGP03.phx.gbl...