Jump to content

Recommended Posts

Posted

Hello!

I have a problem with the UDF GuiHotKey

How can I save the key to use it with re-open ?

#include <GUIConstantsEx.au3>
#include <GUIHotKey.au3>
#include <File.au3>

Global $HK, $VK
$file = "save.txt"

$hForm = GUICreate("MyGUI", 300, 92)
$hHotKey = _GUICtrlHotKey_Create($hForm, _GUICtrlHotKey_MakeKeyCode($HOTKEYF_ALT, $VK_F5), 20, 20, 260, 19)
$Button = GUICtrlCreateButton('OK', 115, 54, 70, 23)

GUISetState(@SW_SHOW,$hForm)

$openre = FileOpen($file,0)
$read = FileReadLine($openre,1)

HotKeySet($read, "ShowMessage")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Button
$Code = _GUICtrlHotKey_GetHotKey($hHotKey)
_GUICtrlHotKey_GetKeys($Code, $HK, $VK)
GUISetState(@SW_HIDE,$hForm)
_FileWriteToLine($file, 1, $Code, 1)
EndSwitch
WEnd

Func ShowMessage()
GUISetState(@SW_SHOW,$hForm)
MsgBox(0,"","reactivate")
EndFunc

GuiHotKey.au3

HotKeyConstants.au3

Posted

Hi,

The Keycodes used with the GUIHotKey are not the same as the function HotKeySet.

You need to use in addition the HotKey UDF from the same author.

Br, FireFox.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...