I am using VC++ 2008, and i am trying to create a little software to search for a folder and explore it in a new window.(like I open/explore c: drive) I don't need to browse for the folder and open it from there.

I tried using 'ShellExecute' but didn't work.when i compile the code it gives me errors in 'shellapi.h'. What should I do?

I used the following

#include "shellapi.h"


int main(int argc, char* argv[])
{
ShellExecute(handle, "open","C:\\", NULL, NULL, SW_SHOWNORMAL);
return 0;
}

My problem is i have no idea how do that.
Please help

As I told you in your other thread: when posting code, use CODE TAGS

If you want to use <shellapi.h> (not in quotes) you have to #include <windows.h> first.

Also 'handle' looks a bit undefined doesn't it?
How about changing it to NULL

As I told you in your other thread: when posting code, use CODE TAGS

If you want to use <shellapi.h> (not in quotes) you have to #include <windows.h> first.

Also 'handle' looks a bit undefined doesn't it?
How about changing it to NULL

Thanks man,It worked - I included windows.h and wola!
and I will remember to use code tags next time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.