Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Terminal Services (TSWeb) Auto Connect Full Screen

Status
Not open for further replies.

Webflex

Technical User
Apr 20, 2001
101
GB
Hi

I am setting up a terminal services login page that is called with the following url

Code:
 <a target=&quot;_blank&quot; href=&quot;[URL unfurl="true"]http://address/tsweb/connect.asp?server=servername&Fs=1&&quot;>[/URL]

this is supposed to open a full screen terminal services session, but what happens is a default 800 x 600 screen with a black border to the full screen resolution.

The default.htm and connect.asp page codes are below. What I want to do is to launch into a full screen (no borders) session (as the option in default.htm allows) without having the user fill in the form, just click on the url.

TIA
Webflex

default.htm
Code:
<html>
<head>
<title>Connect to Terminal Server</title>
<style type=&quot;text/css&quot; media=&quot;screen&quot;>
p { color:&quot;#000000&quot;; font-family: &quot;Verdana, Arial, Helvetica&quot;; font-size:&quot;65%&quot;}
h1 { font-size: 100%; font-family: verdana, arial, helvetica; font-weight: bold;
		margin-top: 0em;}
p.indent { margin-left: 3em; margin-top: .5em; line-height: 1.25em; margin-bottom: .2em; margin-right: 1em;}
.button {
	FONT-FAMILY: Verdana, Helvetica, Arial, San-Serif;
	font-weight:normal;
	font-size:70%;
	color:#000000;
	background-color:#ffffff;
	border-color:#6699ff;
	margin-top:6pt;
	margin-left: .5em;
	
}
.topspace {margin-top: .08em; }
</style>
</head>

<body bgcolor=&quot;#ffffff&quot;>
<script language=&quot;vbscript&quot;>
sub checkClick
      if Document.all.Check1.Checked then
         Document.all.tableLogonInfo.style.display = &quot;&quot;
         Document.all.editUserName.Disabled = false
         Document.all.editDomain.Disabled = false
      else
         Document.all.tableLogonInfo.style.display = &quot;none&quot;
         Document.all.editUserName.Disabled = true
         Document.all.editDomain.Disabled = true
      end if
end sub

sub btnLogin
   'Create connection URL and redirect to login page
   conUrl = &quot;connect.asp&quot;
   
   'server
   if not Document.all.Server.value = &quot;&quot; then
      conUrl = conUrl + &quot;?Server=&quot; & Document.all.Server.value & &quot;&&quot;
   else
      conUrl = conUrl + &quot;?Server=&quot; & Document.location.hostname & &quot;&&quot;
   end if

   bAutoLogon = FALSE
   if Document.all.CheckBoxAutoLogon.checked then
      bAutoLogon = TRUE
   end if
   
   if bAutoLogon then
         conUrl = conUrl + &quot;UserName=&quot; & Document.all.UserName.Value & &quot;&&quot;
         conUrl = conUrl + &quot;Domain=&quot; & Document.all.Domain.Value & &quot;&&quot;
   end if
   
   'resolution width-height
   select case document.all.comboResolution.value
  case &quot;1&quot;
      conUrl = conUrl + &quot;FS=&quot; & 1 & &quot;&&quot;
      resWidth  = screen.width
      resHeight = screen.height
   case &quot;2&quot;
      resWidth  = &quot;640&quot;
      resHeight = &quot;480&quot;
   case &quot;3&quot;
      resWidth  = &quot;800&quot;
      resHeight = &quot;600&quot;
   case &quot;4&quot;
      resWidth  = &quot;1024&quot;
      resHeight = &quot;768&quot;
   case &quot;5&quot;
      resWidth  = &quot;1280&quot;
      resHeight = &quot;1024&quot;
   case &quot;6&quot;
      resWidth  = &quot;1600&quot;
      resHeight = &quot;1200&quot;
   end select
   
   conUrl = conUrl + &quot;rW=&quot; & resWidth & &quot;&&quot;
   conUrl = conUrl + &quot;rH=&quot; & resHeight & &quot;&&quot;
   'go to the login page
   Window.Navigate(conUrl)
end sub

</script>

<!--   
-->




<a href=&quot;[URL unfurl="true"]http://www.microsoft.com/windows2000&quot;><img[/URL] border=&quot;0&quot; src=&quot;win2000l.gif&quot; align=&quot;left&quot; alt=&quot;Windows2000 logo&quot; width=&quot;198&quot; height=&quot;124&quot;></a><a href=&quot;[URL unfurl="true"]http://www.microsoft.com/windows2000&quot;><img[/URL] border=&quot;0&quot; src=&quot;win2000r.gif&quot; align=&quot;top&quot; width=&quot;253&quot; height=&quot;76&quot; alt=&quot;Windows2000 logo&quot;></a><br>
<h1>Terminal Services Web Connection</h1>
<br>

<table border=&quot;0&quot; width=&quot;640&quot; cellspacing=&quot;0&quot; cellpadding=0 style=&quot;margin-top: -1em;&quot;>
<!-- Graphic bar row  -->
<tr>
<td width=&quot;50%&quot;></td>
<td colspan=3 align=&quot;left&quot; valign=&quot;middle&quot;><img src=&quot;bluebarh.gif&quot; alt=&quot;blue bar graphic&quot; width=&quot;325&quot; height=&quot;8&quot;></td>
</tr> 
<!-- Row 1 -->
    <tr>
<!-- Column 1 spans 4 rows -->
    <td valign=&quot;top&quot; width=&quot;50% &quot; rowspan=&quot;4&quot;>
          <p class=indent>Type the name of the Terminal server you want to use, select the screen size for your connection, and then click <b>Connect</b>.</p>
          <p class=indent>When the connection page opens, you can add it to your Favorites for easy connection to the same Terminal server.</p>
    </td>
<!-- Column 2 spans 4 rows-->
	<td rowspan=4 valign=&quot;top&quot; align=&quot;left&quot;><img src=&quot;bluebarv.gif&quot; alt=&quot;blue bar graphic&quot; border=0 width=&quot;8&quot; height=&quot;330&quot;>
	</td>
	
<!-- Column 3 -->		
    <td width=&quot;10%&quot; valign=&quot;middle&quot;>     
         <label accessKey=&quot;S&quot; for=&quot;editServer&quot;>
         <br><p align=&quot;right&quot;> <u>S</u>erver:</label></p>
		  

	</td>
		  
<!-- Column 4 -->		  
	<td width=&quot;40%&quot; valign=&quot;bottom&quot;>
	<br>  <input type=&quot;text&quot; name=&quot;Server&quot; size=&quot;41&quot; id=&quot;editServer&quot;>
	
	</td>
	</tr>
<!-- Row 2 -->
<tr>
<!-- Column 3 -->
<td valign=&quot;middle&quot;>
<p align=&quot;right&quot;><label accessKey=&quot;Z&quot; for=&quot;comboRes&quot; class=&quot;sizespace&quot;>Si<u>z</u>e:</p></td>
<!-- Column 4 -->
<td valign=&quot;bottom&quot;>  <select size=&quot;1&quot; name=&quot;comboResolution&quot; id=comboRes class=&quot;topspace&quot;>
              <option selected value=&quot;1&quot;>Full-screen</option>
              <option value=&quot;2&quot;>640 by 480</option>
              <option value=&quot;3&quot;>800 by 600</option>
              <option value=&quot;4&quot;>1024 by 768</option>
              <option value=&quot;5&quot;>1280 by 1024</option>
              <option value=&quot;6&quot;>1600 by 1200</option>
            </select> </label>
</td>
</tr>
<!-- Row 3 -->
<tr>
<!-- Column 3 -->
<td></td>
<!-- Column 4 -->
<td align=&quot;bottom&quot;>			
	 <p class=topspace> <input type=&quot;checkbox&quot; name=&quot;CheckBoxAutoLogon&quot; ID=Check1 value=&quot;OFF&quot; onclick = &quot;checkClick&quot;><label for=&quot;Check1&quot; accesskey=&quot;l&quot;>Send <u>l</u>ogon information for this connection </label><br>
	  
<span ID=&quot;tableLogonInfo&quot; style=&quot;display: none&quot;>

            <p align=&quot;right&quot; class=topspace>
			<br> 
			<u>U</u>ser name:
                <label accessKey=&quot;U&quot; for=&quot;editUserName&quot;><input type=&quot;text&quot; name=&quot;UserName&quot; id=editUserName size=&quot;25&quot;></label><br>
			<u>D</u>omain:
          <label accessKey=&quot;D&quot; for=&quot;editDomain&quot;>
          <input type=&quot;text&quot; name=&quot;Domain&quot; id=editDomain size=&quot;25&quot;></label></p></span>	
		  <input type=&quot;submit&quot; value=&quot;Connect&quot; name=&quot;ButtonLogin&quot; OnClick=BtnLogin class=&quot;button&quot;>
</td>
</tr>
<!-- Row 4 -->
<tr>
<!-- Column 3 -->
<td  height=&quot;215&quot;> </td>
<!-- Column 4 -->
<td> </td>
</tr>

 
     
</table>


</body>
</html>

connect.asp
Code:
<html>
<head>
<title> Terminal Services Connection to <%Response.Write Request.QueryString(&quot;Server&quot;)%></title>
</head>

<body>

<script language=&quot;vbscript&quot; >
<!--
const FullScreenWarnTxt1 = &quot;Your current security settings do not allow automatically switching to fullscreen mode.&quot;
const FullScreenWarnTxt2 = &quot;You can use ctrl-alt-pause to toggle your terminal services session to fullscreen mode&quot;
const FullScreenTitleTxt = &quot;Terminal Services Connection &quot;
Const ErrMsgText         = &quot;Error connecting to terminal server: &quot;

sub window_onLoad()
      If not &quot;<%Response.Write Request.QueryString(&quot;Server&quot;)%>&quot; = &quot;&quot; then
          srvName = &quot;<%Response.Write Request.QueryString(&quot;Server&quot;)%>&quot;
      else
          srvName = Document.location.hostname
      end if
      MsTsc.Server	 =  srvName
      Document.all.srvNameField.innerHtml = srvName
      MsTsc.Domain       =      &quot;<%Response.Write Request.QueryString(&quot;Domain&quot;)%>&quot;
      MsTsc.UserName     =      &quot;<%Response.Write Request.QueryString(&quot;UserName&quot;)%>&quot;
      if  &quot;<% Response.Write Request.QueryString(&quot;FS&quot;) %>&quot; = &quot;1&quot; then
         if MsTsc.SecuredSettingsEnabled then
            MsTsc.SecuredSettings.FullScreen = &quot;<% Response.Write Request.QueryString(&quot;FS&quot;) %>&quot; = &quot;1&quot;
         else
            msgbox (FullScreenWarnTxt1  & vbCrLf & FullScreenWarnTxt2 )
         end if
      end if
      
      MsTsc.FullScreenTitle = FullScreenTitleTxt & &quot;(&quot; & &quot;<%Response.Write Request.QueryString(&quot;Server&quot;)%>&quot; & &quot;)&quot;
      MsTsc.Connect()
end sub
-->
</script>
<center>
        <table>
        <tr>
        <OBJECT language=&quot;vbscript&quot; ID=&quot;MsTsc&quot;
        CLASSID=&quot;CLSID:1fb464c8-09bb-4017-a2f5-eb742f04392f&quot;
        CODEBASE=&quot;mstscax.cab#version=5,0,2221,1&quot;
        WIDTH=<% resWidth = Request.QueryString(&quot;rW&quot;)
            if  resWidth < 200 or resWidth > 1600 then
               resWidth = 800
            end if
            Response.Write resWidth %>
        HEIGHT=<% resHeight = Request.QueryString(&quot;rH&quot;)
            if  resHeight < 200 or resHeight > 1200 then
               resHeight = 600
            end if
            Response.Write resHeight %>>
        </OBJECT>
        </tr>
        <tr>
        <br>
        <font size=&quot;1&quot; color=&quot;#000000&quot; face=&quot;Verdana, Arial, Helvetica&quot;>
        You are logged in to <i><span id=&quot;srvNameField&quot;></span></i></font><br>
        </tr>
        
<script language=&quot;VBScript&quot;>
<!--
sub MsTsc_OnDisconnected(disconnectCode)
   if not disconnectCode = 2 then
      msgbox ErrMsgText & MsTsc.Server
   end if
      'redirect back to login page
      Window.Navigate(&quot;default.htm&quot;)
end sub
-->
        </script>
</table>
</center>
</body>
</html>
 
Thanks, tried that, but the problem is the end users could be running different resolutions.

Regards
Webflex
 
OK fixed it by using a screen size sniff and redirect page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top