Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a tray-app; monitor Internet 1

Status
Not open for further replies.

greggb

Programmer
Dec 6, 2003
30
US
Does anyone know if would be possible to run a VFP program in the systray and monitor a database on a web server. The idea would be that if a certain condition is met, a little window would "pop-up", similar to what happens when these virus program update or find a virus...

How would I do this?

Thanks.
 
There is a 3rd party control I played with from that is called bbsystray. It's cheap. Less than 10 bucks and provides some VFP samples.

It runs as a tray item. You can set the timer occasionally, and it includes complete right mouse click (popup menu) functionality.

As for check what is available on the web. There are different ways of doing that. One of the easiest is to read an XML document you place on your site with the information, or you can read static web pages.

Check out Brian Baltman’s tektip to see how he reads the tek-tip site. Run his code to see it in action.

faq184-4339
How can I navigate through all these FAQs?

If you wish to try it with XML, you can read a sample file from my site.

Once you get it working, go ahead and change the data on the site, and retrieve it again to see it is real-time.





Jim Osieczonek
Delta Business Group, LLC
 
If you have VFP 8.0, it now includes a SysTray sample, just do:
Code:
DO Form (_samples+"solution\toledo\systray_sample")
Rick
 
That is incredible! Thanks for showing us, Rick!
For anyone who is scratching their head over "How'd they do that!? I thought callbacks were impossible in VFP (even v8)!"

Here's the explanation from the SysTray.vcx:SysTray.AddIconToSysTray method:
Code:
*!*	This is where the magic happens.
*!*	This is an unabashed hack to allow us to get the full functionality
*!*	of the Taskbar Notification Area ("System Tray") without having to
*!*	use an external C++ library.
*!*	To communicate with the systray, we tell it to send us messages via
*!*	the MouseWheel event. (This is the only VFP event that doesn't alter
*!*	or discard event data before firing the corresponding internal event.)
*!*	The second trick is that only the main VFP window will accept the events
*!*	without checking to see if the event coordinates are invalid. (The screen
*!* doesn't even need to be visible, so you can have SCREEN=OFF in your 
*!* config.fpw file.)  So we use VFP8's BINDEVENT() function to bind to the 
*!* _SCREEN.MouseWheel event.
*!*	This method sets up that communication path.
*!*	Returns 1 if successful.

... Some things there ONLY the VFP team would know about, and I'm glad it is there!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top