Blue Pill - TUM-FAF/WP GitHub Wiki
Technical University of Moldova Windows Programming Guidebook (in romanian)
These laboratory works are based on Charles Petzold Programming Windows book (5th edition).
Laboratory work #1
Window Handling
Purpose
Knowledge about basics of event-driven programming, understanding of window’s class and basic possibilities of Win32 API. Also she will try to understand and process OS messages.
Mandatory Objectives
- Create a Windows application. It should have in middle following text: "Done with Pride and Prejudice by student name". Replace student name with your name.
- On windows resize, text should reflow and be in window's middle (vertically and horizontally)
Objectives With Points
- Limit minimal window width and height in order to keep text visible always (1pt)
- Change behavior of different window actions (at least 3). For ex.: on clicking close button, move window to a random location on display working space. (1pt)
Laboratory work #2
GDI primitives
Purpose
Student will become familiar with available GDI primitives and will be able to create a 2D animation.
Mandatory Objectives
- Create a Windows Application that will have in its client region an animation
- Implement animation using all GDI primitives
- Lines
- Planes (rectangle, circle ...)
- Text
- Bitmap (not mandatory)
Objectives With Points
- Display custom (draw anything in mspaint) bitmap (1 pt)
- Ensure that your application has no flickering and explain how you achieved it (1 pt)
Laboratory work #3
Bezier curve
Purpose
Student will know on of the most powerfull graphic primitives - Bezier curve. She will be able to define Bezier curves unsing polinomial method or using built-in Win32 API functions: PolyBezier and PolyBezierTo.
Mandatory Objectives
- Draw a Bezier curve using standard GDI functions (which have word bezier in their names)
- Draw a Bezier curve by computing its position using formulas
Objectives With Points
- Use multiple colours when drawing Bezier curve computed by formula (2 pt)
- Join multiple Bezier curves in order to form a closed figure (2 pt)
Laboratory work #4
Basics of working with keyboard
Purpose
Student will be able to capture keyboard messages and to detect special keys events.
Mandatory Objectives
- Draw an object that can be moved using keyboard arrows. Also provide a way to rotate this object.
Objectives With Points
- Reset object position by hiting space button on keyboard (1 pt)
- Add ability to zoom object (2 pt)
- Provide different keys bindings for different rotation speeds (1 pt)
Laboratory work #5
Basics of working with mouse
Purpose
Student will be able to capture and process mouse events such as move and click and to detect cursor relative to window position.
Mandatory Objectives
- Modify application from lab#3 such that it will be possible to move curve control points with mouse. Changes should be in real-time.
- Modify application from lab#4 such that it will be possible to move image with mouse
Objectives With Points
- Join both applications in one (2 pt)
- Zoom any object using mouse wheel (1 pt)
- Change color of Bezier curve when it is modified (1 pt)
- Add pulsation effect to image (1 pt)
Laboratory work #6
Basic principles of using chronometer. Chronometer usages.
Purpose
Ability to define Windows Timer and use it to draw an animated digital and analog clock. Ability to tweak animations using Timer.
Mandatory Objectives
- Create a digital clock (HH:MM:SS) which will update each second using Windows Timer
- Create an analog clock with dial and arrows for hours, minutes and seconds. Draw it using GDI primitives. Update it each second using Windows Timer
- Implement both clocks in one window.
Objectives With Points
- Add a switch to change between day and night mode (black on white and white on black) for one or both clocks (2 pt)
- Add ability to set an alarm (2 pt)
- Add a count down clock: you set a time interval, start the clock, it shows how much time left until set time and at given time it stops and ring an alarm or show a message (4 pt)
Laboratory work #7
Child windowses
Purpose
Ability to create applications with multiple windowses, and to manage them (gain control over different windows).
Mandatory Objectives
- Your application should be able to display 3 different figures (ex. triangle, square, circle...)
- Your application should have a group of 3 radio buttons. Only one radio button can be active. Each radio button is responsible for showing one figure (ex. first radio button will show triangle when active, second will show square when active...)
- Your application should have a group of 3 check boxes. Each check box has a color (eg. red, green, blue...). When no check boxes are checked than your figure have white or transparent background. When one check box is checked than your figure has its color.
- Your application should have 2 buttons. One of them will make your figure move on a circular trajectory, the other one will stop this movement.
Objectives With Points
- All the check boxes can be checked at the same time. When 2 or 3 check boxes are checked then compute an average color and set it as figure's background. (1 pt)
- Add one more button that will add a new figure's movement trajectory (2 pt)
- Change figure's movement speed using mouse wheel (2 pt)