Also das auslesen klappt perfekt.
(SLI ist ein Record fürs LinkFile)
Delphi-Quellcode:
edHotKey.Text := '';
HotKeyMod := Hi( SLI.HotKey );
cbALT.Checked := (HotKeyMod and HOTKEYF_ALT) = HOTKEYF_ALT;
cbCTRL.Checked := (HotKeyMod and HOTKEYF_CONTROL) = HOTKEYF_CONTROL;
cbSHIFT.Checked := (HotKeyMod and HOTKEYF_SHIFT) = HOTKEYF_SHIFT;
edHotKey.Text := ShortcutToText( SLI.HotKey );
so sind die checkboxen korrekt gesetzt, im edHotKey.Text steht nur der Key.
aber beim schreiben stell ich mich noch zu dumm an
Delphi-Quellcode:
HotKeyMod := 0;
if cbALT.Checked then HotKeyMod := ( HotKeyMod and HOTKEYF_ALT );
if cbCTRL.Checked then HotKeyMod := ( HotKeyMod and HOTKEYF_CONTROL );
if cbSHIFT.Checked then HotKeyMod := ( HotKeyMod and HOTKEYF_SHIFT );
SLI.HotKey := ( Hi( HotKeyMod ) and Lo( TextToShortcut( edHotKey.Text ) ) );