🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15040

Re: System wide shortcut

#15040
From: micheal davis
Date: Tue, 22 Jul 2003 22:55
60 lines
2555 bytes
Hi remy,

Thank you so much for your reply I looked over for the RegisterHotKey() and
the WM_HOTKEY.
as for the RegisterHotKeyFunction I think everything is ok, but for the
WM_HOTKEY, I believe I have problem using it, so I will write I used on my
project (based on Delphi sample) and please let me know what I am missing/
doing wrong

//----------------------------in Form 1 Header

HWND dwnd;

//---------------------------in Form 1 CPP

void __fastcall TForm1::FormShow(TObject *Sender)
{

  if(RegisterHotKey(dwnd,1, MOD_CONTROL && MOD_ALT, VK_F6)==true)
  { ShowMessage("assigned Control + ALT  + F6 as hotkey. ");
  }
  else
  { ShowMessage("Can't Assign Control + ALT  + F6 as hotkey. ");
  }

}
//--------------------------------------------------------------------------
-
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{

  UnregisterHotKey(dwnd,1);

}
//--------------------------------------------------------------------------
-

//here comes my problem I don't know how and where shall I put the WM_HOTKEY






"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3f1d62de@newsgroups.borland.com...
>
> "DRE" <dre00x@yahoo.com> wrote in message
> news:3f1d3cf2@newsgroups.borland.com...
>
> > so how I can do such task in code ???
>
> Look at the RegisterHotKey() function in the Win32 API and set up a
message
> handler for the WM_HOTKEY message.
>
>
> Gambit
>
>
Technical Details
Message-ID: <3f1dc0e4@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!wn14feed!wn13feed!wn12feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f1d3cf2@newsgroups.borland.com> <3f1d62de@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,b82a70152a2e1a91
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-22 16:09:26 PST
From: "micheal davis" <micheal_davis@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f1d3cf2@newsgroups.borland.com> <3f1d62de@newsgroups.borland.com>
Subject: Re: System wide shortcut
Date: Tue, 22 Jul 2003 14:55:31 -0800
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 212.103.167.63
Message-ID: <3f1dc0e4@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1058914532 212.103.167.63 (22 Jul 2003 15:55:32 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!wn14feed!wn13feed!wn12feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail