当我5 + 5 * 6
在 Windows 计算器中输入时,我得到的是60
。看来 Windows 忽略了运算顺序。
一个潜在的解决方案是更改注册表项这样它就以科学模式(视图 > 科学模式,或 Alt-F2)启动,并遵循操作顺序。
我希望用户不会接触到科学模式中的所有附加按钮,或者我不必用第三方解决方案替换默认计算器。我意识到这可能是仅有的两个选择。我只是想知道是否有人想出了我还没有想到的解决方案。
答案1
也许你想尝试一些脚本,我专门为你制作了这个脚本,这是自动脚本,如果你看不懂,我可以提供编译后的代码,基本上这个脚本会把默认的 Windows 计算器的外观改成你想要的样子,
If Not WinExists("[CLASS:CalcFrame]") Then Run("calc.exe")
WinWait("[CLASS:CalcFrame]")
For $i = 29 to 55
$ins = "[CLASS:Button; INSTANCE:" & $i & "]"
ControlMove( "[CLASS:CalcFrame]", "", $ins, -100, -100)
Next
For $i = 1 to 28
$ins = "[CLASS:Button; INSTANCE:" & $i & "]"
$pos = ControlGetPos ( "[CLASS:CalcFrame]", "", $ins)
ControlMove( "[CLASS:CalcFrame]", "", $ins, $pos[0] - 206, $pos[1] -65)
Next
ControlMove( "[CLASS:CalcFrame]", "", "[CLASS:Static; INSTANCE:6]", -100, -100)
ControlMove( "[CLASS:CalcFrame]", "", "[CLASS:Static; INSTANCE:7]", -100, -100)
$pos = ControlGetPos ( "[CLASS:CalcFrame]", "", "[CLASSNN:#327701; INSTANCE:1]")
ControlMove( "[CLASS:CalcFrame]", "", "[CLASSNN:#327701; INSTANCE:1]", $pos[0] -182, $pos[1] ,$pos[2],$pos[3])
ControlMove( "[CLASS:CalcFrame]", "", "[CLASS:Static; INSTANCE:1]", $pos[0] -182, $pos[1] ,$pos[2],$pos[3])
$pos = WinGetPos ("[CLASS:CalcFrame]")
WinMove ( "[CLASS:CalcFrame]", "", $pos[0], $pos[1] ,$pos[2] - 195,$pos[3])
$hWnd = WinGetHandle ("[CLASS:CalcFrame]")
DllCall("user32.dll", "bool", "RedrawWindow", "hwnd", $hWnd, "struct*", 0, "handle", 0, "uint", 5)