Delphi calls IE Open Web page

Source: Internet
Author: User

  1. Call the appropriate program to open
  2. Uses SHELLAPI;
  3. Procedure TForm1.  Button1Click (Sender:tobject);
  4. Begin
  5. Open With IE
  6. ShellExecute (Handle, ' open ', ' IExplore.EXE ', ' About:blank ', Nil, SW_SHOWNORMAL);
  7. Open With Firefox
  8. ShellExecute (Handle, ' open ', ' Firefox.exe ', ' About:blank ', Nil, SW_SHOWNORMAL);
  9. Open with default browser
  10. ShellExecute (Handle, ' open ', ' Explorer.exe ', ' About:blank ', Nil, SW_SHOWNORMAL);
  11. End
  12. Another way to call IE open
  13. Uses comobj;
  14. Procedure TForm1.  Button1Click (Sender:tobject);
  15. Procedure Openinie (Aurl: string);
  16. var ie:variant;
  17. Begin
  18. IE: = Createoleobject (' internetexplorer.application ');
  19. IE.  Visible: = true;
  20. IE.  Navigate (Aurl);
  21. End
  22. Begin
  23. Openinie (' www.132435.com ');
  24. End
  25. The second method can have more control
  26. Uses comobj;
  27. Procedure TForm1.  Button1Click (Sender:tobject);
  28. Procedure Openinie (Aurl: string);
  29. var ie:variant;
  30. Begin
  31. IE: = Createoleobject (' internetexplorer.application ');
  32. IE. Visible: = true; //Visible
  33. IE. Left: = 0;
  34. IE. Top: = 0;
  35. IE. Height: = 600; //Height
  36. IE. Width: = 800; //Width
  37. IE. MenuBar: = 0; //Cancel menu bar
  38. IE. Addressbar: = 0; //Cancel Address bar
  39. IE. Toolbar: = 0; //Cancel toolbar
  40. IE. StatusBar: = 0; //Cancel status bar
  41. IE. Resizable: = 0; //Do not allow user to change window size
  42. IE.  Navigate (Aurl);
  43. End
  44. Begin
  45. Openinie (' www.XXX.com ');
  46. End

Delphi calls IE Open Web page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.