Recent

Author Topic: One button to open an HTML page with default webBrowser?  (Read 4907 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
One button to open an HTML page with default webBrowser?
« on: August 27, 2011, 01:38:55 pm »
Good people,

I would like to have a button that fires the default Web Browser and a help page is opened, and would appreciate a brief guidance.

Don't need context sensitive help. Just want to try this simpler thing.

Thanks!

eny

  • Hero Member
  • *****
  • Posts: 1659
Re: One button to open an HTML page with default webBrowser?
« Reply #1 on: August 27, 2011, 01:53:26 pm »
Code: Pascal  [Select][+][-]
  1. uses Windows;
  2. ...
  3.  
  4. var s: string;
  5.     p: string;
  6. begin
  7.   s := 'cmd.exe';
  8.   p := '/c start d:\temp\info.htm';
  9.   ShellExecute(0, 'open', pchar(s), pchar(p), nil, SW_HIDE);
  10. end;
  11.  
All posts based on: Win11; Lazarus 4_4  (x64) 12-02-2026 (unless specified otherwise...)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: One button to open an HTML page with default webBrowser?
« Reply #2 on: August 27, 2011, 02:26:12 pm »
Code: [Select]
// uses LCLIntF
OpenDocument(YourHTMLDoc);

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: One button to open an HTML page with default webBrowser?
« Reply #3 on: August 27, 2011, 02:46:45 pm »
or?

openURL(<target string>);   

where <target string> could be something like:

'http://www.website.com'

'file:///C:/Temp/index.html'

'file:///C:/Documents/Project/HelpInfo.ods'
« Last Edit: August 27, 2011, 02:51:01 pm by IPguy »

 

TinyPortal © 2005-2018