Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11343

Re: Fenster per Code schließen

From Gloops <gloops@zailes.invalid.org.invalid>
Newsgroups microsoft.public.scripting.vbscript
Subject Re: Fenster per Code schließen
Date 2016-07-30 22:13 +0200
Organization Serveur de salon
Message-ID <nnj1or$loc$1@usenet.pasdenom.info> (permalink)
References <nni3n9$r9c$1@news.albasani.net> <XnsA6558E8FE5AD0eejj99@194.109.6.166>

Show all headers | View raw


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.

Well, I did such things in VB, but not in VBS. Any idea ?

Or shall we answer that chosing another language would be a better idea ?

Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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