|
-
Mar 7th, 2001, 11:20 AM
#1
Thread Starter
Fanatic Member
Hi,
I'm runnung a vb project, a small icon sits on the system tray and when i click it a menu appears. To do so, i've a module and a code in the MouseDown event of the Form1 that goes:
<code>
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (X + Y ^ 16) = WM_RBUTTONDOWN Then
Form1.PopupMenu mnuPopUp_0 'The menu
End If
End Sub
</code>
Everything works fine, BUT... when i click OUTSIDE the menu, the menu doesn't disappear...!!! I want that if i click on the taskbar, for example, the menu GOES AWAY!
How can i do that? I tried a Form1.refresh but doesn't work as the taskbar is not SCALED in the form...
HEEEEEEEEEEEEEEEEEEEEELPP!!
W.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Mar 7th, 2001, 11:27 AM
#2
Hyperactive Member
HEy
If you havent figured it out yet then I will send you my project later so you can have a look at mine..
Matt
-
Mar 7th, 2001, 11:33 AM
#3
Thread Starter
Fanatic Member
no i haven't figured it out, as apparently it is a windows bug... in c++ is easy: one must set the current window as the foreground window before calling TrackPopupMenu. This then causes a second problem - namely that the next time the menu is displayed it displays then immediately disappears. To fix this problem, you must make the currernt application active after the menu disappears. This can be done by sending a benign message such as WM_NULL to the current window.
BUT HOW DO I DO THIS IN VB... that's the issue.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|