Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening an ie browser from a regular window 1

Status
Not open for further replies.

bobo12

Programmer
Dec 26, 2004
74
US
anyone know how to open an ie browser from a regular window?
i tried Shell, & ShellExecute, but i got errors. undeclared id for ShellExecute.

what i am trying to do is to put a img in a window, and if a user clicks on the img, then they go to a certain site?
how do i do this? i am fairly new and it's really intimidating the whole win32api. source code will help tremendously.
 
Here's how you open an IE window and go to MSDN:

Code:
#include <windows.h>
#include <shellapi.h>

#pragma comment(lib, "shell32.lib")

int main()
{
	ShellExecute(NULL, "open", "Iexplore", NULL, NULL, SW_MAXIMIZE);
	ShellExecute(NULL, "open", "[URL unfurl="true"]http://msdn.microsoft.com",[/URL] NULL, NULL, SW_MAXIMIZE);
	return 0;
}

The first ShellExecute isn't technically necessary, but one of my pet peeves is application that take whatever IE window is currently open and use it to load their site. This way you launch a new IE window instead.
 
now supposse i wanted to launch this code from a picture/img on the window, how would be able to do this?
i am familiar with html <img tags but i am not sure how to do this in win32api.
 
I assume this image is in some kind of control? Like on a dialog or something? Just wait for WM_LBUTTONDOWN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top