This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.


MIND



Cutting Edge
cutting@microsoft.com        Download the code (7KB)
Dino Esposito

What’s New in Windows 98

W
indows® 98 (codenamed Memphis) has been in the works since before Windows 95 was shipped. If all goes well, it should be hitting the stores about the same time you're reading this. Let's see what's new.
      At first sight, Windows 98 looks much the same as Windows 95 plus Microsoft® Internet Explorer 4.0 with the Active Desktop™. An updated version of the Plus! Pack's System Agent, called Task Scheduler, is a standard component of Windows 98. But Task Scheduler originally shipped with the Internet Explorer Plus CD and is available for download. Another addition, Personal Web Server (PWS), shipped with Microsoft FrontPage® and has also been available for download. So what's really new?
      Actually, there is little in Windows 98 that is entirely new. Most of its features have been previously released as updates or components of other products. But Windows 98 brings all these new features together in one place. It unifies and standardizes the plethora of SDKs, libraries, and updates you've had to deal with.
      This may not sound very exciting, but it means you can stop worrying about what version of a given component your customers may have—whether your users have installed Internet Explorer 4.0 or the latest comctl32.dll. Windows 98 gives you one platform with an up-to-date and stable collection of modules.
      Let's take a quick tour of the major new features of Windows 98, with a special focus on those aspects related to programming and the Internet. The new features can be divided into three categories: Internet integration, graphics features, and system enhancements. There are new programming features in all three categories, though most were introduced with the latest version of the Internet Client SDK. The SDK is available for download at http://msdn.microsoft.com/psdk/inetsdk/asetup/default.htm.

New Features in Windows 98
      Not all the features of Windows 98 have been previously released. There are some minor user interface enhancements such as animated menus and windows. There are also a number of system improvements, such as memory management optimization, that result in faster startup for executables. The problems experienced under Windows 95 with system file and registry maintenance and version conflicts prompted the introduction of an updated Microsoft System Information utility (see Figure 1). The Accessories folder in the Start | Programs menu is filled with a bunch of new tools, too. Figure 2 summarizes the new features in Windows 98. Let's examine them in a bit more detail.

Figure 1: System Information Utility
Figure 1: System Information Utility


      Microsoft Office 97, Visual Studio™ 97, and Internet Explorer 4.0 each present an attractive menu whose main
Figure 3: 3D Borders
Figure 3: 3D Borders
items appear raised when the mouse passes over them. The effect is accomplished via special toolbars, not the standard menus you create through the Resource Editor or CreateMenu API function.
      In Windows 98, these effects have been added to the standard menu capability. There is hot-tracking support, and menu items are highlighted by drawing a thin 3D border around the item text, just as in Office 97 applications (see Figure 3). Interestingly, this behavior is inherited automatically by all applications (including old 16-bit programs) that run under Windows 98, provided that they make use of standard Windows menus.
      Other changes relate to how programs appear graphically while running. For example, when a window loses focus, the menu is grayed out as well as the title bar (see Figure 4). Also, the little system buttons on the title bar (Minimize, Maximize, Help, and Close) now have tooltips. This is an automatic system feature that applies to any running application.

Figure 4: Disabled Captions and Menus
Figure 4: Disabled Captions and Menus


      The Accessories folder is full of new or improved tools. Of these, Paint and Imaging are worthy of special mention. Paint now supports JPEG and GIF formats, and Imaging offers additional tools for manipulating and storing images (see Figure 5).
      One of the most revolutionary improvements in Windows 98 is FAT32, a 32-bit version of the system file allocation table. With its ability to store data more efficiently, you can potentially save several hundred megabytes of disk space. Also, programs will run faster because they require less memory and fewer resources to load. A specialized tool can convert your system from FAT16, the previous standard. Figure 5: The New Imaging App
Figure 5: The New Imaging App

      There is a drawback to converting to FAT32: you will not be able to run any operating system older than Windows 98 or Windows NT® 5.0 (the exception being some OEM installations of Windows 95 OSR2). If you have set up your machine for multibooting between Windows 98 and Windows NT 4.0, you should not convert to FAT32. For more details, see the online help file.
      Disk maintenance is now easier thanks to three utilities: Disk Cleanup, Registry Checker, and a new version of Dr. Watson. All can be run from the System Information applet shown in Figure 1. Disk Cleanup attempts to identify and remove unneeded files. The Registry Checker lets you back up the registry files on demand.

