Article View: borland.public.cppbuilder.nativeapi
Article #6421Re: IContextMenu for Explorer
From: Remy Lebeau (TeamB)
Date: Mon, 16 May 2005 18:26
Date: Mon, 16 May 2005 18:26
18 lines
1683 bytes
1683 bytes
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message news:4287f6c1@newsgroups.borland.com... > OleCheck(menu->GetCommandString(0, GCS_VERBA, NULL, buffer, 49)); <snip> > Problem: the call to GetCommandString() fails with 'Falscher Parameter' > (Invalid argument??) You need to call the IContextMenu's QueryContextMenu() method before calling GetCommandString(). QueryContextMenu() is what actually sets up the menu items. Without it, there is nothing for GetCommandString() to query. You can use the Win32 API CreatePopupMenu() function to create a temporary hidden HMENU for QueryContextMenu() to fill in, and then you can query the menu for whatever information you need. Gambit
Technical Details
Message-ID:
<4288e58b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.netcologne.de!newsfeed-fusi.netcologne.de!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4287f6c1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7e49abe43ea24b0d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4287f6c1@newsgroups.borland.com> Subject: Re: IContextMenu for Explorer Date: Mon, 16 May 2005 11:26:18 -0700 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <4288e58b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1116267915 68.69.17.41 (16 May 2005 11:25:15 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.netcologne.de!newsfeed-fusi.netcologne.de!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail