Microsoft Knowledge Base

How to Determine if Windows for Workgroups Is Running

Last reviewed: October 19, 1994
Article ID: Q112015
The information in this article applies to:

- Microsoft Test for Windows, version 2.0

SUMMARY

This article shows by example how to determine, from Microsoft Test, whether your program is running under Microsoft Windows or under Microsoft Windows for Workgroups.

MORE INFORMATION

The following program uses the function wnetgetcaps to determine which operating system is running -- Windows or Windows for Workgroups. The wnetgetcaps function is defined in the Windows for Workgroups SDK.

' $include 'declares.inc'
declare function wnetgetcaps lib "user" (x as integer) as integer
' Clear the viewport:
viewport clear
' Initialize constants:
WNNC_NET_TYPE = 2 WNNC_NET_MultiNet = &h8000 WNNC_SUBNET_WinWorkgroups = &h4 x& = wnetgetcaps(WNNC_NET_TYPE)

' Check high byte of return value
' to see if multiple network bit is set:
if x& and WNNC_NET_MultiNet then
   ' Check low byte of return value to see if workgroups bit is set:
   if  x& and WNNC_SUBNET_WinWorkgroups then
      Print "Workgroups is running"
   else
      Print "Workgroups not running"
   end if
end if

When you run this program, you'll either see the message "Workgroups is running" or the message "Workgroups not running" in the Viewport window.


Additional reference words: 2.00
KBCategory: kbtool kbprg
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 19, 1994
©1997 Microsoft Corporation. All rights reserved. Legal Notices.