Go Back  Xtreme Visual Basic Talk > Other Languages > Web Programming > Start Applications from link in HTML page


Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2003, 03:13 AM
mpete mpete is offline
Newcomer
 
Join Date: Dec 2003
Location: Norway
Posts: 1
Default Start Applications from link in HTML page


Hi !

I have an html page that contains a button. When the button is pressed a VBScript function is called. This function is supposed to open 2 new windows. 1 is Windows Explorer preset to a folder, and the other is an application called Domino.Doc Neighborhood. As you can see from the code, I need to user wsh.Run to open the neighborhood using the CLSID as parameter. This is the only way I know how to open this window. I use ShellExecute to open the Windows Explorer.

The problem starts when I want to resize the windows. I create an Shell.Application object and an object containing all the windows in this Shell.Application object. Then I use the Item property and Item.LocationName to find the windows i want to resize.

The problem is that it seems to me that the I need to create the Shell one more time after opening the windows to be able to find them..
Might be wrong on this..

Then, when setting Shell.Application.Windows it doesn't find the Domino.Doc Neightborhood window.

HERE'S THE CODE:
HTML Code:
<HTML>
<HEAD>
<TITLE>Start Domino.Doc</TITLE>

<SCRIPT LANGUAGE="VBScript">
<!--
  dim wsh

  function OpenNeighborhood()

  set wsh = CreateObject("WScript.Shell")
  wsh.Run("Explorer.exe /e,/root,::{0140D981-D707-11D2-9D18-00104B952FEE}")
  set wsh = nothing

  //need to put in a delay
  for i=0 to 1500000
  next

  end function

  function SetNewShell()
  //need to put in a delay
  for i=0 to 1500000
  next
  set wsh = CreateObject("WScript.Shell")
  end function

  function fnShellWindowsItemVB()
          dim objShell
          dim objShellWindows

          call OpenNeighborhood()

          set objShell = CreateObject("Shell.Application")
          objShell.ShellExecute "Explorer.exe", " /e,C:\Test\Scanned Files", "", "open", 1
          set objShell = nothing

          call SetNewShell()
          set objShell = CreateObject("Shell.Application")

		  set objShellWindows = objShell.Windows

          if (not objShellWindows is nothing) then
              dim objIE

              for i=0 to objShellWindows.Count-1
              set objIE = objShellWindows.Item(i)
              //alert(objIE.LocationName)


              if (not objIE is nothing) then
                  if objIE.LocationName="Domino.Doc Neighborhood" then
                  	//alert(objIE.LocationName)
					objIE.Width=screen.width/2
					objIE.Height=screen.height-30
					objIE.Left=0
					objIE.Top=0
                  end if

                  if objIE.LocationName="Scanned Files" then
                  	//alert(objIE.LocationName)
					objIE.Width=screen.width/2
					objIE.Height=screen.height-30
					objIE.Left=screen.width/2
					objIE.Top=0
                  end if
              end if

              next

              set objIE = nothing
          end if

          set objShellWindows = nothing
          set objShell = nothing
          set wsh = nothing
      end function

-->
</SCRIPT>
</HEAD>
<BODY>
<INPUT type="button" value="Start Domino.Doc" onclick="fnShellWindowsItemVB()">
</BODY>
</HTML>
Does anyone have any comments, tips on why this code doesn't work properly ??
PS: This is my first piece of VBScript code...

Sincerely,
Petter Kjeilen

Last edited by alp0001; 12-12-2003 at 06:59 AM. Reason: added [html] tags
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
disable print preview from xlDialogPrint w_seyller Excel 9 12-11-2003 11:20 AM
how stop displaying an html page ? ali_purashuri Web Programming 0 09-18-2003 05:31 AM
how to edit a html page itself? fandecine General 10 08-21-2003 12:47 AM
HTML / CSS within a VB script manchego Web Programming 3 06-24-2003 12:28 PM
Send Email with graphics and text Greatchap Communications 2 05-16-2003 06:44 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->