Results 1 to 11 of 11

Thread: Handle File Operation/Camera Event - Possible?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    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?

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    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.

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Handle File Operation Event - Possible?

    Yes - that is why I said you needed OpenNetCF
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    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?

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    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?

  8. #8
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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'
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  9. #9

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    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?

  10. #10
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Handle File Operation/Camera Event - Possible?

    rename camera.exe to something else?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  11. #11
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width