🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Binding popup menu of another program

#11898
From: Remy Lebeau (TeamB)
Date: Sat, 10 Jan 2004 03:44
34 lines
2192 bytes
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message
news:3fff5912$1@newsgroups.borland.com...

> I am able to click the button from my controller program
> and the popup menu shows up. However, how can I get
> this popup menu?

You don't need to.  If you use WinSight or Spy++, you can find out the ID
numbers for each item on the popup menu, and then just put the desired IDs
into your code.  When you want to trigger an item, you can simply send a
WM_COMMAND command to the external window, specifying the ID of the desired
menu item that you want "clicked".  Then you don't have to mess around with
the button or the popup menu itself at all.

> The other program is written in Delphi so I assume
> that the popup has TPopupMenu as classname.

Makes no difference, that won't help you even if you were to try controlling
the popup menu itself.

> I then tried to use FindWindow/FindWindowEx to find the menu.

Those do not work for menus.

> The main problem is that I can't use Spy++ to check this
> out because the popup menu of course disappears when
> I switch to Spy++.

You don't need to examine the menu itself.  Just examine the WM_COMMAND
messages that it generates.


Gambit
Technical Details
Message-ID: <3fff73b1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fff5912$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5d250d2ded0985aa
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-09 19:39:44 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fff5912$1@newsgroups.borland.com>
Subject: Re: Binding popup menu of another program
Date: Fri, 9 Jan 2004 19:44:30 -0800
Lines: 36
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: 67.22.138.253
Message-ID: <3fff73b1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073705905 67.22.138.253 (9 Jan 2004 19:38:25 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail