Code: Select all
#c::
IfWinExist Calculator
WinActivate
Else
Run C:\Windows\System32\calc.exe
return
Code: Select all
#c::
IfWinExist Calculator
WinActivate
Else
Run C:\Windows\System32\calc.exe
return
Code: Select all
#c::
If(WinExist("ahk_class CalcFrame"))
WinActivate,
else
Run C:\Windows\System32\calc.exe
return
Code: Select all
#c::
IfWinExist Calculator ahk_class ApplicationFrameWindow
WinActivate
else
{
Run calc
WinWait, Calculator
WinActivate
}
return
Code: Select all
#c::
if WinExist("Calculator ahk_exe ApplicationFrameHost.exe")
WinActivate
else
Run calc
Return
Code: Select all
#c:: ; Win+C
if not WinExist("ahk_class CalcFrame")
{
Run, calc.exe
}
else
{
WinActivate, ahk_class CalcFrame
}
return
Code: Select all
sc:="ahk_exe ApplicationFrameHost.exe"
#c::
if WinExist(sc)
WinActivate
else
Run calc
Return
Code: Select all
NumpadMult & NumpadSub Up::
If WinExist("Calculator ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe")
WinActivate
Else
ShellRun(A_WinDir "\system32\calc.exe")
Return
Code: Select all
;- ( have no problem with notepad.exe , start /minimize/show )
;- I need the german word 'Rechner' instead of 'Calculator' or maybe > how to use PID1
;- I start calc.exe but calculator.exe is running
;--------------------------------------------------------------------------------
; - used german word 'Rechner' in this case , replace with 'Calculator' for english
sc:="Rechner ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe"
#c::
xx=calculator.exe
process,exist,%xx%
pid:=errorlevel
if pid<>0
{
winactivate,%sc%
;winactivate,ahk_class ahk_pid %PID1% ;- NOT OK
}
else
run,calc,,,pid1
return
Code: Select all
sc:="Calculator ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe"
#c::
xx=calculator.exe
process,exist,%xx%
pid:=errorlevel
if pid<>0
{
winactivate,%sc%
;winactivate,ahk_class ahk_pid %PID1% ;- NOT OK
}
else
run,calc,,,pid1
return
#x:: ; <-- Open/Activate/Minimize Windows Calculator
{
if WinExist("Calculator ahk_class CalcFrame") or WinExist("Calculator ahk_class ApplicationFrameWindow")
if WinActive()
WinMinimize
else
WinActivate
else
Run calc.exe
return
}
#numpad1::
If WinExist("Calculator ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe")
WinActivate
Else
(A_WinDir "\system32\calc.exe")
Return
Code: Select all
;--- example german : Rechner / calculator.exe
sc1:="Rechner ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe"
;sc1:="Calculator ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe"
$F9::
xa=calculator.exe
process,exist,%xa%
pid1:=errorlevel
if pid1<>0
winactivate,%sc1%
else
run,calc
return
Code: Select all
{ ; Calculatrice (F8)
F8::
DetectHiddenWindows, on
If WinExist("Calculatrice ahk_exe ApplicationFrameHost.exe")
{
If WinActive("Calculatrice")
;WinMinimize
WinKill
else
{
WinActivateBottom, Calculatrice ahk_exe ApplicationFrameHost.exe
WinActivate, Calculatrice ahk_exe ApplicationFrameHost.exe
}
}
else
{
Run, Calc.exe
WinWait, Calculatrice,,1
WinMove, Calculatrice,, A_ScreenWidth-320, (A_ScreenHeight/A_ScreenHeight+250), 320, 500 ; Minimum size x320 y500
WinSet, AlwaysOnTop
}
return
}
Code: Select all
F8::
CalcTitle := "Calculatrice ahk_exe ApplicationFrameHost.exe"
if WinExist(CalcTitle) {
WinActivateBottom, %CalcTitle%
WinActivate, %CalcTitle%
} else {
Run, Calc.exe
}
return
Code: Select all
F8::
CalcTitle := "Rechner ahk_exe ApplicationFrameHost.exe"
if WinExist(CalcTitle) {
;WinActivateBottom, %CalcTitle% ;- is this needed ?
WinActivate, %CalcTitle%
} else {
Run, Calc.exe
}
return
Users browsing this forum: Bing [Bot], mikeyww and 95 guests