Author | Topic: CreateObject - Internet Explorer | |
---|---|---|
Chris Palmer | CreateObject - Internet Explorer on Mon, 20 May 2013 12:42:58 +0100 I have this simple Function to open Internet Explorer from within the system :- FUNCTION OpenWebsite(qWebAddress) oOw := CreateObject( "InternetExplorer.Application" ) oOw:visible := .t. oOw:Navigate( qWebAddress ) return .t. Is it possible to default to other browsers ( i.e. Chrome ) by the users default setting ? Thanks for any help Chris | |
James Loughner | Re: CreateObject - Internet Explorer on Mon, 20 May 2013 12:34:45 -0400 On 05/20/2013 07:42 AM, Chris Palmer wrote: > I have this simple Function to open Internet Explorer from within the system > :- > > FUNCTION OpenWebsite(qWebAddress) > oOw := CreateObject( "InternetExplorer.Application" ) > oOw:visible := .t. > oOw:Navigate( qWebAddress ) > return .t. > > Is it possible to default to other browsers ( i.e. Chrome ) by the users > default setting ? > > Thanks for any help > Chris > > Depends on if they have an ActiveX interface. Jim | |
Andreas Gehrs-Pahl | Re: CreateObject - Internet Explorer on Mon, 20 May 2013 13:03:46 -0400 Chris, >Is it possible to default to other browsers ( i.e. Chrome ) by the users >default setting ? Why not let the OS do that for you? You could use the following: ShellExecuteOpen(qWebAddress) ************************************************************** * SW Constants (sorted alphabetically) for "ShellExecuteA()" * ************************************************************** #define SW_FORCEMINIMIZE 11 #define SW_HIDE 0 #define SW_MAX 11 #define SW_MAXIMIZE 3 #define SW_MINIMIZE 6 #define SW_RESTORE 9 #define SW_SHOW 5 #define SW_SHOWDEFAULT 10 #define SW_SHOWMAXIMIZED 3 #define SW_SHOWMINIMIZED 2 #define SW_SHOWMINNOACTIVE 7 #define SW_SHOWNA 8 #define SW_SHOWNOACTIVATE 4 #define SW_SHOWNORMAL 1 Function ShellExecuteOpen(cFile, cParameters, cDir, nMode, oDlg) LOCAL cStartDir := iif(empty(cDir), CurDir(), cDir) LOCAL nWinMode := iif(nMode == NIL, SW_SHOWNORMAL, nMode) LOCAL nHandle := iif(oDlg == NIL, AppDesktop():GetHWnd(), oDlg:GetHWnd()) LOCAL nError := DllCall("Shell32.dll", DLL_STDCALL, "ShellExecuteA", nHandle, "open", cFile, cParameters, cStartDir, nWinMode) return (nError) Hope that helps, Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas.GP@Charter.net Andreas.Gehrs-Pahl@InterAct911.com Andreas.Gehrs-Pahl@EJusticeSolutions.com Andreas@DDPSoftware.com web: http://www.Aerospace-History.net |