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
SUMMARYThis 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 INFORMATIONThe 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
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |