Context Menu Help...

J

jaymtz78

Is there any way that I can test to see when a context menu
disappears? I can test when an item in the context menu is
clicked...it then disappears, but what if they click outside the
context menu...that's why I need to find a way to determine if the
context menu is showing or not!

Thanks in advance for any tips!!!

jay mtz.
 
J

jaymtz78

ANYONE?!?! I've tried everything and I can't figure it out. Is there
a specific API call that I can test for in the WndProc method?!?!

Thanks again!

jay mtz.
 
J

John Smith

You can implement the standard windows menu using the API

Keywords:
Private Declare Function CreatePopupMenu Lib "user32" Alias
"CreatePopupMenu" () As IntPtr
Private Declare Function DestroyMenu Lib "user32" Alias "DestroyMenu"
(ByVal hMenu As IntPtr) As Integer
Private Overloads Declare Unicode Function AppendMenu Lib "user32"
Alias "AppendMenuW" (ByVal hMenu As IntPtr, ByVal wFlags As MF, ByVal
wIDNewItem As Integer, ByVal lpNewItem As String) As Integer
Private Overloads Declare Unicode Function AppendMenu Lib "user32"
Alias "AppendMenuW" (ByVal hMenu As IntPtr, ByVal wFlags As MF, ByVal
wIDNewItem As IntPtr, ByRef lpNewItem As String) As Integer
Private Declare Function DrawMenuBar Lib "user32" Alias "DrawMenuBar"
(ByVal hwnd As IntPtr) As Integer

Private Declare Function CheckMenuItem Lib "user32" Alias
"CheckMenuItem" (ByVal hMenu As IntPtr, ByVal wIDCheckItem As Integer,
ByVal wCheck As Integer) As Integer
Private Declare Function EnableMenuItem Lib "user32" Alias
"EnableMenuItem" (ByVal hMenu As IntPtr, ByVal wIDEnableItem As Integer,
ByVal wEnable As Integer) As Integer
 
J

jaymtz78

John,

Thanks for your help, but I must be a little newer at this than I
thought, because I have no idea what it is you're trying to tell me to
try. If you could elaborate a little more, I'd be so grateful!
Thanks again!

jay mtz.
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (jaymtz78) scripsit:
Thanks for your help, but I must be a little newer at this than I
thought, because I have no idea what it is you're trying to tell me to
try. If you could elaborate a little more, I'd be so grateful!

John posted some "API declarations" which are used to modify menus, but
that's far away from being a complete sample. As stated previously,
it's much easier to re-implement the whole menu.
 
J

Jay Martinez

What do you mean by re-implement the whole menu?!?! All I want to do is
check to see if the context menu is showing or not. Maybe I'm just a
little confused...because this is the most trivial thing that I have
encountered, and I can't even figure this out!!!

Thanks again for everything!!!

jay mtz.
 
H

Herfried K. Wagner [MVP]

* Jay Martinez said:
What do you mean by re-implement the whole menu?!?! All I want to do is
check to see if the context menu is showing or not. Maybe I'm just a
little confused...because this is the most trivial thing that I have
encountered, and I can't even figure this out!!!

Sorry, I mixed up 2 threads!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top