Sign in to follow this  
Followers 0
unuro

GuiHotKey UDF - Save settings - Problem

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0