Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Hotkey speichern und laden (https://www.delphipraxis.net/44500-hotkey-speichern-und-laden.html)

MisterNiceGuy 20. Apr 2005 09:06


Hotkey speichern und laden
 
HI ich will für mein Programm einen Hotkey vergeben, den dann in einer IniDatei speichern und
beim nächsten Progammstart wieder laden.

Gespeichert wird er als Cardinal (?), das geht, aber laden will er ihn dann nicht mehr :/

Speichern:
Delphi-Quellcode:
    ini.WriteInteger('HK','leiser',hotkey1.HotKey);
    ini.WriteInteger('HK','lauter',hotkey2.HotKey);
    ini.WriteInteger('HK','aus',hotkey3.HotKey);
Laden:
Delphi-Quellcode:
    hotkey1.HotKey := ini.ReadInteger('HK','leiser',0);
    hotkey1.HotKey := ini.ReadInteger('HK','lauter',0);
    hotkey1.HotKey := ini.ReadInteger('HK','aus',0);

Christian Seehase 20. Apr 2005 21:37

Re: Hotkey speichern und laden
 
Moin MisterNiceGuy,

ist das jetzt nur hier so, oder hast Du auch in Deinem Programm als Ziel dreimal den gleichen Hotkey?

Fossibaer58809 20. Apr 2005 22:22

Re: Hotkey speichern und laden
 
Ich würde bei den spärlichen Informationen (geht nicht) trotzdem mal tippen, dass der folgende Quelltext besser funktioniert.

Delphi-Quellcode:
hotkey1.HotKey := TShortCut(ini.ReadInteger('HK','leiser',0));
    hotkey1.HotKey := TShortCut(ini.ReadInteger('HK','lauter',0));
    hotkey1.HotKey := TShortCut(ini.ReadInteger('HK','aus',0));
Gruß
Michael

MisterNiceGuy 21. Apr 2005 15:06

Re: Hotkey speichern und laden
 
hi :) Ne im Programm sind das schon Hotkey 1,2 und 3.

Danke für die Info!

Fossibaer58809 21. Apr 2005 18:51

Re: Hotkey speichern und laden
 
:gruebel:

Ich meinte den Typecast von integer auf TShortCut.

Gruß
Michael


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:46 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz