Getting a folder to show

Started by
2 comments, last by IO Fission 23 years, 5 months ago
I wanna make it so that when a user presses a button in my prog, a folder window pops up, like some of those cd autoplay programs, how they have a button you can press just to browse the cd, you press it and the folder comes up in a window. How do you do that? I''ve tried fiddling with WinExec and CreateProcess, trying to load explorer.exe with the folder as the arg, but it doesn''t do anything. Any ideas? Thanx IO_FissionSig();
Advertisement
SHBrowseForFolder is one way, but it isn''t going to be running in a seperate process. I believe ShellExecute will open explorer on the directory you specify. I ran...

    ShellExecute(Form1->Handle, "explore", "c:", NULL, "c:", SW_SHOW);    


and it opened explorer on the c: drive.
Keys to success: Ability, ambition and opportunity.
Sounds good, and I tried it. It does the job I want, except I want the folder to open and my program to close, but for some reason the app doesn''t exit properly. I call DestroyWindow and that seems to run fine, but when I try to run the app again I''m told (by VisC++) that it has to build the exe again. I check in the running programs (Three finger salute style), win tells me my prog is still running, but to close it it tells me that the program is not responding. This is caused by the call to ShellExecute somehow. Ideas?

IO_FissionSig();
OK, don''t bother. I wasn''t sure what hWnd to give it, so I gave NULL. Now I give it the proper window handle and it works. Thanx LilBudyWizer.

IO_FissionSig();

This topic is closed to new replies.

Advertisement