Updated Desktop Alerts Source Code Available

Links in this post have been updated to link to the VFPX site on CodePlex.

I’ve updated the source code for the Desktop Alerts, and posted to the web site.

Updates include the ability to hide the Close button and Push-Pin button on the alert form, and I made a couple of minor changes to bring back the ‘fade-out’ effect when the alert form releases.

You can get the updated code here.

A single zip file. When unzipped, it should create a single folder named VFPALERT. All files for the project are in the one folder.

I’ve also posted a Sample form, which allows you to select/enter the parameters for an alert and click an ‘Alert Me’ button to view the alert. Very easy to make minor modifications to an alert and quickly see the results.

The download includes a program file named TESTSAMPLE.PRG, which contains three class definitions for “callback” objects.  The sample form includes two “pre-defined” alerts and a third one call “Create My Own Alert”. After selecting an alert and setting the values for the parameters, the Alert Me button calls the AlertManager’s Alert() method, runs the Alert’s SetCallback() method (passing in one of the three “callback” objects), then issues the Alert method.

The Sample form also comes with a COMPILED EXE (VFPALERT.EXE). Simply run the EXE with the /regserver switch, then DO FORM pathsample from the VFP Command Window.

Please note: this EXE was compiled with VFP 9 SP1. You will need the VFP 9 runtime files to run the sample. The runtimes are not included with the download.

The sample form and compiled EXE are also available here.

A quick note of SPECIAL THANKS to the Chicago FoxPro Users Group for allowing me to come to their meeting this past Tuesday to talk about the Desktop Alerts. I had a GREAT time talkin’ FoxPro, and enjoyed meeting all of you!

Special Thanks also to Patrick O’Hara for taking my son & I out for some Chicago pizza (and for showing me some fantastic dev tools he’s written) after the meeting.

This post originally appeared on the Foxite Weblogs site.

Desktop Alerts Source Code Now Available

After many stops and starts over the past couple of weeks, I’ve finally posted the source code for the Desktop Alerts System.

You can download the file here (558kb).

The zip file, DesktopAlerts.zip, contains three files: a README file, the PDF version of the whitepaper from the FoxForward 2006 conference, and an additional zipped file (all source code and a compiled EXE).

I have found in my testing that if I recompile the project in VFP 7 or VFP 8, the Alert form size and placement is “off”, so I recommend using VFP 9 SP1.

If you have the VFP 9 runtimes installed, you can ‘install’ the EXE by running the executable (vfpalert.exe) with the /regserver switch.

Once ‘installed’, you can start the Desktop Alerts System with code like the following:

oMgr = CreateObject(“VFPAlert.AlertManager”)

If you run Windows Task Manager, you will see a new process named “vfpalert.exe”. This is the Desktop Alerts System, waiting for you to create some alerts.

To create a quick alert, try the following:

oAlert = oMgr.NewAlert()

then

oAlert.Alert(“Hello World!”)

Check the source code for all available parameters.

If you want to do something with the return value from an alert, you will need to set up a callback object before you call the Alert() method (see the PROGRAM1.PRG, PROGRAM2.PRG, and FROMVFP6.PRG files in the source code directory for more info).

If you have any questions, comments, etc, please feel free to contact me via the contact information in the README.TXT file.

I have sent a proposal to VFPX for the Desktop Alerts System, because there is still a ton of work that can be done to improve it. In the meantime, have fun with this, and let me know how/where/why you make fixes to it!!!

This post originally appeared on the Foxite Weblogs site.