How to open IE using win32
Hi,
Can u help me solving the problem.
I have created a window using win32. in that window handled a message WM_CREATE where i created another chiled window which is a rich edit control.
now i want to write the program so as when i type any thing like www.msn.com or any url it should be converted to and highlighted url string.
and clicking on the url which is in the richedit control the internet explorer should open with the url.
since i am new to win32 please write the code so that i can relate to.
thanks and regards,
[581 byte] By [
bidesh] at [2007-11-11 10:03:30]

# 1 Re: How to open IE using win32
put the typed in a string str say and run this :
str.find( ".com")
to get the location of first .com , same for .net , .org , make a couple seraches or use this :
str.find_first_of() to check them all one after second ,,
the rest is to get first space before and after the place of .com and then hilight this location .
about opening IE , the easiest method without API is to shell it ,
system("SHELL IE_PATH URL");
but care about this : don't use variables into system() command , this will be better :
myshell = "SHELL IE_PATH URL";
system(myshell);
Amahdy at 2007-11-11 20:59:30 >

# 2 Re: How to open IE using win32
the following api will open IE with the URL www.msn.com
ShellExecute(0,"open"," http://www.msn.com",0,0,SW_SHOW);
Ivan** at 2007-11-11 21:00:35 >

# 3 Re: How to open IE using win32
Thanks amadhy & Ivan as i am able to open the url if i mentioned in the shellexecute api. but i can not retrieve the url from the rich edit control. i tried to handle WM_LBUTTON message but as soon as i click or even move the mouse in the rich edit control the WM_LBUTTON message gets fired. where as i want to handle WM_LBUTTON message when the the mouse clicked on the url exists in the rich edit control
bidesh at 2007-11-11 21:01:29 >

# 4 Re: How to open IE using win32
If you're using a richedit control for users to write an url then simply process WM_GETTEXT message to retrieve the url.
Ivan** at 2007-11-11 21:02:40 >

# 5 Re: How to open IE using win32
And, you might make it a simple edit box instead. Rich edit controls are more for font control / coloring. You cant mix fonts in a standard one (you can set it repeatedly, but it does all the text inside), but if all it has is a url, you probably don't need to.
jonnin at 2007-11-11 21:03:39 >
