Article View: borland.public.cppbuilder.nativeapi
Article #17459Re: System Menu
From: RaynorPao
Date: Tue, 25 Mar 2003 06:34
Date: Tue, 25 Mar 2003 06:34
46 lines
2661 bytes
2661 bytes
Hi Remy:
Thanks for your reply.
The problem is solved perfectly.
Thank you very much....^_^
RaynorPao.
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> ���g��l��
news:3e7fec3b@newsgroups.borland.com...
> After playing with it a bit, it would appear that when allowing the system
> menu in behavior in its native manner, it sends WM_SYSCOMMAND commands to
> the form, but when using TrackPopupMenu() it sends WM_COMMAND messages
> instead. That difference is confusing the VCL as to what to do with them,
> since those two messages have different implementations.
>
> To make it work correctly, you have to take the return value of
> TrackPopupMenu() (which you're already specifying the TPM_RETURNCMD flag
> for, you're just not using the actual return value) and then manually send
> WM_SYSCOMMAND to the form, ie:
>
> HMENU hMenu = GetSystemMenu(Form1->Handle, FALSE);
> int nCmd = TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,
> Form1->Left+10, Form1->Top+10, 0, Form1->Handle, NULL);
> if( nCmd )
> {
> TMessage Message;
> Message.Msg = WM_SYSCOMMAND;
> Message.WParam = nCmd;
> Message.LParam = 0;
> Form1->WndProc(Message);
> }
>
>
> Gambit
>
> "RaynorPao" <RaynorPao.nospam@nospam.pchome.com.tw> wrote in message
> news:3e7fdee7@newsgroups.borland.com...
>
> > The System Menu can be display on my Form.
> > But when I click "Exit"....It will not close my
> > Form(Exit Application).
> <snip>
>
>
>
Technical Details
Message-ID:
<3e7ff4a2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e7fbdfa@newsgroups.borland.com> <3e7fc449@newsgroups.borland.com> <3e7fc5d6@newsgroups.borland.com> <3e7fce0e$1@newsgroups.borland.com> <3e7fdee7@newsgroups.borland.com> <3e7fec3b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,ef942edb0660a72e X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-24 22:22:29 PST From: "RaynorPao" <RaynorPao.nospam@nospam.pchome.com.tw> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e7fbdfa@newsgroups.borland.com> <3e7fc449@newsgroups.borland.com> <3e7fc5d6@newsgroups.borland.com> <3e7fce0e$1@newsgroups.borland.com> <3e7fdee7@newsgroups.borland.com> <3e7fec3b@newsgroups.borland.com> Subject: Re: System Menu Date: Tue, 25 Mar 2003 14:34:40 +0800 Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 NNTP-Posting-Host: 203.73.124.171 Message-ID: <3e7ff4a2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1048573090 203.73.124.171 (24 Mar 2003 22:18:10 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail