SAMPLE: Appbar.exe – Creating an Application Desktop Toolbar

ID: Q134206

The information in this article applies to:

SUMMARY

The Windows Explorer shell on Windows 95, Windows 98, and Windows NT 4.0 allows an application to register an application desktop toolbar that behaves with the same look and feel as the Windows Explorer taskbar. The application desktop toolbar is always attached to one of the outside edges of the screen and can cause the size of the desktop to be reduced so that other applications do not overlap the application desktop toolbar.

The APPBAR sample code demonstrates how to implement an application desktop toolbar that is resizable, can attach to any side of the screen, and allows itself to be hidden in the same way the Windows Explorer taskbar automatically hides.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ Appbar.exe (size: 47261 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

The application desktop toolbar interface for provides an easy way for an application to attach windows to the edge of the screen so that they don't overlap the desktop or other applications. The ability to do this is especially useful in an application-launching program such as the Microsoft Office Manager (MOM) utility or in an application that needs to provide status information to the user as it runs in the background.

The application creates its window normally and then registers itself with the system as an application desktop toolbar (appbar). Once registered as an appbar, any time the window moves it must negotiate with the system for screen space by sending the requested rectangle to the system as part of an ABM_QUERYSETPOS message. The system then checks to see if any other appbars are using that space and adjusts the rectangle requested so as not to overlap. When the appbar is moved, the system resizes the desktop and moves any currently running applications so they do not overlap the appbar.

REFERENCES

For more information on the application desktop toolbar interface, please see the Chapter "Extending the Windows 95 Shell : Application Desktop Toolbars" in the "Programmer's Guide to Windows 95." The guide is available in the Win32 SDK Help file under "Guides."

Additional query words: Keywords : kbcode kbfile kbsample kbAppToolBar kbNTOS400 kbWinOS95 kbWinOS98 kbshell

Last Reviewed: January 1, 1999