|
-
Jul 6th, 2008, 07:43 PM
#1
Thread Starter
Member
Handle File Operation/Camera Event - Possible?
Hi. I'm using WM6 SDK, writing my program in VB.NET.
This time I need to do something on file operation. Namely, deletion on files. However, this project require me to delete file upon its creation.
One method I thought of and wrote is to get a list of files and folders and place them in a ignorelist, then use a timer to constantly delete files that are not in the list. This method was rejected.
Is there a way to do this without the use of timer?
-
Jul 7th, 2008, 01:46 AM
#2
Frenzied Member
Re: Handle File Operation Event - Possible?
Take a look at the FileSystemWatcher class in the OpenNETCF library which is an implementation of the FileSystemWatcher in the full framework
-
Jul 7th, 2008, 03:02 AM
#3
Thread Starter
Member
Re: Handle File Operation Event - Possible?
Hmm. It appeared that FileSystemWatcher only appear when I try WindowsApplication, it doesn't seems to work for DeviceApplication.
-
Jul 7th, 2008, 11:08 AM
#4
Frenzied Member
Re: Handle File Operation Event - Possible?
Yes - that is why I said you needed OpenNetCF
-
Jul 7th, 2008, 09:07 PM
#5
Thread Starter
Member
Re: Handle File Operation/Camera Event - Possible?
Thanks. I currently have a new problem. Is there a way to handle an event of a picture being taken by the camera?
-
Jul 8th, 2008, 01:04 AM
#6
Frenzied Member
Re: Handle File Operation/Camera Event - Possible?
You mean pick up if a picture has been taken outside your application?
Monitor the folder where the camera stores its images, and see if it changes would do it
-
Jul 8th, 2008, 02:02 AM
#7
Thread Starter
Member
Re: Handle File Operation/Camera Event - Possible?
That's what I'm currently doing. Unfortunately, my supervisor wants me to prevent the user that have installed 3rd party camera software to used the camera using that software and save the file to another place.
I thought of using the same logic by monitoring the entire file system and delete any file ending with .jpg but I was told, it may affect other image file operation.
Any way around that?
-
Jul 9th, 2008, 12:51 AM
#8
Frenzied Member
Re: Handle File Operation/Camera Event - Possible?
Well, with the normal camera s/ware, the user can choose a folder and choose names for the pictures.
I would guess though, that the next in sequence is held in the registry - so if you find out where, you can monitor that for changes.
I would dump the registry to a file, take a picture, then re-dump, and compare the files - or just browse the registry looking for likely suspects containing 'camera'
-
Jul 10th, 2008, 01:40 AM
#9
Thread Starter
Member
Re: Handle File Operation/Camera Event - Possible?
Thanks for the tip. I manage to do that. Just a curious side, is there really no way to disable/enable the camera hardware or driver by making use of VB.NET codes?
-
Jul 10th, 2008, 12:02 PM
#10
Frenzied Member
Re: Handle File Operation/Camera Event - Possible?
rename camera.exe to something else?
-
Jul 12th, 2008, 05:12 AM
#11
Frenzied Member
Re: Handle File Operation/Camera Event - Possible?
There is a great 'How Do I' video here from Maarten Struys that will give you a good idea of how to monitor for a photograph being taken
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|