Mar 9, 2008 at 2:08am Mar 9, 2008 at 2:08am UTC
So I want to open up a folder using c++. For example:
I open the program, a new window pops up and that window is a folder call, lets
say: C:\php And then the program closes but the folder stays open, is this possible? Thanks!
-Nile
Please help!!!
Last edited on Mar 9, 2008 at 1:54pm Mar 9, 2008 at 1:54pm UTC
Mar 9, 2008 at 2:29pm Mar 9, 2008 at 2:29pm UTC
1 2 3 4 5 6
#include <stdlib.h>
int main(){
system("explorer C:\\php" );
return 2;
}
Last edited on Mar 9, 2008 at 2:30pm Mar 9, 2008 at 2:30pm UTC
Mar 9, 2008 at 2:37pm Mar 9, 2008 at 2:37pm UTC
Thanks, I'll try it. :)
Works! But how would I make the program close? But not the window?
Last edited on Mar 9, 2008 at 2:40pm Mar 9, 2008 at 2:40pm UTC
Mar 9, 2008 at 8:00pm Mar 9, 2008 at 8:00pm UTC
Since you want a new "window" i am guessing you want a dialog with the file open or a main window with the contents of a folder.
You will need an API for that, since its GUI application.
Jeff
Last edited on Mar 10, 2008 at 5:07pm Mar 10, 2008 at 5:07pm UTC
Mar 9, 2008 at 11:58pm Mar 9, 2008 at 11:58pm UTC
Im not the kinda person who knows everything about c++....
Can you provide the code Jeff please?
Mar 13, 2008 at 2:44am Mar 13, 2008 at 2:44am UTC
You havn't read the above replies have you? I already have that code.. Without the start, and I don't think that it will close the other window...
Mar 13, 2008 at 7:11am Mar 13, 2008 at 7:11am UTC
Try to use an asyncronous spawn (spawn in _P_NOWAIT mode). For more details e.g. search for spawn in wikipedia
Mar 13, 2008 at 11:35am Mar 13, 2008 at 11:35am UTC
well, when I run this:
system("start explorer c:\\php" );
... It opens that folder, and the program closes. Isn't that what you want?
Last edited on Mar 13, 2008 at 11:44am Mar 13, 2008 at 11:44am UTC
Mar 13, 2008 at 11:58am Mar 13, 2008 at 11:58am UTC
I don't think that start is gonna make much of a difference but Ill try it.