Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2003, 05:39 AM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 231
Default RegisterHotKey()...Please Help Me

Hi all,
How can i define a "Hot-key" for my application ? in the other hand i want to hide the main form in the beginning of my app and when the user press the appropriate HotKey,the main form to be shown.is it ok? (please excuse me for my bad spelling and grammatical mistakes).
when i consulted the SDK help ,i find the following API :
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
BOOL RegisterHotKey(
HWND hWnd, // window to receive hot-key notification
int id, // identifier of hot key
UINT fsModifiers, // key-modifier flags
UINT vk // virtual-key code
);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
so i used it as follows:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
begin
Application.Initialize;
Application.CreateForm(TPagesDlg, PagesDlg);
...............
....................
Application.ShowMainForm:=FAlse;
RegisterHotKey(Application.Handle,$100,MOD_CONTROL ,$51); //--> Ctrl+Q
Application.Run;
end.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
But it doesn't work !!! is it possible to help me ?

Best Regards.
Reply With Quote
  #2  
Old 08-02-2003, 06:15 AM
BaraoZemo BaraoZemo is offline
Senior Member
 
Join Date: Nov 2001
Posts: 3,598
Default RE: RegisterHotKey()...Please Help Me

i think that you can create you component, but is more simple use this... (if you want create your own component see the sources)

HotKeyManager v.1.6.0 FWS 256 Kb 24 Mar 2003
By Troels Jakobsen. HotKeyManager is a component that allows you to add system-wide hotkeys to your application. A system-wide hotkey allows your app. to invoke a custom action from anywhere. Your application doesn't have to be in the foreground or even visible.
4 demos included (1 exe-demo).

D4 D5 D6 D7
http://www.torry.net/vcl/system/keys/tdhotkeymg.zip

Regards
BaraoZemo

ps, donīt forget to Accept as Answer if this helped you!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 05:25 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.