Ropopup.exe Demos Read-Only Pop-Up Window w/ Shadow
ID: 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 INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files:
Ropopup.exe
For more information about how to download files from the Microsoft
Download Center, please visit the Download Center at the following Web
address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.
For more information about how to download files from the Microsoft
Download Center, please visit the Download Center at the following Web
address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.
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:
- 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.
- 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.
- In the WM_PAINT message case for the pop-up window, three things
need to be done:
- a. Fill the nonshadow area of the pop-up Window using the Rectangle
function.
- b. Output the read-only text on the nonshadow area.
- 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
Version : WINDOWS:3.1
Platform : WINDOWS
Issue type : kbinfo
|