Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Popup menu from Windows StartBar Icon
Message
From
27/09/2002 08:40:28
 
 
To
27/09/2002 08:21:27
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00705167
Message ID:
00705177
Views:
10
Hi!

If you meant popup for Windows Tskbar icon, like popup when you right click on the Volume Control icon:

It is possible, but example code in my application is sparsed across modules and would take a lot of time to send it here.

In general, approach is following:

1. Create a form that is a top-level form without titlebar. The form should contain nothing except a space for popup. You will run this form in hidden mode at application startup, then show when needed and hide again after use.
2. Define your popup and display/activate it in that form. You might have a hard time to adjust size of that form to be the same as size of your popup.
3. To determine correctly where menu should be displayed, you can get coordinates of current mouse absolute position by using GetCursorPos Windows API function.
4. Because right click is handled by VFP code as part of the ActiveX control process (or anotehr DLL process), showing menu from it might not work as part of call from ActiveX process. If this is a case, create a timer on your form. Set up timer to fire as soon as possible (1 milisecond in Interval property), and disable it. In the RightClick code, enable timer and end event's code. Show menu in the Timer event of the Timer - it will fire when code and alle vents for ActiveX or DLL used for tray ion are already processed, so there will be no problem. At start of Timer event disable timer call its method Reset.
5. Of course, you want to hide menu when another Windows applciation is selected or user clicked on desktop. To organize this, create anotehr timer that checks each 50-100 miliseconds if you top-level form is still active. You can do this using Windows API functions.



>Hi,
>
>can anybody tell me if it is possible to build a FoxPro menu that I can open using the right mouse button on the windows taskbar? (like entering the date settings on the clock icon on the startbar)
>
>If it is possible could you give me some example code?
>
>regards,
>
>Erwin
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform