Reply to post: Re: Configurable multiple instance - single instance

Microsoft flings the Windows Calculator source at GitHub

Robert Carnegie Silver badge

Re: Configurable multiple instance - single instance

Suggestions:

(1) Use a third-party calculator program, or

(2) Use a physical separate calculator (you probably have a calculator in your mobile phone), or

(3) Pin Calculator to your taskbar instead of using the keyboard button, or

(3) Get a utility called "AutoHotkey", which can do scripted automation things in Windows. The simplest might be a script to run from, perhaps, your "calculator" key (AutoHotkey has key mapping skillz), with the function of finding Calculator running and pushing it to foreground, or launching it if not running.

I have a script managing the "Fitaly" on screen keyboard for me that has these features, mainly so that I can also put Fitaly ON the taskbar - by itself it either gets pushed over onto the main desktop, or the taskbar is drawn over Fitaly.

Here. Have fun with program lines that are for a computer I had 10 years ago, or debugging, or to do something else entirely that I no longer remember.

Note that this SCRIPT is made single-instance by an internal command (I think). IIRC running the script again kills the existing instance in this case. Times are set in milliseconds.

; AutoHotkey Version: 1.x

; Language: English

; Platform: Win9x/NT

; Author: Robert Carnegie

;

; Script Function:

; Set the Fitaly on-screen keyboard as top window.

;

#SingleInstance, Force

; MsgBox Version 13:40 11/11/2010

TimeOut:=1000

TimeCheck:=300

TimeAfterLaunch:=5000

Menu, TRAY, Icon, H:\Software\AutoHotkey\Scripts\Fit2a.ico

WinGet, WinTarget1, PID, ahk_class FitalyMainWindow5.02

; WinGet, WinTarget2, PID, Omnis

FocusID:=WinExist("A")

; WinSet, Top, ahk_pid %WinTarget2%

; MsgBox, About to perform WinSet, Top,, ahk_pid %WinTarget1% (Fitaly)

WinSet, Top,, ahk_pid %WinTarget1%

; Sleep, 500

; MsgBox, About to perform WinActivate, ahk_id %FocusID% (previous focus)

; WinActivate, ahk_id %FocusID%

; WinMove, ahk_pid %WinTarget1%, , 000, 000

; WinMove, ahk_pid %WinTarget1%, , 1445, 496

WinMove, ahk_pid %WinTarget1%, , 1445, 783

Loop

{

WinGet, WinTarget1, PID, ahk_class FitalyMainWindow5.02

If WinTarget1

{

IfGreater, A_TimeIdle, %TimeOut%

{

FocusID:=WinExist("A")

; WinSet, Top,, ahk_pid %WinTarget2%

; MsgBox, About to perform WinSet, Top,, ahk_pid %WinTarget1% (Fitaly)

WinSet, Top,, ahk_pid %WinTarget1%

; Sleep, 500

; MsgBox, About to perform WinActivate, ahk_id %FocusID% (previous focus)

; WinActivate, ahk_id %FocusID%

; WinMove, ahk_pid %WinTarget1%, , 000, 000

; WinMove, ahk_pid %WinTarget1%, , 813, 445 ; for 2013 touchscreen

; WinMove, ahk_pid %WinTarget1%, , 1445, 496 ; for Dell Optiplex All In One

; WinMove, ahk_pid %WinTarget1%, , 1445, 716 ; for Dell Optiplex All In One, bottom right

WinMove, ahk_pid %WinTarget1%, , 1445, 783 ; for Dell - Windows 10, bottom right

}

Sleep, %TimeCheck%

}

Else

{

; MsgBox, About to relaunch Fitaly

Run, C:\Program Files (x86)\Fitaly Tablet PC\Fitaly.exe

Sleep, %TimeAfterLaunch%

}

}

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon