Re: Orphaned Popups?
- Posted by Greg Haberek <g.haberek at comcast.net> Mar 25, 2003
- 380 views
Thanks Jordah! TrackPopupMenuEx works, but.... The Popup menu doesn't disappear right away if I click off of it. Rather, it seems to 'time out' after 2 or 3 seconds... Is there any way I can speed this up? Or force it to close? ----- Original Message ----- From: <jordah at btopenworld.com> Subject: Re: Orphaned Popups? ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: "EUforum" <EUforum at topica.com> Sent: Monday, March 24, 2003 11:52 AM Subject: Re: Orphaned Popups? > > ----- Original Message ----- > From: <pampeano at rocketmail.com> > To: "EUforum" <EUforum at topica.com> > Sent: Monday, March 24, 2003 10:33 PM > Subject: Re: Orphaned Popups? > > > > Hi Greg, > > Try this modified systray_event routine, i'm sure it'll work. > > > > procedure SysTray_onEvent(integer id, atom msg) > > sequence pos > > > > if msg = LeftDown then > > -- Changes start here > > pos = getPointerPos() > > pos = ClientToScreen(Main,pos[1],pos[2]) > > -- Changes end here > > popup( MyPopup, pos[1], pos[2] ) > > repaintWindow( Main ) > > wPuts( Main, sprintf("Clicked (%d, %d)", pos) ) > > end if > > > > end procedure > > > > Best Regards, > > Guillermo Bonvehi > > AKA: KNiXEUR - Caballero Rojo > > > Not really. The getPointerPos() already returns the pointer position > relative to the screen. I suggest that he needs to call the GetMenuRect API > call to find the dimensions of the popup menu, then calculate the top-left > corner screen position of the menu based on that. > > ---------------- > cheers, > Derek Parnell Hi Derek, Guillermo Bonvehi's method works. I would suggest to people to get in the habit of using TrackPopupMenuEx Function. The reason i say this is because of the TPMPARAMS structure which you can fill in and have your popup menu correctly displayed(clipped) to the screen. I HTH....... ---------------------------------------------------------------------------- ---- The TrackPopupMenuEx function displays a shortcut menu at the specified location and tracks the selection of items on the shortcut menu. The shortcut menu can appear anywhere on the screen. Syntax BOOL TrackPopupMenuEx( HMENU hmenu, UINT fuFlags, int x, int y, HWND hwnd, LPTPMPARAMS lptpm ); TPMPARAMS Structure ---------------------------------------------------------------------------- ---- The TPMPARAMS structure contains extended parameters for the TrackPopupMenuEx function. Syntax typedef struct tagTPMPARAMS { UINT cbSize; RECT rcExclude; } TPMPARAMS, *LPTPMPARAMS; Members cbSize Size of structure, in bytes. rcExclude Rectangle to exclude when positioning the window, in screen coordinates. Structure Information Header Declared in Winuser.h, include Windows.h Minimum operating systems Windows 95, Windows NT 3.1 ----------------- Jordah > > > > > TOPICA - Start your own email discussion group. FREE! > > TOPICA - Start your own email discussion group. FREE!