[PB] lancer un ctrl activex après s'etre log ?

cs_Ryudo Messages postés 2 Date d'inscription lundi 7 février 2005 Statut Membre Dernière intervention 3 septembre 2006 - 2 sept. 2006 à 23:44
cs_Ryudo Messages postés 2 Date d'inscription lundi 7 février 2005 Statut Membre Dernière intervention 3 septembre 2006 - 3 sept. 2006 à 00:24
salut à tous

je suis en train de faire un projet de lanceur pour un jeu qui nécéssite de s'etre logger (via leur site).

je vous explique mon pb:

pour se logger au lieu de me casser la tete j'ai carrément pris la page html et je l'ai inclue dans un webbrowser qui est dans un form. jusqu'ici pas de pb.

alors maintenant j'attéris sur la page suivante qui nécéssite de cliquer sur un bouton .swf pour lancer le jeu (je pense qu'il utilise un controle activex).
certes j'ai juste besoin de cliquer ce bouton, mais j'ai envie d'utiliser un bouton sous mon réel form, car chargé une page tout pleine d'images dans un form de taille moyenne avec des scrollbars partout c'est pas très esthétique.

y'a t-il un moyen qu'une fois logger je puisse appuyer sur un bouton et que celui-ci execute l'activex demandé (avec les paramètres de log+mdp)?

voici un bout de code de la page avec l'activex (une fois que l'utilisateur s'est loggé):

<script language="javascript" type="text/javascript">
var objActiveX;
function install() {
if (!isMSIE()) return;
var obj = '<object id="HGPlugin9USA" width="0" Height="0" CLASSID="CLSID:CD995117-98E5-4169-9920-6C12D4C0B548" CODEBASE="http://gamedownload.ijjimax.com/gamedownload/dist/hgstart/HGPlugin9USA.cab#version=9,0,0,0" style="display:none"></object>';
document.write(obj);
objActiveX=eval("HGPlugin9USA");
}

function goLogin() {
document.location.href="http://login.ijji.com/login.nhn?nextURL=http%3A%2F%2Fgunbound.ijji.com%2Findex.nhn";
}

function startGame(launchScript){
if ( preStartGame(launchScript) == false ) return;

_launchScript = launchScript.launchScript;
if (!check(launchScript.gameId)) return false;

if (launchScript =="") {
alert("Invalid Game Information");
return false;
}

if( !launchScript.isLogin ) {
goLogin();
return false;
}

if (!launchScript.isValid) {
alert("This channel does not exist.");
return false;
}

wbersPosLog(launchScript.gameId, "110");
objActiveX.hgs_startGame(launchScript.launchScript);
postStartGame(launchScript);
}

function wbersPosLog(gameId, code) {
ajaxHttpRequest("http://wbers.ijji.com/wbers/post.php?project=" + gameId + "&id=ideal&subject=poslog&value=" + code);
function preStartGame(launchScript) {
// override for doing something
return true;
}

function postStartGame(launchScript) {
// override for doing something
return true;
}

function getLaunchScript(gameId, subId, channelId, callback) {
if (typeof(gameId) =="undefined" || typeof(subId) == "undefined" ) {
alert("Invalid Game Information");
return false;
}
if (!check(gameId)) return false;

var channelString = "";
if ( channelId != '' && typeof(channelId) != "undefined" ) {
channelString = "&channelId=" + channelId;
}

if ( callback '' || typeof(callback) "undefined" ) {
callback = "startGame";
}

ajaxHttpRequest("/common/launch.nhn?gameId=" + gameId + "&subId=" + subId + channelString, callback);
}

function check(gameId) {
if (!isMSIE()) {
document.location.href="/common/activex.nhn?msie=" + isMSIE() + "&xpsp2=" + isXPSP2() + "&next=http%3A%2F%2Fgunbound.ijji.com%2Findex.nhn";
return false;
}
var o = document.getElementById("HGPlugin9USA");
try {
o.hgs_chkDown();
if ( typeof(o)=="object" ) {
o.style.pixelWidth = 0;
o.style.pixelHeight = 0;
}
} catch (e) {
goInstallActivexPage(gameId);
return false;
}

deleteCookie(COOKIE_AVX_TR);
return true;
}

var COOKIE_AVX_TR = "S_TRAX";

function goInstallActivexPage(gameId) {
activexInstallTracking(gameId);
document.location.href="/common/activex.nhn?msie=" + isMSIE() + "&xpsp2=" + isXPSP2() + "&next=http%3A%2F%2Fgunbound.ijji.com%2Findex.nhn";
}

function activexInstallTracking(gameId) {
wbersPosLog(gameId, "0000");
if ( getCookie(COOKIE_AVX_TR) == "true") {
wbersPosLog(gameId, "0001");
} else {
setCookie(COOKIE_AVX_TR, "true");
}
}

function isInstall(){
if (!isMSIE()) {
return true;
}
var o = document.getElementById("HGPlugin9USA");
try {
o.hgs_chkDown();
if ( typeof(o)=="object" ) {
o.style.pixelWidth = 0;
o.style.pixelHeight = 0;
}
} catch (e) {
return false;
}
return true;

}

function downActiveX(url) {
if ( check() ) {
document.location.href =url;
}
}

install();
</script>

merci de toute aide éventuelle, je suis dessus depuis quelques jours et je bloque !!!

2 réponses

PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
3 sept. 2006 à 00:11
salut,
sympa la mise en page

premier tuto...., peut-être
++
<hr size="2" width="100%" />Prenez un instant pour répondre à ce sondage svp
0
cs_Ryudo Messages postés 2 Date d'inscription lundi 7 février 2005 Statut Membre Dernière intervention 3 septembre 2006
3 sept. 2006 à 00:24
merci pour cette premiere reponse, j'ai beaucoup trop de parametres à prendre en compte et je ne sais pas par ou commencer...
0
Rejoignez-nous