Architectural Changes
      Plug and play was a key feature of Windows 95. This functionality has been improved in Windows 98 with enhanced support for infrared devices and new hardware standards such as Universal Serial Bus (USB), IEEE 1394, and Digital Video Disc (DVD).
      There is also built-in support for Advanced Configuration and Power Interface (ACPI), which as an open industry standard hopefully will make PCs as easy to use as televisions. And speaking of television, the new Microsoft Broadcast Architecture in Windows 98 will let you receive selected multimedia Internet content via a television cable, provided that you have a television tuner board.
      Multimonitor support, MMX technology, and enhanced display change capability complete the list of system-related features. The new display features, first introduced with Windows 95b (OSR2), let you change your color depth or screen size on the fly. Since some programs do not display correctly when you make changes on the fly, Windows 98 gives you the option to reboot.
      One of the coolest innovations in Windows 98 is the Win32® Driver Model (WDM). This is a platform-independent format for device drivers that lets hardware manufacturers write a single driver for Windows 98, Windows NT 5.0, and all future Windows operating systems. For details on WDM, check Walter Oney's articles, "Surveying the new Win32 Driver Model for Windows NT 5.0 and Windows 98," in the November and December 1997 issues of MIND's sister magazine, Microsoft Systems Journal (MSJ).

True Web Integration
      The expression "True Web Integration" means using the same method for browsing the local hard disk and the Web. In the past, you navigated local directories using Windows Explorer and the Web using Internet Explorer, Netscape Navigator, or some other browser. You had to switch programs to visit folders on your local network versus the Internet. The new Active Desktop blurs the distinction between local and remote folders, making both accessible via the same tool and following the same metaphor.
      I already covered Active Desktop and True Web Integration in a previous Cutting Edge column (MIND, March 1998), so I won't delve into details such as folder customization, channels, or desktop items. Instead, I'll focus on the integrated Internet shell found in Windows 98.
Figure 6: Explorer Web Page View
Figure 6: Explorer Web Page View

       Figure 6 shows the Web Page view in the new Windows Explorer. There are some slight changes from the Internet Explorer 4.0 user interface. The standard Web view makes better use of space, but functionally it is much the same. If you type the name of an ActiveX® document on the address bar, it will open in Explorer's right panel. Explorer itself is capable of displaying GIF, JPEG, text, and HTML files as preview thumbnails (see Figure 7). If you've installed Office 97, you can view Microsoft Excel, Word, or PowerPoint® documents in Explorer as well.
      The Internet appears as a folder on your desktop, and the system switches seamlessly back and forth between Internet Explorer and File Explorer as you access local and remote files. If the HTML page is a frameset, then the individual HTML pages are listed in the left-hand tree view under the Internet Explorer node.
      Another feature of the integrated shell is Back and Forward buttons that work for local files as well as Web pages. There is also an autocompletion feature for the address field, a better Favorites utility, and improved printing capabilities.
Figure 7: Explorer File Preview
Figure 7: Explorer File Preview

      The inclusion of the Internet Explorer 4.0 WebBrowser control brings the power of scriptlets, Dynamic HTML, ActiveX, and Java applets to Windows shell folders. As discussed in a previous installment of Cutting Edge (see MIND, March 1998), you can customize a given folder and make a real application of it through scripting. The Windows Scripting Host, featured in the June 1998 Cutting Edge, turns any ActiveX scripting-compliant language (like VBScript or JScript™) into an MS-DOS®-like batch language for communicating with the system's shell.

Offline Browsing
      True Web Integration can introduce a new problem for system modules and user applications: detecting an Internet connection, or making sure that a given resource is available offline. The WinInet library provides the functions you need to accomplish this task. Here's how to use C++ to detect whether the user is online:


 BOOL IsWorkingOffline( VOID ) { 
   DWORD dwState;
   DWORD dwSize=sizeof(DWORD); 
 
   InternetQueryOption( NULL, 
      INTERNET_OPTION_CONNECTED_STATE, 
      &dwState, &dwSize );  
   return (dwState & INTERNET_STATE_DISCONNECTED_BY_USER); 
 }
      A user should be able to browse any content, whether it is remote or local, cached or not. Windows 98 will warn you with a cursor change when you need to go online to view requested content. The CoInternetQueryInfo function in the UrlMon library lets you know in advance whether a certain page or document has been cached and is available offline:

 CoInternetQueryInfo( wszUrl, QUERY_USES_NETWORK, 0, &dwUsesNet, 
                      sizeof(dwUsesNet), &dwSize, 0 ); 
 
 CoInternetQueryInfo( wszUrl, QUERY_IS_CACHED_OR_MAPPED, 0, 
                      &dwCached, sizeof(dwCached), &dwSize, 0 ); 
First you check the network for a given URL, and then you verify whether it's been cached.

Other Internet Features
      Windows 98 comes with a suite of tools for Internet communication that were originally introduced with Internet Explorer 4.0: Outlook™ Express, FrontPage Express, NetMeeting™, and NetShow™. Now that they are a part of the Windows platform, you don't have to worry
Figure 8: Windows 
Update
Figure 8: Windows Update
about redistribution when targeting this platform.
      Windows 98 also improves upon a handful of wizards and small utilities that were part of previous releases of Internet Explorer. Among these are the Internet Connection and Web Publishing wizards, the Chat and Wallet controls, the VRML viewer, and the RealAudio player. The Windows 98 Internet kit includes an Online Services Folder with ready-to-run setup programs for registering with some of the major ISPs.
      A more interesting addition is the client module for the Virtual Private Networking (VPN) service. This lets users securely access private corporate networks through open public networks such as the Internet. VPN makes use of the Point-To-Point Tunneling protocol (PPTP). Companies like Microsoft have already converted many of their RAS servers into PPTP hosts, giving authorized users the ability to dial in from anywhere by way of a local host.
      After installing Windows 98, a new item called Windows Update is added to your Start menu (see Figure 8). This is an Internet shortcut that points to the following URL: http://windowsupdate.microsoft.com/default.htm

