Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11344
| Newsgroups | microsoft.public.scripting.vbscript |
|---|---|
| Subject | Re:Fenster per Code schliessen? |
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
| References | <nni3n9$r9c$1@news.albasani.net> <XnsA6558E8FE5AD0eejj99@194.109.6.166> <nnj1or$loc$1@usenet.pasdenom.info> |
| Date | 2016-07-30 23:28 +0200 |
| Message-ID | <XnsA655EEC09E7B9eejj99@194.109.6.166> (permalink) |
Gloops <gloops@zailes.invalid.org.invalid> wrote on 30 Jul 2016 in
microsoft.public.scripting.vbscript:
> Le 30/07/2016 à 14:00, Evertjan. a écrit :
>> "Wendelin Uez" <wuez@online.de> wrote on 30 Jul 2016 in
>> microsoft.public.scripting.vbscript:
>>
>>> In meinem Backup.vbs möchte ich während des Backups ein Fenster mit
>>> einem Hinweis anzeigen, welches im selben Script nach Ausführung
>>> diverser Arbeiten wieder geschlossen wird, und zwar automatisch, ohne
>>> Benutzereingabe.
>>>
>>> Eine MsgBox kommt deshalb nicht in Frage.
>>>
>>> Ich habe jetzt einen Weg gefunden, ein Fenster mit eigenem Text
>>> anzuzeigen, indem eine .hta-Datei erzeugt und ausgeführt wird:
>>>
>>> <html>
>>> <head>
>>> <title>HTAWINDOW</title>
>>> </head>
>>> <body>
>>> <script language="vbscript">
>>> Window.resizeTo 450,300
>>> </script>
>>> BACKUP wird ausgeführt, bitte warten...
>>> </body>
>>> </html>
>>>
>>> als message.hta speichern und ausführen mit
>>>
>>> Set Obj = CreateObject("WScript.Shell")
>>> Obj.run "message.hta",1,false
>>>
>>> Danach folgt mein Backup-vbs-Code, aber wie schließe ich jetzt dieses
>>> Fenster wieder per Code, ohne Benutzerklick?
>>>
>>> Oder gibt es eine andere Methode, ein Fenster per Code zu erzeugen,
>>> anzuzeigen und später wieder zu schließen?
>>
>> <SCRIPT LANGUAGE="VBScript">
>>
>> Dim objNewWindow
>>
>> Sub btnOne_onClick
>> Set objNewWindow = Window.Open("http://www.wrox.com/",
>> "myWindowOne",
>> "toolbar=no, menubar=no, location=no, directories=no")
>> End Sub
>>
>> Sub btnDOne_onClick
>> objNewWindow.Close
>> End Sub
>>
>> Sub btnCloseMe_onClick
>> Window.Close
>> End Sub
>>
>> </SCRIPT>
>>
>> <https://msdn.microsoft.com/en-us/library/ms952668.aspx>
>
>
>
> Hello,
>
> I am afraid "ohne Benutzerklick" was the key expression, with this
> confirmation : "Eine MsgBox kommt deshalb nicht in Frage"
> that you could translate by "please no msgbox", the user must not have
> to click anywhere. The message tells "backup in progress, please wait",
> so closing the window must not be performed by a click on a button, but
> by the end of the backup made by the caller.
>
> So, a window with no button at all could rather be that. In the spirit,
> the ideal solution would be showing a progressbar, but this was not
> asked, not sure the caller has any way to update it ...
>
> But obj.Run does not return the window as an object, that the caller
> could close when the backup treatment is at the end.
>
> This would surely be the best way to answer, another way is to select
> the window by the APIs, but then I am afraid you have to use a program
> to do that.
The calling window can close the window by: objNewWindow.Close
The window itself can close by: Window.Close
That does not mean a "Benutzerklick" [user-click] is needed.
The VBS code in the same or the calling page can poll the server with
xmlhttp at reasonable intervals to see if the process is finished.
[or even how far the process is in execution.]
I think this works in HTA too.
> Well, I did such things in VB, but not in VBS. Any idea ?
You cannot "do" VB in HTA or HTML.
> Or shall we answer that chosing another language would be a better idea
> ?
I would prefer to do clientside javascript and serverside VBS,
but that is just my personal lazyness.
Or do you mean that we should converse in German or any other language?
... to close the windows for the evening breeze?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Fenster per Code schließen "Wendelin Uez" <wuez@online.de> - 2016-07-30 13:40 +0200
Re: Fenster per Code schließen "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-30 14:00 +0200
Re: Fenster per Code schließen Gloops <gloops@zailes.invalid.org.invalid> - 2016-07-30 22:13 +0200
Re:Fenster per Code schliessen? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-30 23:28 +0200
Re: Fenster per Code schliessen? Gloops <gloops@zailes.invalid.org.invalid> - 2016-07-31 23:32 +0200
Re: Fenster per Code schliessen? "Wendelin Uez" <wuez@online.de> - 2016-08-12 19:43 +0200
Re: Fenster per Code schliessen? "R.Wieser" <address@not.available> - 2016-08-13 10:22 +0200
Re: Fenster per Code schliessen? Gloops <gloops@zailes.invalid.org.invalid> - 2016-08-14 18:11 +0200
Re: Fenster per Code schliessen? Gloops <gloops@zailes.invalid.org.invalid> - 2016-08-14 18:50 +0200
Re: Fenster per Code schließen Thomas Langer <spam4nl@langer-online.net> - 2016-07-31 15:13 +0200
Re: Fenster per Code schließen "R.Wieser" <address@not.available> - 2016-07-31 15:34 +0200
Re: Fenster per Code schließen "Wendelin Uez" <wuez@online.de> - 2017-11-10 15:52 +0100
Re: Fenster per Code schließen "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-11-10 16:20 +0100
csiph-web