MFC Miscellaneous

The computers understand everything by numbers. Each character is represented as a number, which is finally drawn as a character in the screens.It has been a major problem for the legacy systems to write programs for languages other than English. The primary reason being the non-availability of enough characters in ASCII encoding. So obviously Internationalization [...]

This is a Win32 Application, which shows a Transparent MFC Window such that the Window looks same as the background window present on the desktop. On this Window I have done some GDI work Using the GDI class CPen. On moving the mouse on the window it displays four colored lines from the four corners [...]

   In this Program the Create Api Call to create the window takes the third parameter that is window style as WS_POPUP, which is responsible for creating the window without any title bar.    Since there is no title bar there won’t be any close button, so in order to exit the application I used [...]

   WinExec is a WINDOWS API function that can be used in case we want to execute legacy applications. This function is used with processes( Resources needed to execute a program ). The function expects the application name enclosed in quotation marks as shown.     WinExec(“”C:\Program Files\MyApp.exe” -L -S”,SW_SHOWNORMAL)    If a malicious user were [...]

This article takes a look at developing an IRC client program using Microsoft Visual C++, MFC and WinSock. For the development this uses the IRC reference published in  ftp://ftp.irc.org/irc/docs/rfc1459.txt and ftp://ftp.irc.org/irc/docs/rfc2812.txt. Development of an IRC client in Visual C++: There must be some basic steps for the development: Create a class to establish a connection [...]

   This article gives a brief idea about the popular Internet Relay Chat. We’ll be looking at how to write an IRC client with our Visual C++ in another article.    The Internet Relay Chat (IRC) is one of the most popular internet communication services. The idea for it came in 1990 and has been [...]

When writing code for owner-draw combo boxes try to keep these guidelines: Use SetItemData because it easy to get it with the DRAWITEMSTRUCT without making any obsolete and time consuming function calls. Check the state and action of the item to know when to draw selection rectangles. Check for the state ODS_SELECTED, and ODA_SELECT to [...]

Some of the applications need to be restricted to run as a single instance. This can be achieved very easily in MFC windows applications. When the application is started, it has to check if there is another instance running. If there is one already running, it can display a message and quit from the environment. [...]

When Dialog boxes in MFC are created using the resource editor, they will have two default Command Buttons. One with caption as OK and other one with CANCEL. When a class is created, both these buttons will be created with default handlers. When any one of them is clicked, they will close the dialog. Just [...]

The CFrameWnd class calls a lot of functions before instantiating a window. One of those functions PreCreateWindow, determines the styles of the Window. The styles are constant values viz., WS_MAXIMIZE, WS_MINIMIZE etc., All of them are added with an OR operator and passed as a parameter to the PreCreateWindow. The PreCreateWindow takes in a parameter [...]

1 2