Microsoft KB Archive/104792

{|
 * width="100%"|

Ropopup.exe Demos Read-Only Pop-Up Window w/ Shadow

 * }

Q104792

-

The information in this article applies to:


 * Microsoft Windows Software Development Kit (SDK) 3.1

-

SUMMARY
Ropopup.exe is a file in the Microsoft Software Library that demonstrates how to implement such a read-only pop-up window to display text. The sample also demonstrates how to add a shadow to this read-only pop-up window.

The Microsoft Windows SDK "The Windows Interface: An Application Design Guide" version 3.1 manual describes a read-only pop-up text field as a text field that, when clicked with the mouse, displays a read-only pop-up window containing additional information.

MORE INFORMATION
The following files are available for download from the Microsoft Download Center:

Ropopup.exe

For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

In the ROPOPUP sample, a button is used to invoke the read-only pop-up window. The read-only pop-up window is merely a pop-up window that has no nonclient areas (caption, system menu, menu, minimize/maximize buttons, sizing border, and so forth). Text is displayed on the main part of the pop-up window's client area. A shadow is displayed on the bottom and right sides of the client area.

Achieving the shadow effect requires several steps:


 * 1) Set the read-only pop-up window class's brush to a NULL_BRUSH. NOTE: The NULL_BRUSH is retrieved via GetStockObject(NULL_BRUSH). The effect is that the pop-up window will be entirely invisible. This step is needed in order to allow the shadow to be partially transparent.
 * 2) In the WM_CREATE message case for the pop-up window, create the shadow brush pattern. The shadow's pattern is defined by a monochrome bitmap with alternating black and white pixels.
 * 3) In the WM_PAINT message case for the pop-up window, three things need to be done:


 * 1) * a. Fill the nonshadow area of the pop-up Window using the Rectangle function.


 * 1) * b. Output the read-only text on the nonshadow area.


 * 1) * c. Paint the shadow using PatBlt with ROP code 0xA000C9 to combine the shadow pattern and the background. For each black pixel in the pattern, this ROP code puts a black pixel on the screen. For each white pixel in the pattern, the existing screen pixel is left untouched. The end result is a shadow-like effect that allows the background to partially show through the shadow.

The read-only pop-up window is terminated by any mouse button or keyboard input. Because all the output for the pop-up window is done in its client area, no special screen cleanup is needed. Windows automatically refreshes what lies beneath the pop-up window.

Additional query words: shadow effect

Keywords : kbfile kbsample kb16bitonly kbGDI kbSDKWin16

Issue type : kbinfo

Technology : kbAudDeveloper kbWin3xSearch kbSDKSearch kbWinSDKSearch kbWinSDK310