473,394 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Is it possible to close a windows folder from C#?

I would like to be able to determine if a given folder is open on a user's
desktop, and be able to close it. Is this possible?

Thanks in advance,
Valerie Hough
Jan 28 '07 #1
3 4756
>I would like to be able to determine if a given folder is open on a user's
>desktop, and be able to close it. Is this possible?
You will need to go back to Win32 APIs, or maximum use a P/Invoke from C#.
I don't there are direct APIs available.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
Jan 28 '07 #2
Hello Valerie,

use FindWindow() and SendMessage() with WM_CLOSE WinAPI functions
See www.pinvoke.net about the samples of how to call unmanaged api

VHI would like to be able to determine if a given folder is open on a
VHuser's desktop, and be able to close it. Is this possible?
VH>
VHThanks in advance,
VHValerie Hough
---
WBR, Michael Nemtsev [C# MVP]
my blog: http://spaces.live.com/laflour
my team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Jan 28 '07 #3
Thank you very much for your reply. I found out one interesting thing:
SendMessage did not result in closing the folder (Windows XP), but
PostMessage did. Nevertheless, your response was invaluable in fixing my
problem.
Regards,
Valerie Hough

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:a2***************************@msnews.microsof t.com...
Hello Valerie,

use FindWindow() and SendMessage() with WM_CLOSE WinAPI functions
See www.pinvoke.net about the samples of how to call unmanaged api

VHI would like to be able to determine if a given folder is open on a
VHuser's desktop, and be able to close it. Is this possible?
VHVHThanks in advance,
VHValerie Hough
---
WBR, Michael Nemtsev [C# MVP] my blog: http://spaces.live.com/laflour
my team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


Jan 29 '07 #4

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

Similar topics

1
by: Daniel Albisser | last post by:
Hi @ll, I was wondering why I lose the connection to the mail store while retrieving information from it without calling the method store.close()! At the end I found out that the method...
2
by: Martin Strojek | last post by:
Hi, I try to solve a problem: Some folder on an IIS Webserver should be protected with username and password. So I switched off anonymous access and do Authentication. So far so good. But I want...
14
by: Ray5531 | last post by:
I have a console application in my local computer which I like to use remoting in it,to instanciate an object (MyClass.dll) in a web application(its bin folder) in a completely seperated box(in the...
1
by: Mike Kober | last post by:
I'm having difficulty getting this to work. Any help would be appreciated. What I'm trying to do is to open Explorer onto the Windows/fonts directory and then close it. I've added a font...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
1
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I have a user with lots of protected documents in a folder. Is it possible to create a small app which can be used to unprotect all the files in a folder on one click and then after all...
1
by: mti07 | last post by:
I have a situation where I would like to use JavaScript w/ ASP.NET, however I am not sure if what I want to do is possible. I have a web application that can deploy multiple windows. Basically,...
2
by: Sin Jeong-hun | last post by:
Since Windows 2000, all user setting files should be stored separately in the user's application settings directory. But some users still want all the files to be created in the application folder,...
0
by: Mark Gold | last post by:
Hi! We have a VB application using Crystal Reports 6 that has worked successfully on hundreds of systems for over 10 years. Now, on one network, the application and access database does not close....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...

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.