Modeless dialog boxes
Version A
Dialog boxes with semitransparent 'glasses'
- Demonstration
- The main window:
- menu:
- Exit
- Dialogs:
- Red, Green, Blue
- accelerators: Alt+R, Alt+G, Alt+B (show them in menu items)
- the menu item is checked when the dialog is visible
- clicking on unchecked menu item should check it and show appropriate dialog box
- clicking on checked menu item should uncheck it and hide appropriate dialog box
- closing the dialog box using 'Close' button should uncheck appropriate menu item
- Dialog boxes:
- modeless
- title - the name of the color
- rectangle with dialog's color
- using WM_DRAWITEM for drawing is obligatory
- semitransparent 'glass' with dialog's color
- button 'Close'
- Hints:
- example of accelerator in menu item: "&Blue\tAlt+B"
- GetMenu(), GetSubMenu(), CheckMenuItem()
- CreateDialog(), CreateDialogParam()
- CreateRectRgn(), CombineRgn(), SetWindowRgn()
- transparent windows:
- #define _WIN32_WINNT 0x0500
before
#include <windows.h>
- WS_EX_LAYERED
- SetLayeredWindowAttributes
- Approximate points:
- menu (also checking and unchecking) and accelerators: 2.0
- dialog boxes (one per menu item): 1.5
- titles of dialog boxes: 0.5
- rectangle with dialog's color: 1.5
- semitransparent 'glass': 4.0
- button 'Close': 0.5