Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11123
| From | "Dave \"Crash\" Dummy" <invalid@invalid.invalid> |
|---|---|
| Newsgroups | microsoft.public.scripting.vbscript |
| Subject | Re: have vbscript open media player in a top left window without border |
| Date | 2015-07-23 17:37 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <mormn0$ue3$1@dont-email.me> (permalink) |
| References | <da4f9c69-5e5a-47fb-b642-cd0aa213576c@googlegroups.com> <moo24s$vr$1@dont-email.me> <mop4mb$dv1$1@dont-email.me> <mopj6o$e0h$1@dont-email.me> |
Mayayana wrote:
> Your code works. I have an mp3 on my Desktop
> and can load it with the following HTA:
>
> '------------ begin hta----------------------
>
> <HTML>
> <HEAD>
> <HTA:APPLICATION ID="Player">
>
> <TITLE></TITLE>
> <SCRIPT LANGUAGE="VBScript">
> Sub window_onload()
> Dim HTAPath, sCommand
> Dim s, Pt1, iQ, i2, Q2
> window.resizeto 400, 300
> window.moveto 0, 0
>
> s = Player.commandLine
> Q2 = Chr(34)
> iQ = 0
> For i2 = 1 to Len(s)
> Select Case Mid(s, i2, 1)
> Case " "
> If iQ Mod 2 = 0 Then
> HTAPath = Left(s, i2 - 1)
> HTAPath = Trim(Replace(HTAPath, Q2, ""))
> If Len(s) > i2 Then
> sCommand = Right(s, Len(s) - i2)
> sCommand = Trim(Replace(sCommand, Q2, ""))
> End If
> Exit For
> End If
> Case Q2
> iQ = iQ + 1
> Case Else
> '-
> End Select
> Next
>
> MediaPlayer.URL = sCommand
> End Sub
>
> </SCRIPT>
>
> </HEAD>
> <BODY>
> <OBJECT ID="MediaPlayer" Name="MediaPlayer"
> style="margin: 0px; margin: 0px; position:absolute; LEFT: 0px; TOP: 0px;
> width: 370px; HEIGHT: 270px;"
> classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
> <PARAM NAME="AutoStart" VALUE="false">
> <PARAM NAME="enableContextMenu" VALUE="true">
> <PARAM NAME="ShowControls" VALUE="true">
> <PARAM NAME="AnimationAtStart" VALUE="false">
> <PARAM NAME="TransparentAtStart" VALUE="false">
> <PARAM NAME="ShowStatusbar" VALUE="true">
> <PARAM NAME="AllowChangeDisplaySize" VALUE="true">
> <PARAM NAME="AutoSize" VALUE="false">
> </OBJECT>
> </BODY></HTML>
> '-------------------------- end hta -----------------
>
> I can call it with the following VBScript:
>
> '------------begin script----------------------
> Set SH = CreateObject("WScript.Shell")
> sh.Run "C:\windows\desktop\player.hta " & "C:\windows\desktop\wilsons
> snipe.mp3"
> Set sh = Nothing
> '-------end script----------------------------
>
> It's a bit clunky because the command line
> for an HTA is a mess, but it works. It still
> has a basic window frame, but I was able,
> with someexperimenting, to get a pretty good
> fit of WMP into the window.
>
You can get rid of the borders and caption bar in HTA windows
by choosing the appropriate options:
<HTA:application caption="no" border="none" innerborder="no">
See
https://msdn.microsoft.com/en-us/library/ms536471(v=vs.85).aspx
--
Crash
All this time I thought my analyst was saying I'm psychic...
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Find similar
have vbscript open media player in a top left window without border robreijm@gmail.com - 2015-07-22 01:58 -0700
Re: have vbscript open media player in a top left window without border "Mayayana" <mayayana@invalid.nospam> - 2015-07-22 08:28 -0400
Re: have vbscript open media player in a top left window without border "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2015-07-23 17:37 -0400
csiph-web