Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timers not firinger???
Message
From
02/11/2022 19:24:15
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01685191
Message ID:
01685203
Views:
59
Likes (1)
>>The purpose of the timer is to see if a file hit a folder and then to act on it. I'm trying to extract the bind events in the VFP 9 Windows Events in the Samples and it, the event binding, seems to work.

The one I recall is under VFP9_install_folder\Samples\Solution: run solution.app (or solution.scx) and under "New in VFP 9" the last option should be "Binding to Windows Message Events." There's a sample on detecting file changes in a folder. Sorry if that's what you're referring to, but no timer needed; whenever a file appears, the Windows message is detected by your app. So you can just leave the app sitting at Read Events or something like that, waiting for a file.
You can detect when files or directories are added, updated or deleted to your system using Windows messages.
Sample: to run the sample, click on the Enable Event button. Once the event is active, open up Windows Explorer and try adding, removing or renaming a file or folder. You can also change a file’s attributes such as making it read-only.
Details: 
This sample uses the following binding to handle file detection:
BINDEVENT(_VFP.hWnd, WM_USER_SHNOTIFY, THIS, "handlewinmsg")
Note: WM_USER_SHNOTIFY is based on the WM_USER message
In addition, this sample uses a number of Shell functions to detect changes to files and directories.         
You can find additional information about shell events in MSDN:
WM_USER Message
Shell Programmer’s Guide
SHChangeNotifyRegister function
Click on the Constants button to view values for the #DEFINES.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Reply
Map
View

Click here to load this message in the networking platform