Krzysztof Mossakowski
Windows Programming
2009 - Tasks
Dialog boxes & Controls
Transparent dialogs
Demonstration
Functionality:
main window
file menu
New dialog (accelerator Ctrl+N) - open a new modeless dialog box
separator (has to be included in the menu)
menu items for dynamically created dialog boxes
- selected item activates the corresponding dialog box
separator (has to be included in the menu)
Exit - close application
accelerators have to be visible in the menu items
many dialog boxes can be opened at the same time, the number of the dialogs is not known a priori
dynamically created menu item is checked when the corresponding dialog box is set as a top most one
modeless dialog box ('Tool Window' style has to be set)
new menu item is added to the file menu when a dialog box is created
by default, the new dialog box is opaque (transparency 0%) and non top most
the dialog box's text and menu item's text are the same, created with pattern 'Dialog X', where X is a number of successive opened dialog
check box 'Top-most' - disable/enable the top-most style for the dialog box
horizontal scroll bar - changes transparency level of the dialog box
transparency range - 0% - 50%
the current level has to be shown in a static control next to the scroll bar
SB_THUMBPOSITION and SB_THUMBTRACK messages have to be maintained as well
'Close' button - destroys the dialog box, removes menu item (same as 'X' button)
Hints:
SetActiveWindow(), SetWindowPos()
CreateDialog(), GetDlgItem(), SetDlgItemText(), IsDlgButtonChecked()
SetScrollRange(), SetScrollPos()
GetMenu(), GetSubMenu(), DeleteMenu(), InsertMenuItem(), MENUITEMINFO, CheckMenuItem()
Approximate points:
creating a dialog (both with menu item and accelerator), appropriate styles for dialog box's window, destroying a dialog: 2.0
enable/disable top-most style for dialog: 1.0
transparency level altering: 3.5
dynamic menu items
add when dialog is created: 1.0
remove when dialog is destroyed: 0.5
dialog activate: 1.0
checked when top most: 1.0
Links for uploading:
Solutions
Corrections