473,698 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with FileSystemWatch er/Tray Notifier App

Hi,

I've been developing an application in VB.NET that uses the
FileSystemWatch er and a popup notification in order to tell me when files
have been downloaded.

The FileSystemWatch er code in my project is basically the same one thats
floating all over the VB.NET sites (by Jayesh Jain). The popup notification
(called TaskbarNotifier ) is a class originally by John O'Byrne written in C#
and C++ but ported to VB.NET by Patrick Vanden Driessche. It was downloaded
from codeproject.com .

Both of these elements (FileSystemWatc her and TaskBarNotifier ) work
perfectly on the own but I experienced problems when I tried incorporating
and combining them in my own project.

Basically, the FileSystemWatch er will detect files created, changed, deleted
etc and the TaskBarNotifier will display popups as it should. The problem
comes when I create a file (by means of downloading it or by just copying it
to the 'watched' folder directly). I've coded it so the TaskBarNotifier
should popup with name of the file created/downloaded then disappear after 3
seconds. It should, but doesn't. I can't understand why the same code will
not run when used under a different procedure.

I would of prefered to paste the code here in the hope people willing and
able to help can paste it directly into their own VB.NET environment but the
project contains bitmaps (as Embedded Resources) for the skins of the popups
and they need to be included when compiling/testing the app otherwise it
won't compile. So for this reason I've posted the project on my website for
download.

Homepage: http://www.geocities.com/toffee_paul/fun_d_mental.html
Direct Link: http://www.geocities.com/toffee_paul/vbnetproj.zip

When compiled and the form is displayed, click 'Test just the Popup' and the
popup will appear as it should. Now change the 'watch folder' to a valid
folder and copy a file to this folder. The app will detect the newly
created file (as proven in the 'content' textbox) but the popup will fail to
appear. Very strange problem.

Any help is very much appreciated,
Thanks
Paul
Jul 21 '05 #1
2 4825
"Paul" <pr*****@mail.c om> schrieb:
The FileSystemWatch er code in my project is basically the same one thats
floating all over the VB.NET sites (by Jayesh Jain). The popup
notification (called TaskbarNotifier ) is a class originally by John
O'Byrne written in C# and C++ but ported to VB.NET by Patrick Vanden
Driessche. It was downloaded from codeproject.com .

Both of these elements (FileSystemWatc her and TaskBarNotifier ) work
perfectly on the own but I experienced problems when I tried incorporating
and combining them in my own project.


Make sure that the 'FileSystemWatc her''s 'SynchronizingO bject' is set to
your form. Otherwise your event handlers are executed on a thread of the
thread pool and thus invoking will be required to access Windows Forms
elements running in the application's main UI thread.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jul 21 '05 #2
Brilliant, thanks Herfried!

I added the following line to the Load event of my form....

WatchFolder.Syn chronizingObjec t = Me

And all works perfectly now.
Thanks again.
Paul

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:e8******** ******@TK2MSFTN GP11.phx.gbl...
"Paul" <pr*****@mail.c om> schrieb:
The FileSystemWatch er code in my project is basically the same one thats
floating all over the VB.NET sites (by Jayesh Jain). The popup
notification (called TaskbarNotifier ) is a class originally by John
O'Byrne written in C# and C++ but ported to VB.NET by Patrick Vanden
Driessche. It was downloaded from codeproject.com .

Both of these elements (FileSystemWatc her and TaskBarNotifier ) work
perfectly on the own but I experienced problems when I tried
incorporating and combining them in my own project.


Make sure that the 'FileSystemWatc her''s 'SynchronizingO bject' is set to
your form. Otherwise your event handlers are executed on a thread of the
thread pool and thus invoking will be required to access Windows Forms
elements running in the application's main UI thread.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3000
by: cxw0106 | last post by:
Hello, I have some weird problem with the FileSystemWatcher. I have developed an application that monitors a network directory for file changes of a certain file type. The program runs well for a week. Then suddenly the monitored network server starts to behave crazily. It sends to my Sync Server dozens of replicated file change events. Say one file was changed two days ago, but the monitored server still keeps sending me many many...
1
482
by: balu | last post by:
Hello , I Had a problem in developing a application for getting a message over or above system tray . When we first logon into the yahoo messenger , whenever a new user logon ,The messenger will shows message above the system tray. for example " balu comes is on online " above system tray . whenever a new user logout ,The messenger will shows message above the
9
715
by: Paul | last post by:
Hi, VB.NET is saying the file I am creating is in use by another process and won't complete its task of moving the file to the specified destination folder. Here is my code (the main bit anyway).... Private Sub LogChange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs) If e.ChangeType = WatcherChangeTypes.Created Then
10
2570
by: Zeljko | last post by:
Hi, I have a form with a tray icon. However, when I minimize the form, it stays visible - not in the task bar (I have showintaskbar property set to false), but in a form of a rectangle sitting above the task bar. Can't figure out why that happens - it looks very ugly... Any ideas ? Zeljko
3
4599
by: Stampede | last post by:
Hi, I write an application which waits for incomming files in a specified directory. I thought, that using the FileSystemWatcher would be the best, as it does exactly what I need. But now I have a problem: I wonna get shure, that really all files are processed and I need to be shure, that no file is processed twice. If my application is started while there are already files in the directory (which is realistic, as the application could...
2
1402
by: Paul | last post by:
Hi, I've been developing an application in VB.NET that uses the FileSystemWatcher and a popup notification in order to tell me when files have been downloaded. The FileSystemWatcher code in my project is basically the same one thats floating all over the VB.NET sites (by Jayesh Jain). The popup notification (called TaskbarNotifier) is a class originally by John O'Byrne written in C# and C++ but ported to VB.NET by Patrick Vanden...
2
1174
by: Jasper Jones | last post by:
I have a main form which has a list of items from a table on my database. If I click one of these items it brings up a second form which lets you edit the details for that item. If I change an item's details and then close the edit form I want the main form to update its datagrid by calling the sub I wrote which refreshes the dataset. What is the best method of doing this; I know I can call commands after a showdialog form but I really...
0
1811
by: Richard | last post by:
Some printers "tray id's" does not correspond to .NET framworks System.Drawing.Printing.PaperSourceKind enumerator, such as "hp color LaserJet 2550L". this is what the "tray id's" actually is 15 Automatically Select 261 Printer Auto Select 260 Manual Feed in Tray 1 259 Tray 1
3
1649
by: =?Utf-8?B?UnVkeQ==?= | last post by:
Hello All! I may have posted this problem before, but it was awhile ago. I'm working in VS 2003. I have 10 file watch process going. It seems that I can only about 6or 7 to run at the same time. I made a test program to isolate the problem from my program. Still same thing Basicly I have one application creating a file, the other application running the file watch procces. When a file with a certain extension is created, then a form...
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.