WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Control Manager
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Selecting Services Tab in Network Dialog

Keywords:   Error: 204: ctl: Specified parent window doesn't exist

Select Network Service Tab and Check if SMNP Service is on List:

Question:

I need to launch Control Panel in NT4.0 workstation, select Network, select Services tab, determine if "SNMP Service" is in the list, if so select "SNMP Service" and click on "Properties", else click on add and then from the "Select Network Service" listbox select "SNMP Service". Your example for this type of function in the ctlmgr extension works on Win95, but I can't get it to work on NT4.0 workstation. Any ideas? The partial attempts below works in Win95, but fails in NT4.0, with the following error:
	WIL Extender Error: 204: ctl: Specified parent window doesn't exist
        lbWnd=cWndbyID(cfghwnd,2012)

I already ran the window analysis script to get the Class=SysListView32 identifier 2012 (which should be the NT listbox).

The screen is there already... as I am running in debug mode - thus this is not an issue. I have modified the Win95 code to try to get it to run on NT4... but the online help for CTLMGR does not give good enough help for describing Sequence/Control ID's etc... Suggestions?


	AddExtender("wwctl34I.dll")
	Run("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl")
	netwnd=DllHwnd("Network")
	srvhwnd=cWndByName(netwnd,"Services")
	lbWnd=cWndbyID(srvhwnd,2012)
	response=cGetLBText(lbwnd)
	response=strreplace(response,@tab,@crlf)
	Message("Response",response)
	exit

Answer:

I suspect you might need different scripts for NT and Win95. You also might need a TimeDelay to let the window get established.

The problem is that NT puts up a slightly different dialog and "SERVICES" is not open by default and control 2012 is simply not there.

Here's a revised script. It requires that you select the services tab *before* trying anything with it. (Win95 opens on services...)

        AddExtender("wwctl34I.dll")
        Run("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl")
        netwnd=DllHwnd("Network")
        systabwnd=cWndByClass(netwnd,"SysTabControl32")
        cSetTabItem(systabwnd,2)
        srvhwnd=cWndByName(netwnd,"Services")
        lbWnd=cWndbyID(srvhwnd,2012)
        response=cGetLBText(lbwnd)
        response=strreplace(response,@tab,@crlf)
        Message("Response",response)
        exit
The problem revolves around the fact that the various controls in tabbed dialogs often simply do not exist until the tab is selected, then Windows brings the controls into existence. So now that the script opens the desired tab, it works.

Question (continued):

Thanks... I had just gotten that far myself by selecting the tab too... but I keep getting *EMPTY* for the contents of the ListBox.

I had gotten this far:

        Debug(@ON)
        AddExtender("wwctl34I.dll")
        Run("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl")
        netwnd=DllHwnd("Network")
        systabwnd=cWndByClass(netwnd,"SysTabControl32")
        cSetTabItem(systabwnd,2)
        srvhwnd=cWndByName(netwnd,"Services")
        lbWnd=cWndbyClass(srvhwnd,"SysListView32")
        response=cGetLBText(lbWnd)
        response=strreplace(response,@tab,@crlf)
        Message("Response",response)
        exit
The above code and your example get the same results = *EMPTY* for the contents of the List Box.

Any ideas? Thanks for your help...

Answer:

Use the cSetLVItem for a SysListView32 type of control. The cGetLBText function cannot access it.

Thread (continued) Question, RE: (NT) Select Network-Service Tab, change service:

RE: the difficulty (impossibility?) of trying to read the contents of a SysListView32 (cannot use GetLBText to access it).

What are the alternatives?

On an NT machine I need to a]Launch Control Panel-Network-Services, b]See if a specific Service is installed and if it is c] remove it.

Ideas? Thanks.

Answer:

It's rough. I would consider editing the registry directly.

Changing the registy and rebooting often works for alots of cases. You have to be careful though - editing the registry is not as easy as it might seem. The network stuff shifts around a little. Watch out for keys like 0000 0001 0002 0003 They shift a lot.

The Win95 and Win NT network control panels use different types of controls. NT uses the harder ones.

The 95/NT dicotomy is not completely relevent here. It just so happens that NT network setup was implemented differently from Windows 95 network setup and uses controls not currently supported by the Control Manager extender.

These same controls exist in Windows 95 and we cannot control them there either. The problem is that Control Manager extender does not support the SysListView and SysTreeView types of controls.


Add Intranetware Client to Network Component Type Window:

Question:

I want to add the Intranetware Client in Windows 95 with winbatch. I have been able to open the configuration tab in Network Properties and I have also been able to select the add button. But when I try to identify the Select Network Component Type window I am not successful. I ran the analysis script to see what is the identification of and window title, but I guess I am interpreting the information wrong. When I am in this window I don't know how I can select the Client item to add the the client. The last thing I did was:
	netwnd=DllHwnd("Select Network Component Type")
I did not get a value for this.

I am trying to automate as much as I can the 95 installation process. I am working on a 95 image and all of the software is installed in the 95 workstatiion and my program will add the shortcuts to the desktop. I only have two programs that I will need to add network components to and I want to add the shortcut as well as the network component.

Help!

Answer:

  1. WinBatch cannot read the "select Component window".... The Control Manager extender cannot "see" the network.

  2. But you can use SendKey to tab to the box and then SendKey the first letter of the line you want (assuming the first letters are unique) and you can select it with SendKey.

  3. Most shortcuts are added with ShortCutMake.

  4. You can integrate the Intranetware client right into the Windows95 install if you want. Read the documentation that comes with the client. It walks you through it step by step. We just did 8000 workstations that way and it saved a lot of time.

  5. Another option might be to include the Novell setup executable as a "Run Once" from the registry. You can add this to the MSBATCH.INF file (this file defines the Windows95 install process, check out the Windows96 Resource Kit) so that it will fire off right at the end of the Windows95 install. There are some switches for the Novell setup executable that will make it not prompt for information. This is explained in the Client documentation.

Article ID:   W12517
Filename:   Selecting Control Panel Network Services Tab.txt
File Created: 2001:03:02:14:38:28
Last Updated: 2001:03:02:14:38:28