IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBScript Discussion :

Problème manipulation Internet Explorer


Sujet :

VBScript

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2011
    Messages
    38
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Industrie

    Informations forums :
    Inscription : Septembre 2011
    Messages : 38
    Par défaut Problème manipulation Internet Explorer
    Bonjour à tous

    Je viens vous voir car j'ai un problème au niveau de la gestion d'internet explorer je m'explique :

    en effet, j'execute un batch par un script (pour rendre invisible ces actions), de plus ce scirpt affiche une page internet explorer où l'on peut voir une barre de progression (ceci fonctionne parfaitement)

    Je voudrais maintenant :

    - supprimer la barre de titre ainsi que les îcone de fermeture etc
    que sur cette fênetre.

    - que la fêtre soit modal en plein milieu de l'écran

    Merci beaucoup

    voici le code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
     
    Option Explicit
     
    Dim oIE
    Dim Divisor
    Dim TotalItters
    Dim Itter
    Dim oFSO
    Dim oFldr
    Dim oFile
    Dim oCSVFile
    Dim oShell
    Dim sPath
    Dim vSleep
    Dim sLine
    Dim x
    Dim vWindow
    Dim oApp
    Dim sWidth
    Dim SHeight
    Dim SWidthW
    Dim SHeightW
     
    On Error Resume Next
     
    sPath = Replace(WScript.ScriptFullName, WScript.ScriptName, "")
     
     
    set oShell = createobject("WScript.Shell")
    Set oFSO = CreateObject("scripting.filesystemobject")
    Set oFldr = oFSO.GetFolder(sPath)
    Set oIE = CreateObject("InternetExplorer.Application")
     
    TotalItters = 50
     
     
    'sleep for dirs with few files
    'so the user can see the progress
     
    If TotalItters <= 60 then
    	vSleep = 10
    End If
     
     
    With oIE
    	.AddressBar = False
    	.ToolBar = False
    	.StatusBar = False
    	.Resizable = False
    	.Navigate("about:blank")
    	Do Until .readyState = 4: wscript.sleep 100: Loop
     
    	With .Document
    		With .ParentWindow
    			SWidth = .Screen.AvailWidth
    			SHeight = .Screen.AvailHeight
    			SWidthW = .Screen.AvailWidth * .4
    			SHeightW = .Screen.AvailHeight * .15
    			.resizeto SWidthW, SHeightW
    			.moveto (SWidth - SWidthW)/2, (SHeight - SHeightW)/2
     
    			'Get the divisor for processing the line width
    			Divisor = Round((SWidthW-30) / TotalItters, 4)
     
    		End With
     
    	.WriteLn ("<html>")
    	.WriteLn ("<head>")
    	.WriteLn ("<script language=""vbscript"">")
    	.WriteLn ("Sub NoRefreshKey ()")
    	.WriteLn ("Select Case window.event.keycode")
    	.WriteLn ("Case 82: SuppressKey= window.event.ctrlkey")
    	.WriteLn ("Case 116: SuppressKey= True")
    	.WriteLn ("End Select")
    	.WriteLn ("If SuppressKey Then")
    	.WriteLn ("window.event.keycode= 0")
    	.WriteLn ("window.event.cancelbubble= True")
    	.WriteLn ("window.event.returnvalue= False")
    	.WriteLn ("End If")
    	.WriteLn ("End Sub")
    	.WriteLn ("Sub NoContextMenu ()")
    	.WriteLn ("window.event.cancelbubble= True")
    	.WriteLn ("window.event.returnvalue= False")
    	.WriteLn ("End Sub")
    	.WriteLn ("Set document.onkeydown= GetRef(""NoRefreshKey"")")
    	.WriteLn ("Set document.oncontextmenu= GetRef(""NoContextMenu"")")
    	.WriteLn ("</script>")
    	.WriteLn ("</head>")
    	.WriteLn ("<body>")
    	.writeln ("<DIV id='d1'>" & " Reading Files" & "</DIV>")
    	.writeln ("<hr id='hr1'; size=20; width=0; align='left'; noshade>")
    	.WriteLn ("</body>")
    	.WriteLn ("</html>")
     
    	With .ParentWindow.document.body
    		.style.backgroundcolor = "White"
    		.scroll="no"
    		.style.Font = "10pt 'Arial'"
    	End With
     
     
    	.Title = "Progress Bar"
    	oIE.Visible = True
    	WScript.Sleep 100
    	End With ' document
    End With ' oIE
     
     
     
    oShell.AppActivate "Internet Explorer", True
    Traitement
    For Each oFile In oFldr.Files
    	'increase the itter
    	Itter = Itter + Divisor
     
    	'itter the line
    	oIE.document.getElementById("hr1").width = Itter
    	'show the text progress to
    	oIE.document.getElementById("d1").innerhtml = "Initializing .... " 
    	For x = 0 To vSleep
    		WScript.Sleep 1
    	Next
    Next
     
    oIE.document.getElementById("d1").innerhtml = "FMT.exe will start"
     
     
    while((GetProcessRunning("FMT.exe") = FALSE))
    Wend
     
    oIE.Quit
     
    Sub Traitement
    		oShell.Run chr(34) & "./FMT.bat" & Chr(34), 0
    		Set oShell = Nothing
    End Sub
     
    Function GetProcessRunning(pStrProcessName)
    	Dim BoolStatus,Process,Objectservice
    	Set Objectservice = GetObject ("winmgmts:")
    	BoolStatus = False
    	for Each Process In Objectservice.InstancesOf ("Win32_Process")
    		If ucase(Process.Name) = ucase(pStrProcessName) Then
    			BoolStatus = True
    		End If
    	Next
    	GetProcessRunning = BoolStatus
    End Function
    merci

    Cordialement
    Loïc

  2. #2
    Expert éminent


    Profil pro
    Inscrit en
    Juin 2003
    Messages
    14 008
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 14 008
    Par défaut
    bonjour,
    Et la question?
    Quel est le probleme avec ton code?

  3. #3
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2011
    Messages
    38
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Industrie

    Informations forums :
    Inscription : Septembre 2011
    Messages : 38
    Par défaut
    Veillez m'excuser

    J'ai mis le code pour des fins de tests, le code fonctionne parfaitement

    cependant pouvez vous me dire comment on supprime la barre de titre mais aussi que la fenêtre s'ouvre en premier plan ?

    Cordialement
    Loïc

Discussions similaires

  1. problème avec internet explorer 7
    Par phil6 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 15/03/2007, 09h59
  2. Des problèmes avec Internet Explorer
    Par franc82 dans le forum Windows XP
    Réponses: 8
    Dernier message: 26/02/2007, 16h33
  3. Problème avec Internet Explorer
    Par edlmarche dans le forum WebDev
    Réponses: 4
    Dernier message: 29/11/2006, 09h55
  4. Réponses: 4
    Dernier message: 16/11/2006, 10h44
  5. Problème avec Internet Explorer et MSN Messenger
    Par matrxjean1984 dans le forum IE
    Réponses: 15
    Dernier message: 17/02/2006, 12h38

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo