How to open IE using win32


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: How to open IE using win32

  1. #1
    Join Date
    Dec 2006
    Posts
    4

    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,
    Bidesh Mukherjee,

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819

    Arrow

    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);
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Apr 2006
    Location
    Zagreb, Croatia
    Posts
    152
    the following api will open IE with the URL www.msn.com
    ShellExecute(0,"open","http://www.msn.com",0,0,SW_SHOW);

  4. #4
    Join Date
    Dec 2006
    Posts
    4
    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

  5. #5
    Join Date
    Apr 2006
    Location
    Zagreb, Croatia
    Posts
    152
    If you're using a richedit control for users to write an url then simply process WM_GETTEXT message to retrieve the url.

  6. #6
    Join Date
    Dec 2003
    Posts
    3,366
    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.

Similar Threads

  1. The JADE Open Framework, an open source RAD tool for the J2EE!
    By Dan Dubinsky in forum java.announcements
    Replies: 0
    Last Post: 06-27-2002, 09:02 PM
  2. Replies: 0
    Last Post: 06-08-2002, 07:51 PM
  3. Replies: 0
    Last Post: 05-25-2002, 01:53 AM
  4. list of open source projects and resources
    By Anonymous in forum Open Source
    Replies: 0
    Last Post: 05-12-2002, 09:05 PM
  5. Open source projects, open source resources
    By Anonymous in forum Open Source
    Replies: 0
    Last Post: 01-29-2002, 09:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center