Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change internet options programmatically
Message
 
À
12/02/2004 15:43:09
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00876707
Message ID:
00876840
Vues:
9
Well, probably I should use exactly words like, "IE properties" and "Multimedia options".
And yes, it is hard to understand from Help of how to deal with some methods and properties of INternetexplorer object. Therefore I posted my question here.

For now I ended up with following, which is OK for me at the moment.
LPARAMETERS lldisable
EXTERNAL CLASS Registry.VCX		&&needed for stand alone exe

IF VERSION(2)=0
	_vfp.Left=-1000
	ON ERROR cancel
ENDIF
DO case
CASE NOT TYPE("lldisable")$"CL"
	lldisable=.t.
case TYPE("lldisable")="C"	&& if called from Windows Run dialog/shortcut
	lldisable=IIF(LOWER(CHRTRAN(lldisable,".",""))=="f",.f.,.t.) 
endcase

CLEAR

HKEY_CURRENT_USER = -2147483647
Local loReg As Registry
Local lcKey, cOptVal

DIMENSION aKeyVal[4,3]
aKeyVal[1,1]="Play_Animations"
aKeyVal[2,1]="Play_Background_Sounds"
aKeyVal[3,1]="Display Inline Videos"
aKeyVal[4,1]="Display Inline Images"

FOR ia=1 TO ALEN(aKeyVal,1)
	aKeyVal[ia,2]=IIF(lldisable, "no","yes")
endfor

loReg = Newobject('Registry', Home()+'FFC\Registry.VCX')
lcKey = "SOFTWARE\Microsoft\Internet Explorer\Main"

FOR ia=1 TO ALEN(aKeyVal,1)
	cOptVal  = ''
	If loReg.GetRegKey(aKeyVal[ia,1],@cOptVal, lcKey, HKEY_CURRENT_USER) = 0
		aKeyVal[ia,3]= cOptVal
		
?		loReg.SetRegKey(aKeyVal[ia,1],aKeyVal[ia,2], lcKey,HKEY_CURRENT_USER) = 0
		
	endif
ENDFOR
loReg=null
>Good luck out there.
>The name "internet options" is misleading - it leads one to think it's about all the web access a Windows user can have. I always get disappointed when I discover (again) that it's actually just "IE options".
>
>IMO, the createobject("internetexplorer.application") is the way to go, and then a series of oie.SetProperty("propertyname",luValue) - but you'd have to dig deep into the object model to find things out. And I'm not sure you'd get too far before you start pulling your hairs out. There are things which have meaningless names - like TheaterMode. What does it mean, "play it like a movie", "there are live actors on the scene", "don't even start before you make sure there's a fireperson on duty in the building", "make breaks between acts" or what?
>

>>While downloading text information from the bunch of internet sites I would like to disable multimedia options, like show pictures or play sounds, and then set them back.
>>
>>Is it possible to do it programmatically with
>>oie=createobject("internetexplorer.application")
>>or somehow else (excluding Shell sendkeys())?
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform