• Advertisement

Archived

This topic is now archived and is closed to further replies.

ShellExecute

This topic is 6063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok, this is realy silly but i'm only running on anoyance, for the past hour i've been trying to figure this out. ok here's the code to the program, all 18 lines of it, it's a simple program so i can do quick searches of google(i.e. progname Gamedev).
      
#include <windows.h>		// Header File For Windows


#include <stdio.h>		// standard input/output


int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{


	char buffer[256]; //buffer for URL

#ifdef _DEBUG

	MessageBox(NULL, lpCmdLine, "URL search term", MB_OK);
#endif
	sprintf(buffer, "http://www.google.com/search?hl=en&safe=off&q=%s", lpCmdLine);

	ShellExecute(NULL, "open", buffer, NULL, NULL, SW_SHOWNORMAL);

	return 0;
}
      
ok, MSVC++ 6.0 says lookup.cpp(15) : error C2065: 'ShellExecute' : undeclared identifier , but if i drop it into a NeHe project (i used it to link to a site of course) it works fine. It's in a blank win32 project, and when i copy/pasted all the NeHe winclass stuff into the project it wouldn't work (i even copy/pasted all the included libraries...) i'm sure there is a realy simple solution but it's beyond me at the moment, and when i search the MSN docs all i get is usage but it doesn't say to include and headers so i'm lost. edit - fixed some editing in the source block. edit - fixed some editing in the source block. ------------------------------------------------- Don't take life too seriously, you'll never get out of it alive. -Bugs Bunny Edited by - Authustian on July 18, 2001 4:23:00 AM Edited by - Authustian on July 18, 2001 4:30:15 AM

Share this post


Link to post
Share on other sites
Advertisement
It''s prototyped in ShellAPI.h. For future reference, don''t forget that Windows'' Find feature can find text in files...

Share this post


Link to post
Share on other sites
thank you, thank you, and thank you.

-------------------------------------------------
Don''t take life too seriously, you''''ll never get out of it alive. -Bugs Bunny

Share this post


Link to post
Share on other sites

  • Advertisement