2019-01-04 20:04:09 -06:00
|
|
|
SendMode Input
|
|
|
|
|
Menu, Tray, Icon, shell32.dll, 166
|
|
|
|
|
|
2020-09-01 11:39:25 -05:00
|
|
|
; 2020-02-06 - added privilege elevation
|
|
|
|
|
GoSub, RunAdmin
|
2019-01-04 20:04:09 -06:00
|
|
|
|
|
|
|
|
f9::
|
|
|
|
|
Gosub, ShowGui
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
ButtonOK:
|
|
|
|
|
Gui, Submit
|
|
|
|
|
Gui, Destroy
|
|
|
|
|
|
|
|
|
|
if (MyRadioGrid = 1) { ; remember what was checked last...
|
|
|
|
|
Mode := "Grid"
|
|
|
|
|
} else if (MyRadioProperties = 1) {
|
|
|
|
|
Mode := "Prop"
|
|
|
|
|
} else if (MyRadioPropertiesParent = 1) {
|
|
|
|
|
Mode := "PropParent"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RegWrite, REG_SZ, HKEY_CURRENT_USER\Software\Hammerer, EntryMode, %Mode%
|
|
|
|
|
|
|
|
|
|
;aOrder := [1,1,1,1,2,1,2,1,3,1,2,1,2,1,2,1,2,1]
|
|
|
|
|
;RegRead, EntryOrder, HKEY_CURRENT_USER\Software\Hammerer, EntryOrder
|
|
|
|
|
aOrder := StrSplit(EntryOrder , ",")
|
|
|
|
|
|
|
|
|
|
Loop % aOrder.Length()
|
|
|
|
|
{
|
|
|
|
|
currEle=% aOrder[A_Index]
|
|
|
|
|
toSendText=% Texts%currEle%
|
|
|
|
|
if (toSendText = "") {
|
|
|
|
|
toSendText = % Texts0
|
|
|
|
|
}
|
|
|
|
|
; If the text is empty (that is not a blank) then don't change
|
|
|
|
|
; (Blank will change to blank)
|
|
|
|
|
if (toSendText != "") {
|
|
|
|
|
send % toSendText
|
|
|
|
|
send {enter}
|
|
|
|
|
} else {
|
|
|
|
|
if (Mode = "Grid"){
|
|
|
|
|
send {enter}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Mode != "Grid"){
|
|
|
|
|
send {down}
|
|
|
|
|
if (Mode = "PropParent") {
|
|
|
|
|
send {down}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sleep, 150
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
ButtonApply:
|
|
|
|
|
Gui, Submit
|
|
|
|
|
|
|
|
|
|
RegWrite, REG_SZ, HKEY_CURRENT_USER\Software\Hammerer, LanguageList, %LanguageList%
|
|
|
|
|
RegWrite, REG_SZ, HKEY_CURRENT_USER\Software\Hammerer, EntryOrder, %EntryOrder%
|
|
|
|
|
MsgBox, Changes Applied
|
|
|
|
|
Gosub, ShowGui
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
ButtonCancel:
|
|
|
|
|
Gui, Destroy
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
PasteButton:
|
|
|
|
|
index:=SubStr(A_GuiControl,2)
|
|
|
|
|
GuiControl,,Texts%index%,%clipboard%
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
ButtonBulkPaste:
|
2020-01-07 11:32:21 -06:00
|
|
|
aStrings := StrSplit(StrReplace(Clipboard, "`r`n"), "|")
|
2019-01-04 20:04:09 -06:00
|
|
|
|
|
|
|
|
Loop % aStrings.Length() {
|
|
|
|
|
GuiControl,,Texts%A_Index%, % aStrings[A_Index]
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
ShowGui:
|
|
|
|
|
Gui, Destroy
|
|
|
|
|
Gui, Add, Text,x5 y5 ,0-Fallback
|
|
|
|
|
Gui, Add, Edit,x100 y5 vTexts0
|
|
|
|
|
; Gui, Add, CheckBox, x220 y5 vSkip0,
|
|
|
|
|
Gui, Add, Button, x75 y5 gPasteButton, P0
|
|
|
|
|
;aLang := ["English","Spanish","Portuguese"]
|
|
|
|
|
RegRead, LanguageList, HKEY_CURRENT_USER\Software\Hammerer, LanguageList
|
|
|
|
|
if (StrLen(LanguageList) == 0) {
|
|
|
|
|
LanguageList := "German,English"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aLang := StrSplit(LanguageList, ",")
|
|
|
|
|
|
|
|
|
|
yPos := 35
|
|
|
|
|
Loop % aLang.Length() {
|
|
|
|
|
Gui, Add, Text,x5 y%yPos% , % A_Index "-" aLang[A_Index]
|
|
|
|
|
Gui, Add, Edit,x100 y%yPos% vTexts%A_Index%
|
|
|
|
|
; Gui, Add, CheckBox, x220 y%yPos% vSkip%A_Index%,
|
|
|
|
|
Gui, Add, Button, x75 y%yPos% gPasteButton, P%A_Index%
|
|
|
|
|
yPos += 30
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RegRead, EntryMode, HKEY_CURRENT_USER\Software\Hammerer, EntryMode
|
|
|
|
|
|
|
|
|
|
if (EntryMode = "Grid") { ; remember what was checked last...
|
|
|
|
|
CheckedGrid=Checked
|
|
|
|
|
CheckedProp=
|
|
|
|
|
CheckedPropParent=
|
|
|
|
|
} else if (EntryMode = "Prop") {
|
|
|
|
|
CheckedProp=Checked
|
|
|
|
|
CheckedGrid=
|
|
|
|
|
CheckedPropParent=
|
|
|
|
|
} else { ; PropParent
|
|
|
|
|
CheckedProp=
|
|
|
|
|
CheckedGrid=
|
|
|
|
|
CheckedPropParent=Checked
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gui, Add, GroupBox, x300 y0 w200 h90, Mode
|
|
|
|
|
Gui, Add, Radio, x305 y20 vMyRadioGrid %CheckedGrid%, Grid
|
|
|
|
|
Gui, Add, Radio, vMyRadioProperties %CheckedProp%, Properties
|
|
|
|
|
Gui, Add, Radio, vMyRadioPropertiesParent %CheckedPropParent%, Properties With Parent
|
|
|
|
|
|
|
|
|
|
Gui, Add, Button, x300 y95 w67 gButtonBulkPaste, BulkPaste
|
|
|
|
|
Gui, Add, Button, x367 y95 w67 default gButtonOK, OK
|
|
|
|
|
Gui, Add, Button, x434 y95 w67 gButtonCancel, Cancel
|
|
|
|
|
|
|
|
|
|
if (yPos < 95) {
|
|
|
|
|
yPos := 95
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
yPos += 30
|
|
|
|
|
Gui, Add, Text,x5 y%yPos%,LanguageList
|
|
|
|
|
Gui, Add, Edit,x100 y%yPos% w400 vLanguageList, % LanguageList
|
|
|
|
|
|
|
|
|
|
yPos += 30
|
|
|
|
|
RegRead, EntryOrder, HKEY_CURRENT_USER\Software\Hammerer, EntryOrder
|
|
|
|
|
if (StrLen(EntryOrder) == 0) {
|
|
|
|
|
EntryOrder := "1,2,1,2"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gui, Add, Text,x5 y%yPos%,EntryOrder
|
|
|
|
|
Gui, Add, Edit,x100 y%yPos% w400 vEntryOrder, % EntryOrder
|
|
|
|
|
|
|
|
|
|
yPos += 30
|
|
|
|
|
Gui, Add, Button, x5 y%yPos% w495 gButtonApply, Apply LanguageList and EntryOrder
|
|
|
|
|
|
|
|
|
|
yPos += 30
|
2020-09-01 11:39:25 -05:00
|
|
|
Gui, Show, h%yPos% w505, [Hammerer] version 2020-02-06 joe.tretter@kcc.com
|
2019-01-04 20:04:09 -06:00
|
|
|
return
|
2020-09-01 11:39:25 -05:00
|
|
|
|
|
|
|
|
; Run as admin
|
|
|
|
|
RunAdmin:
|
|
|
|
|
If !A_IsAdmin
|
|
|
|
|
{
|
|
|
|
|
if A_OSVersion not in WIN_2003,WIN_XP,WIN_2000
|
|
|
|
|
{
|
|
|
|
|
Run % "*RunAs " DllCall( "GetCommandLineW", "Str" ),, UseErrorLevel
|
|
|
|
|
if !ErrorLevel
|
|
|
|
|
ExitApp
|
|
|
|
|
}
|
|
|
|
|
MsgBox 0x31, Hammerer,
|
|
|
|
|
(LTrim Join`s
|
|
|
|
|
Hammere is running as a limited user. If you continue,
|
|
|
|
|
it will most likely not be able to interact with CAS Modeler.
|
|
|
|
|
`n
|
|
|
|
|
To continue anyway, click OK. Otherwise click Cancel.
|
|
|
|
|
)
|
|
|
|
|
IfMsgBox, Cancel
|
|
|
|
|
ExitApp
|
|
|
|
|
}
|
|
|
|
|
Return
|