Navigate with Default Internet Browser

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
endor
Posts: 17
Joined: Wed Sep 10, 2014 6:31 am

Navigate with Default Internet Browser

Post by endor »

Hi all,

I have been testing this sample: C:\hmg.3.3.1\SAMPLES\Controls\OLE

With this code:

Code: Select all

STATIC PROCEDURE IEXPLORER()

	LOCAL oIE

	oIE := CreateObject( "InternetExplorer.Application" )

	oIE:Visible := .T.

	oIE:Navigate( "http://www.hmgforum.com/" )

RETURN
what if I want it to navigate with the "Default Internet Browser",
If my default is Chrome, it will automatically navigate with Chrome
If firefox, it will navigate with firefox?

How do I write the Code?

Code: Select all

	LOCAL oIE

	oIE := CreateObject( "DefaultInternetBrowser.Application" )

	oIE:Visible := .T.

	oIE:Navigate( "http://www.hmgforum.com/" )
But this is not working.
-----------
Rey
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Navigate with Default Internet Browser

Post by danielmaximiliano »

Hello Endor :

Try .... Working

Code: Select all

/*


#include "hmg.ch"

FUNCTION Main()

	DEFINE WINDOW Win1 ;
		AT 0,0 ;
		WIDTH 800 ;
		HEIGHT 500 ;
		TITLE 'HMG ActiveX Support Demo' ;
		MAIN 

		DEFINE MAIN MENU

			POPUP "Navigate"
                                  MENUITEM "Run default explorer " ACTION RunDefault()
			END POPUP 			

		END MENU
	END WINDOW

	Center Window Win1
        Activate Window Win1

RETURN NIL


*------------------------------------------------------------------------------*
Procedure RunDefault()
*------------------------------------------------------------------------------*
Local oObject
Local cUrl   := "http://www.hmgforum.com/" 

oShell = Createobject("wscript.shell")
oShell:Run(cUrl)
Return
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
endor
Posts: 17
Joined: Wed Sep 10, 2014 6:31 am

Re: Navigate with Default Internet Browser

Post by endor »

Thanks Daniel for a quick reply, it works :D
-----------
Rey
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: Navigate with Default Internet Browser

Post by Agil Abdullah »

Thanks Endor & Daniel for sharing this topic.

Salam Hangat dari Jakarta
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Navigate with Default Internet Browser

Post by Javier Tovar »

Gracias DanielMaximiliano por compartir!

Saludos
Post Reply