Код:
Код: Выделить всё
HotKeySet('{ENTER}', 'OKButton')Если непосредственно над Func OKButton() или внутри, нажатие Enter ничего не дает. А если над while, то работает так, как я описал выше - перехват всех нажатий.
Код: Выделить всё
HotKeySet('{ENTER}', 'OKButton')
Идея с избранным, интересна, конечно, если на флэшке таскать.Код: Выделить всё
; Simple GUI wrapper for regjump http://technet.microsoft.com/en-us/sysinternals/bb963880
; regjump must reside in %path%
; Run the script elevated when UAC is on
#RequireAdmin
#include
Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
Global $hGUI, $hInput, $nButton, $sExePath = "regjump.exe"
$hGUI = GUICreate("JumpReg", 400, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUICtrlCreateLabel("Путь к разделу реестра:", 20, 10)
$hInput = GUICtrlCreateInput("", 20, 30, 360, 20)
$nButton = GUICtrlCreateButton("Jump", 170, 60, 60) ;Registry path input field
GUICtrlSetOnEvent($nButton, "OKButton")
Dim $AccelKeys[1][2]=[["{ENTER}", $nButton]]
GUISetAccelerators($AccelKeys)
GUISetState(@SW_SHOW)
While 1
Sleep(1000) ; Idle around
WEnd
Func OKButton()
Local $sPath = GUICtrlRead($hInput) ;)
If $sPath = "" Then Return 0
Run(@ComSpec & " /c " & $sExePath & " " & $sPath, "", @SW_HIDE)
;Run("regjump.exe" & " " & GUICtrlRead($path), "", @SW_SHOW) ;works, but shows cmd window
EndFunc
Func _Exit()
Exit
EndFunc
;Код: Выделить всё
; Simple GUI wrapper for regjump http://technet.microsoft.com/en-us/sysinternals/bb963880
; regjump must reside in %path%
; Run the script elevated when UAC is on
#include
#include
#include
AutoItSetOption("MustDeclareVars", 1)
AutoItSetOption("GUIOnEventMode", 1) ; Change to OnEvent mode
Local $mainwindow = GUICreate("JumpReg", 400, 100)
GUICtrlCreateLabel("Путь к разделу реестра:", 10, 10)
Local $path = GUICtrlCreateInput("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer", 10, 30, 400 - 10 * 2, 20)
Local $btnJump = GUICtrlCreateButton("Jump", (400 - 120) / 2, 60, 120, 30, $BS_DEFPUSHBUTTON) ;Registry path input field
GUICtrlSetOnEvent($btnJump, "fnOKButton")
GUISetOnEvent($GUI_EVENT_CLOSE, "fnGUIClose")
GUISetState(@SW_SHOW)
While 1
Sleep(100) ; Idle around
WEnd
Func fnOKButton()
Run("regjump.exe """ & GUICtrlRead($path) & """", "");, @SW_HIDE)
EndFunc
Func fnGUIClose()
Exit
EndFuncКод: Выделить всё
Run("regjump.exe """ & GUICtrlRead($path) & """", "", @SW_HIDE)



Лучше нейтральный фон.