Skip to content

CategoryC++

Articles on C++ programming language.

MFC Keyboard Messages

Handling MFC Keyboard Messages With Shift & Toggle Key State

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.

Fixed Size MFC SDI Application

Fixed MFC SDI Window Using CREATESTRUCT & PreCreateWindow

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.

Defining the Redraw clipping region

Message Handling in MFC Application Explained

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.

Remove_If function with predicates explained

Remove_if Predicate and Remove Examples

Remove function and remove_if functions deletes an item from the standard C++ List. This article shows how Remove and Remove_if can be used on the C++ List. It also shows how you can write remove_if predicate which can be used by C++ built-in Remove_if. Learn more here with an example.