Win32 API question TrackPopupMenu()

Win32 API question TrackPopupMenu()

Post by Zetu » Wed, 29 Jan 2003 16:36:57



Hello,

Is there a way to close by code a menu invoked with  TrackPopupMenu(..)

Zetus

 
 
 

Win32 API question TrackPopupMenu()

Post by Denis Mitrofano » Wed, 29 Jan 2003 18:50:26


Zetus

Enjoy (nX, nY - mouse pointer coordinates (absolute)):

LOCAL nItem AS INT, hMenu AS PTR

  IF hMenu == NULL_PTR
     hMenu := CreatePopupMenu()
     AppendMenu(hMenu, MF_STRING, CMD_EXECDBF, "As DBF report (F6)")
     AppendMenu(hMenu, MF_STRING, CMD_EXECSQL, "As SQL report (F7)")
  ENDIF

  nItem := DWORD(_CAST, TrackPopupMenuEx(hMenu, _OR(TPM_LEFTALIGN,
TPM_TOPALIGN, TPM_NONOTIFY, TPM_RETURNCMD),;
                               nX, nY, SELF:Handle(), NULL_PTR))

  IF nItem == 0L
     RETURN
  ENDIF

Denis

 
 
 

Win32 API question TrackPopupMenu()

Post by Zetu » Fri, 31 Jan 2003 06:12:42


Thanks Denis for your answer,

But...
I wanted a way to close the menu window without any key press or mouse
click.
I want it disapear from the screen as soon as possible  after being shown.
The difficulty here is that we dont have the handle of the window created
with TrackPopupMenuEx

Zetus

Quote:> Enjoy (nX, nY - mouse pointer coordinates (absolute)):

> LOCAL nItem AS INT, hMenu AS PTR

>   IF hMenu == NULL_PTR
>      hMenu := CreatePopupMenu()
>      AppendMenu(hMenu, MF_STRING, CMD_EXECDBF, "As DBF report (F6)")
>      AppendMenu(hMenu, MF_STRING, CMD_EXECSQL, "As SQL report (F7)")
>   ENDIF

>   nItem := DWORD(_CAST, TrackPopupMenuEx(hMenu, _OR(TPM_LEFTALIGN,
> TPM_TOPALIGN, TPM_NONOTIFY, TPM_RETURNCMD),;
>                                nX, nY, SELF:Handle(), NULL_PTR))

>   IF nItem == 0L
>      RETURN
>   ENDIF

> Denis

 
 
 

1. Anyone interested in Beta Testing a CM11 API for Win32?

I'm in the process of writing a Win32 API for controlling the CM11.
Being that I've just gotten into this stuff, and I only have one lamp
module and one appliance module, I'm looking for people to help me work
the bugs out.

This is an API written with Visual C++ 5.0, you have to be able write
programs yourself. I will include a very simple program that uses it,
but it will be up to you to exercise the API and report bugs back to
me. In the end you will get a credit line in the documentation and
a final copy of the API. The API will be distributed as Freeware source
code available on request (also free).

The API should be ready for Beta 1 in the next couple of days.

--
                         ___
Integrated              /  /               Nick Stefanisko   [KD6PTD]

Division              /__/                 Sunnyvale, California, USA
Opinions expressed here are not those of my employer; only my fingers
are to blame.

2. how to place gnuplots ???

3. VxWorks and WIN32 APIs

4. Novell file handles

5. Win32 API Functions

6. UFO

7. PDFWriter: Using ExtEscape WIN32 API call to set document propeties

8. Operator overloading question

9. MS WORD FORMS TO ADOBE ACROBAT (File reading and Win32 API)

10. How to change display settings without calling Win32 API functions in VB.NET.

11. Solutiion: Calling WIN32 API Functions

12. Win32 API calls - RegEnumKeyEx

13. Calling WIN32 API Functions