Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Monitoring Double Click of a Folder in VB.net


  • Please log in to reply
6 replies to this topic

#1 raziiq

raziiq

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:07:39 PM

Posted 04 January 2010 - 01:39 AM

Hi there.

I am trying to make an app that launches a window(Form Window) whenever a user click a folder in Windows. My app will be running in the background all the time and it will be monitoring the double click of a particular folder.

I have found this
Folder Watcher

But the problem is that, it checks attributes of the folder instead of the double click.

Is there anyway i can check the double click of a folder in Windows?

Edited by raziiq, 04 January 2010 - 01:41 AM.


BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:03:39 AM

Posted 04 January 2010 - 10:05 AM

You need to implement a shell extension to do this -- you can't put your user in a situation where the shell is broken if your app isn't running. Remember: don't use a global fix to solve a local problem. If you write a shell extension DLL you should be able to get that kind of information.

Curious: Why would you be looking for such monitoring? Doing anything that goes counter to the shell is generally a no no in Windows development.

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 raziiq

raziiq
  • Topic Starter

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:07:39 PM

Posted 04 January 2010 - 09:45 PM

Well there are lots of app ideas once i get this concept going. For example, i can create a folder protect app, a Log app for a Folder, icon changer for a folder etc.

BTW do you have any example about Shell Extension DLL you mentioned in your post?

#4 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:03:39 AM

Posted 04 January 2010 - 10:17 PM

Hello, raziiq
  • Any such "folder protection" app would not be even slightly secure, as you have no way to ensure your application is not terminated. If someone calls NtTerminateProcess on your application, the whole works comes down. Only way to prevent that would be to use a driver of some kind, which would be A. wrong and B. not possible in VB.NET (C only). Plus, secure versions of this (on disk encryption) already exist for free and are open source implementations -- see TrueCrypt.
  • I suppose you could log clicks -- though I honestly have no idea why you'd want to.
  • Changing the icon for a folder should not be done with a hack like a click notification. The shell already has facilities for this behavior. Note how the folders on your machine with custom icons or layouts all have desktop.inis inside them -- this file is what tells the shell to display for the folder's icon.
  • I'm not even sure it's possible in VB.NET. The shell inherently uses Component Object Model technology to access the DLL itself, which has traditionally been the realm of C/C++ software development. Issue is, the Shell is not a Managed environment, and it's difficult to get that kind of interoperability between managed code and COM. Additionally, you can't set up a system that breaks the entire shell if something's wrong with your application.
If you want to write a shell extension, it's going to have to be native code (C or C++), and you're going to have to understand how COM works. A reference on shell extensions may be found here.


Please don't take this the wrong way -- I'm not trying to berate you for wanting to get this information. I just can't see any legitimate use for the information. It's using global state (a way of hooking the shell's handling of folder clicks) to manage a local issue. Not to mention it opens up whole cans of worms about handing multiple mouse buttons, or double clicks, or.....

But unless you know more about what you're trying to accomplish, there's little I can do to suggest a plan of action.

Hope that helps,
Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#5 raziiq

raziiq
  • Topic Starter

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:07:39 PM

Posted 04 January 2010 - 10:45 PM

thanks for the reply, that was quite descriptive.

As far as killing the application is concerned, well , i have seen some apps that have the application running using a Service and if you try to kill that service in Task Manager, they pops back up, so i was thinking of joining my app with some Windows Service. Is it possible?

2ndly i should have written OPEN FOLDER instead of Double Click on folders, as one can open folders in windows in some other ways also, like from Run command.

Basically i wanna make an app that can make my folder secure, as my laptop is normally in office and other staff also uses it sometimes, so i want my documents to be secure. I know i can use third party apps or may be TrueCrypt as you mentioned, but i ll go for them if i cant find any way of developing my own app.

Hope i am a bit clear now.

#6 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:03:39 AM

Posted 04 January 2010 - 11:10 PM

thanks for the reply, that was quite descriptive.

As far as killing the application is concerned, well , i have seen some apps that have the application running using a Service and if you try to kill that service in Task Manager, they pops back up, so i was thinking of joining my app with some Windows Service. Is it possible?

Yes, that's possible, but:
from the command line (or run prompt)
SC STOP <servicename>
Service terminated.
SC DELETE <servicename>
Service gone.
The same can be done from any app that handles services -- including Hijack This EDIT: Autoruns, Runscanner, OTL, OTS, etc.

There is absolutely no (supported) way to mandate that a process always runs on the windows platform. None. Malware authors have been looking for years, and they still haven't found one, short of hacking the kernel itself apart -- which you can only do from C.

2ndly i should have written OPEN FOLDER instead of Double Click on folders, as one can open folders in windows in some other ways also, like from Run command.

Then it's absolutely not possible.

Basically i wanna make an app that can make my folder secure, as my laptop is normally in office and other staff also uses it sometimes, so i want my documents to be secure. I know i can use third party apps or may be TrueCrypt as you mentioned, but i ll go for them if i cant find any way of developing my own app.

Use truecrypt. Nothing stopping a co-worker from terminating your app and taking a looksee. No way around a truecrypted volume, though.

Hope that helps,
Billy3

Edited by Billy O'Neal, 04 January 2010 - 11:10 PM.

Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#7 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:03:39 AM

Posted 04 January 2010 - 11:13 PM

Better yet -- WinKey+L. Lock your workstation -- that's what it's there for.
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users