Re: Handle / detect <Alt> key combinations



Jatin wrote:

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
GetKeyState, look it up in the win help.
using it to look at other interesting keys when an event takes place.


--
"I'd rather have a bottle in front of me than a frontal lobotomy"

"Daily Thought:

SOME PEOPLE ARE LIKE SLINKIES. NOT REALLY GOOD FOR ANYTHING BUT
THEY BRING A SMILE TO YOUR FACE WHEN PUSHED DOWN THE STAIRS.
http://webpages.charter.net/jamie_5";

.



Relevant Pages

  • Handle / detect key combinations
    ... I have a custom panel component that derives from TCustomPanel. ... 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)
  • Re: Event Handling
    ... private TextArea ta3; ... Panel pan1 = new Panel; ... This line of code is adding TextField to a listener, ... & then adding handler ...
    (comp.lang.java.help)