I am a beginner with Borland C++ 3 (standard) Builder<br>And have a question:<br><br>Is it possible to launch a browser from a form?<br>and if so How??
You can use the API function CreateProcess to start any program you want:<br><br>The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file. <br><br>BOOL CreateProcess(<br><br> LPCTSTR lpApplicationName, // pointer to name of executable module <br> LPTSTR lpCommandLine, // pointer to command line string<br> LPSECURITY_ATTRIBUTES lpProcessAttributes, // pointer to process security attributes <br> LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to thread security attributes <br> BOOL bInheritHandles, // handle inheritance flag <br> DWORD dwCreationFlags, // creation flags <br> LPVOID lpEnvironment, // pointer to new environment block <br> LPCTSTR lpCurrentDirectory, // pointer to current directory name <br> LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO <br> LPPROCESS_INFORMATION lpProcessInformation // pointer to PROCESS_INFORMATION <br> <br> <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href=
Thanks zBuilder for you Answer but still I am a tight beginner and by that wery unfamiliar to some codes and program combinations....<br>So far I am trying to make a simple HTML form to create Internet capable sites easy..... So for so good.. ;/<br>My main problem is to launche the Browser with a file that is temporarily saved in the program location.. to save is not the problem, but launce the file.... If not to much to ask... please write a quick code that uses a button to launch a browese i.e. Internet Explorer or Netscape.
Ahhh... Ok. you wanna find the default browser and open an HTML file with it? Then ShellExecute is what you want: <br><br>#include <shellapi.h><br>ShellExecute( hwnd,"open","\\temp\\agent.htm", NULL, "\\temp", SW_SHOWMAXIMIZED);<br><br>The above code will open the file "agent.htm" in the directory \temp using the default browser. hwnd is the handle of the parent window (your application). Checking the return value of ShellExecute will let you know what caused it to fail if nothing happens. <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href=
OOOppps! Win95 likes the FULL path to the file- include the drive letter like so: If its on C drive that is<br><br>ShellExecute( hwndMain,NULL,"agent.htm", NULL, <b>"C:\\temp"</b>, SW_SHOWMAXIMIZED); <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.