Re: Orphaned Popups?

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Sun, 23 Mar 2003 20:13:22 -0500, Greg Haberek <g.haberek at comcast.net> 
wrote:

>
> How would I create a Popup menu in Win32Lib with no parent, or the Screen 
> as a parent? I am
> using PatRat's Systray.ew to create a System Tray icon and I want a menu 
> to popup when the user
> clicks the icon.
>
> If I try to create a Popup with no parent, I get a "getHandle() failed" 
> error.
> If I try to create a Popup with Screen as a parent, I get a 
> "ClientToScreen failed" error.
>

Hi Greg,
a couple of questions first.

What problem is caused by having the Popup menu use a parent?

Have you tried using a non-visible parent?

Now, the reason you need a parent is that win32lib calls the API routine 
"TrackPopupMenu" to manage it. And this routine needs a handle to a window 
so that messages can be passed to something. Your application needs to 
receive WM_NOTIFY etc messages to know which menu item has been clicked.


-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu