Re: Orphaned Popups?

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

----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Orphaned Popups?


>
> ----- Original Message -----
> From: <pampeano at rocketmail.com>
> To: "EUforum" <EUforum at topica.com>
> 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!
>
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu