Modeless dialog boxes
Version B
Dialog boxes with desktop's parts.
- Demonstration
- The main window:
- menu:
- Exit
- Dialog Box - creates and shows new modeless dialog box
- Dialog box:
- modeless
- resizable
- change position and/or size of controls according to dialog's size
- do not let any control to paint on another one
- use black color for parts of the preview not copied from the desktop (as in the demonstration)
- preview of desktop window's part
- initially black (information text is not obligatory)
- dragging using left mouse button
- show selection frame (should always be of current preview's size)
- move the selection frame according to mouse movement (make sure to clean up)
- show desktop part's under the selection frame in the preview (use black color for parts outside the screen)
- buttons:
- Refresh - refreshes the preview (copies desktop part's from the last selected rectangle)
- Close - closes the dialog box
- Important:
- do not limit the number of visible dialog boxes
- make sure that previews on dialog boxes are independent
- you can assume using only one monitor
- use WM_DRAWITEM message for drawing of preview (it is obligatory)
- make sure to free all allocated memory and all created GDI objects
- Hints:
- CreateDialog()
- GetDC( NULL )
- SetROP2()
- WS_CLIPSIBLINGS, GetWindowLong(), SetWindowLong()
- WM_DRAWITEM
- SetCapture(), ReleaseCapture()
- RedrawWindow()
- Approximate points:
- menu: 0.5
- modeless dialog boxes: 1.0
- resizing the dialog box: 1.5
- showing desktop's part in the preview: 3.0
- drawing selection frame during mouse draging: 2.0
- 'Refresh' button: 1.5
- 'Close' button: 0.5