This Web site contains updated drivers, libraries, and files, and is available only to registered users of Windows 98. It provides easy-to-install patches, FAQs, and troubleshooting wizards that make it simple to keep your system up to date. You can't access this site if you're running Windows 95 or Windows NT 4.0, but access will be extended to registered users of Windows NT 5.0.

Personal Web Server
      PWS is a desktop Web server that serves two main purposes: it lets you test Web-based applications without leaving your desktop, and it provides a way to publish documents across a local intranet. PWS was originally released as part of Microsoft FrontPage. Windows 98 ships with a brand new version of it (see Figure 9).

Figure 9: Updated Personal Web Server
Figure 9: Updated Personal Web Server

      This new PWS is far superior to previous versions. For example, it now includes Microsoft Transaction Server 2.0, Message Queue Server, Data Access components, and most importantly, full support for ASP and RDS, features previously only available to installations of Internet Information Server under Windows NT 4.0. Its user interface has also been improved, and now boasts a home page wizard, facilities for publishing, an automatic guest book, and the console shown in Figure 9.

Programming for Windows 98
      So far I've talked in detail about the product features of Windows 98, while mentioning little about the programming features. The Windows 98 SDK inherits all the characteristics and the facilities of the Internet Client SDK, plus some new functionality from the upcoming Windows NT 5.0.
      Now I will present two new functions that have been long awaited by programmers: GradientFill and AnimateWindow. As the names suggest, these functions let you fill an area given a device context, and apply transition effects during the painting of the window. For example, you can draw a rectangular or triangular area using shaded colors. You can also create shaded window captions without dealing with linear interpolation and the like. I employed these features in a demo program, shown in Figure 10. To show how this feature degrades gracefully, the display on top supports 16 million colors, while the one on the bottom supports only 256 colors.

Figure 10: Gradient Fill Support
Figure 10: Gradient Fill Support

      The effects that Windows 98 provides by default for menus and comboboxes are available for your own windows through the AnimateWindow function. Here's an example of how to code a window that zooms up to its desired size rather than just appearing all at once.

   HINSTANCE h;
   FARPROC p;
   h = LoadLibrary( "user32.dll" );
   p = (FARPROC) GetProcAddress( h, "AnimateWindow" );
   p( hDlg, 100, AW_CENTER );
   FreeLibrary( h );
      The sample dialog-based application shown in Figure 10 calls this code while responding to the WM_INITDIALOG message (see Figure 11). Note that I used LoadLibrary and FreeLibrary to avoid using .h and .lib files that were subject to change at the time of this writing. This method can also be used to write wrapper functions that work well (or degrade gracefully) under previous versions of Windows.
      There are many other new programming features in Windows 98, mostly related to shell programming. There are also a host of new COM interfaces and system objects, and I'll be covering some of these in future Cutting Edge columns. Before completing this article, however, I'd like to discuss the new task-scheduling features in Windows 98, including new scheduling agent COM interfaces and the Task Scheduler.

Scheduling Tasks for Execution
      Windows 98 plugs two great gaps in previous versions of Windows. I addressed one of these in last month's column when I described the Windows Scripting Host, a kind of batch language for manipulating system objects. The other missing piece was a task scheduler for batch job execution.
      First released with Internet Explorer 4.0, a set of COM interfaces to drive a scheduling agent now ships with Windows 98. The interfaces are ITask, ITaskTrigger, and ISchedulingAgent. To work with the scheduling agent, you first create an agent, then create a task by specifying the app name and its command line. The third object is a trigger that defines the time and the frequency of the call. Sample code for these interfaces may be found in the Internet Client SDK and MSDN.

Figure 12: Task Scheduler
Figure 12: Task Scheduler

      If your goal, however, is simply to perform a task at a regularly scheduled time, your best choice is to launch the Windows 98 Task Scheduler. The main window is a custom folder like the one used to add a new printer or dial-up networking connection. Selecting the Add Scheduled Task item launches a wizard that lets you enter the information needed to set up a scheduled job (see Figure 12). First you pick an executable from a dropdown list, and then you indicate the frequency and the scheduled time.

Summary
      It's very likely that Windows 98 will have hit the shelves by the time you read this, so you can explore its features on your own. If you already use Internet Explorer 4.0 and the Active Desktop, then the most obvious change for you might be the different icons and system bitmaps. From a programmer's standpoint, however, the biggest news is the up-to-date, standard platform. In the three years since Windows 95 was released, there have been numerous new products, updates, and SDKs. All these have been consolidated in Windows 98.

From the July 1998 issue of Microsoft Interactive Developer.