Handle / detect <Alt> key combinations



I have a custom panel component that derives from TCustomPanel. In its implementation, I have message handler for WM_KEYDOWN. The handler just posts the message to the application that hosts the panel in its form.

Two of the key combinations that I am interested in detecting are <Alt><Ctrl>F, and also <Ctrl>F. Here's the handler code;

procedure TAppPanel.WMKeyDown(var Message : TWMKeyDown);
begin
if (hwndApp <> 0) then
PostMessage(hwndApp, Message.Msg, Message.CharCode, Message.KeyData);
end;

The handler just posts the message to the application that handles it.

What happens is that when the <Alt><Ctrl>F combination is pressed, the application (whose handle is hwndApp) only receives <Ctrl>F combination, and processes it. Somehow the <Alt> key combination is never received by it. How can I make sure that it also receives <Alt><Ctrl>F combination as well?

Jatin
.



Relevant Pages

  • Re: Handle / detect key combinations
    ... The handler just posts the message to the application that hosts the panel in its form. ... What happens is that when the F combination is pressed, the application (whose handle is hwndApp) only receives F combination, and processes it. ...
    (alt.comp.lang.borland-delphi)
  • Re: SetTimer and WM_TIMER?
    ... > I see many posts about problems with SetTimer but not a solution that ... > fits my case. ... that handler never gets invoked. ...
    (microsoft.public.vc.language)
  • Re: List Event Handler firing twice
    ... but I am not updating the list item in my event ... handler. ... When responding to posts, please "Reply to Group" via your newsreader so ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: How do you set up the OnClick with ASP 2.0 ?
    ... a Click handler during the OnInit phase. ... only if the control was on the postback page. ... Other posts seems to ... Is this the best way to generate a button click event handler, ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)