CRgn is an MFC Class, which is useful to define regions. Using this one can define the outline of a telephone, DVD, Disc, etc. Once a region is ready, we can assign that to any MFC Window. This way one can display a telephone outline dial-in number pad as a window. In this example, we will create an elliptical MFC Login Dialog using CRgn and Region Path.
In this article, we will see how to set the background image for the dialog-based MFC application. One can use the same technique for any dialog by handling the WM_PAINT message. The example which we will create is shown below
In this example, we will create a MFC dialog with two text boxes & a button. Then using CToolTipCtrl we will display the Tool-Tips for all three controls. To achieve this here, we derive our own class from the MFC Framework's CToolTipCtrl.
When an owner window of the menu item decides how the menu item should look, then the menu item is known as Owner Drawn Menu. The default windows provided menu has a standard look and feel. We cannot add Red and blue-colored boxes as a menu item through the resource editor. In this Example, we will see how can we display only color boxes as a menu item under the color menu. Here, we will learn the need for the WM_DRAWITEM and WM_MEASUREITEM windows messages.
We know that keyboard and mouse are basic hardware interface supported by almost all the Computer Operating System. When the user hits the keyboard key, the device driver for the keyboard deals with it by making use of the interrupts. In this example we will learn how to handle Keyboard Messages using MFC SDI Application. First, We will provide a handler function for the Keyboard. Then, inside the handler, we will check for Shift Key State and Toggle Key State.
The System Menu appears when you click the top left corner of the window. In this short article, we will add our own command to the System Menu of the dialog box. Then we will also handle click event of it. You can do the same for SDI and MDI Applications.
In this Example, we will look at wiping out the minimize and resize button from the MFC Single Document Interface (SDI) Application using PreCreateWindow Override and CREATESTRUCT. Of course, we can do that with the MFC Wizard itself. However, that option is restricted to design time. Moreover, knowing how to carry out this in run-time is useful as the Application can behave based on the INI file or configuration file settings.
Software application user interacts with the windows applications through the main external devices like Keyboard and Mouse. In MFC, hardware events from these devices are seen as ‘Windows Messages’. An MFC application programs responding to these windows messages are called ‘Message Handling’. In this example, we will create an MFC SDI Application and then Handle Left and Right mouse click events. This will make you understand how windows messages are handled in the MFC Applications.