Win32 Programming Tutorials

Purely Win32 Windows API tutorials, Articles and Examples using C Programming.
  Title / Author Replies
I needed to check the OS and on different OS the different path needed to be followed and so the host operating system version was needed for an application I was developing. Background First I would like to make a table where we know what are the platformId, MajorVersion, MinorVersion of...
Introduction Windows communicate with the application by sending messages. There are many Windows messages and each message is represented by a unique integer value.In WINDOWS.H there are standard names for these messages. There are some common Windows messages like:-...
Introduction Socket is an interface between an application process and transport layer. The application process can send or receive messages to/from another application process (local or Network) through a socket. Winsock is the lowest level Windows API for TCP/IP programming. Part of the code...
This article is about how static or implicit linking can be done and how the client program gets the information from Dynamic link library (DLL). The two ways we can link a DLL to the client program. One is “Static linking” another is “Dynamic linking”. Here our topic is static linking so we...
Introduction This article will explain how we can explicitly link a DLL and why this approach is better than the implicit linking mechanism of a DLL. Explicit linking is more appropriate for interpreted languages such as Visual Basic, but we can use it from C++. In this linking mechanism we...
Introduction Here I shall describe the methods of how data is exchanged between windows of different processes. Communication between windows means one window process send/post a message/data to the other window process. The Windows operating system provides the mechanism for communications and...
Subclassing is a very powerful tool in creating your own custom controls and modifying the standard windows interface. This is typically done by replacing the Window Procedure for a window with application-defined window procedure. Subclassing is a technique that allows an application to intercept...
Introduction There a quite a few ways to start a process C run-time libraries system() _exec() _spawn() Win32 API
Hello Guys, Back again with new Article. this time I am going to explain Enumeration of Windows service, it’s Starting & Stopping , Changing Startup Type between Automatic, Manual And Disable, And Most Important One Deleting the Service(Please handle this Option With Care, if this action is...
Consider a simple EXE COM server, FooServer. Let's assume FooServer exposes an object Foo that has a method Bar: IFoo = interface procedure Bar; end; Let's also assume that FooServer has no clue what multithreading is and is therefore single-threaded just like any normal application....
Introduction Here's a little program I wrote that shows the color under the cursor as well as the cursor's position. It's useful for grabbing colors from websites or pictures. The Code It's in Win32 C. I compile it with gcc under Dev-C++. In order to get it to compile on MSVC++ (which I've...
Socket ( Definition ): Socket is End to End Point Communication. Establishing a Connection Between two Applications or processes or threads. Creating interface between two programs ( Server and Client Programs ). Socket is very useful for communication between systems, that's called inter...
Introduction This code is a simple example to show the creation of various tab controls. The code //HEADER FILES # include <windows.h>
There are many occasions where we need to show to the user the list of available printers on the system to choose from and this can be done very easily in MFC with the help of following code snippet DWORD dwNeeded = 0, dwItems = 0; LPBYTE lpPrinterInfo = NULL; CStringArray szaPrinterArray;...
When a new process is created, the "subsystem" field in the executable file header determines whether it was linked as a console (also called CUI or "character-based") or graphical user interface (GUI) application. A console application has a character-mode console window, which it inherits from...
Before reading this article you may know what is Microsoft foundation classes and Visual C++.I am listing here few of its features. When MFC was introduced, Microsoft extended the C++ syntax with a series of macros for management of Windows messages, exceptions, run time type identification, and...
There are 2 ways to make your Application Single Instance. 1. Close the previously running executable 2. Close the new instance with passing necessary info from the older version. First option is not preferred because you may have lots of information already accumulated in the running...
Recently, I developed a Win32 Application for one of my client to capture email addresses from a file. Though very simple and straight, it was an interesting project. So, I thought, I must share it with you. Program Description This program extracts email addresses from an input file. It...
Its always a good practice to have the resource into a seperate DLL. The major benefit of having the resource into seperate dll is, it can be easily skinned. Also it has the benefit of seperating the GUI from the code which is better for maintainance. Here are the simple steps to do the same. ...
Introduction This article shows the enumeration of child windows. The code is written in win 32 and can be understood with a prior knowledge of it. Although i have tried well to explain all the points as far as possible. //HEADER FILES # include <windows.h>