Friday, November 20, 2009

Internet Users as Percentage of Population in Google Public Data

Google Public Data has some cool new interactive charts on Internet Usage with data from the World Bank's World Development Indicators (WDI). These charts update dynamically as and when new data becomes available and also allow you to customize the views the way you prefer.
This one shows Internet users worldwide per 100 inhabitants. [view directly at Google Public Data]


You can embed this chart in your web site if you keep one. This one shows Internet users in the United States. [view directly at Google Public Data]


The one below can be seen comparing Internet users in the United States against the world population. [view directly at Google Public Data]


This one compares that of the United States and China. [view directly at Google Public Data]


This next one compares Internet users between United States, China and India. [view directly at Google Public Data]


This next one compares Internet users between the United States and India. [view directly at Google Public Data]


Hit the links to view the charts directly at Google Public Data where you can build your own customized version and also get the code to embed them in your web site, or maybe get a link to share them with friends and colleagues.

Monday, July 13, 2009

Programming Resources

Here I am dropping bookmarks to some programming and development resources that I have been using.

How to: Handle User Input Events in Windows Forms Controls - MSDN - MSDN.Microsoft.com

This example demonstrates how to handle most keyboard, mouse, focus, and validation events that can occur in a Windows Forms control. The text box named TextBoxInput receives the events when it has focus, and information about each event is written in the text box named TextBoxOutput in the order in which the events are raised. The application also includes a set of check boxes that can be used to filter which events to report.

http://msdn.microsoft.com/en-us/library/ms171549.aspx

Batch files for DOS, OS/2, Windows 95/98, NT 4, 2000 and XP - Rob van der Woude's Scripting Pages

Technically, DOS provides just eight basic batch file commands -- CALL, ECHO, FOR, GOTO, IF, PAUSE, REM, and SHIFT -- plus a tiny assortment of miscellaneous doodads: replaceable parameters, environment variables, labels, double == signs, and @ signs. That's it! Not too much to learn, even for the most fervent DOS-hater. But the tools these few commands can create will astonish you.

http://www.robvanderwoude.com/batchfiles.php

Sorting and Searching Algorithms by Tom Niemann, Portland, Oregon | ePaperPress

This is a collection of algorithms for sorting and searching. Descriptions are brief and intuitive, with just enough theory thrown in to make you nervous. I assume you know a high-level language, such as C, and that you are familiar with programming concepts including arrays and pointers. The first section introduces basic data structures and notation. The next section presents several sorting algorithms. This is followed by a section on dictionaries, structures that allow efficient insert, search, and delete operations. The last section describes algorithms that sort data and implement dictionaries for very large files. Source code for each algorithm, in ANSI C, is included.

http://epaperpress.com/sortsearch/

Sorting and Searching Algorithms: A Cookbook by Thomas Niemann, Portland, Oregon

This is a collection of algorithms for sorting and searching. Descriptions are brief and intuitive, with just enough theory thrown in to make you nervous. I assume you know C, and that you are familiar with concepts such as arrays and pointers.

http://www.cs.auckland.ac.nz/software/AlgAnim/niemann/s_man.htm

freedb.org

freedb is a database to look up CD information using the internet. This is done by a client (a freedb aware application) which calculates a (nearly) unique disc ID for a CD in your CD-Rom and then queries the database. As a result, the client displays the artist, CD-title, tracklist and some additional info.

http://www.freedb.org/

File called "C:\Program" - The Corsair Support Forums

When I start up my computer, I frequently get a message notifying me that I have a file called "program" in my root directory (c:\), and asking me if I would like to rename it or ignore it. It doesn't happen every time but it happens a lot. Is there any way to figure out why this file keeps getting created? The file size is always 0 bytes. Create a batchfile called Program.bat in the root of drive C: with: "echo c:\program %1 %2 %3 %4 %5 >c:\temp\badapp.log" in it, this will trap the rest of the command line to the file c:\temp\badapp.log, and will tell you what is happening. and which program is at fault. However it may not work if the program is a shellspace extension or a rundll32.dll activated application.

http://forum.corsair.com/forums/showthread.php?t=26539

How to self-elevate an application to a high privilege level under UAC - Microsoft Support

UAC was introduced in Windows Vista. When UAC is fully enabled, interactive administrators typically run with the least user privileges. However, interactive administrators can self-elevate by giving explicit consent with the Consent UI. Interactive administrators perform administrative tasks that include installing software and drivers, changing system-wide settings, viewing or changing other user accounts, and running administrative tools.

http://support.microsoft.com/kb/981778

Windows Script Host Examples - robvanderwoude.com

HTA, JScript, VBScript and WSC examples

http://www.robvanderwoude.com/wshexamples.php

theForger's Win32 API Tutorial - winprog.org

This tutorial attempts to get you started developing with the Win32 API as quickly and clearly as possible.

http://www.winprog.org/tutorial

Learn C++: The C++ Tutorial - LearnCpp.com

LearnCpp.com is a totally free website devoted to teaching you to program in C++. Whether you’ve had any prior experience programming or not, the tutorials on this site will walk you through all the steps you’ll need to know in order to create and compile your programs. Becoming an expert programmer won’t happen overnight, but with a little patience, you’ll get there. And LearnCpp.com will show you the way.

http://www.learncpp.com/

You cannot change the state of a menu item from its command user-interface handler if the menu is attached to a dialog box in Visual C++ - Microsoft Support

You cannot change the state of a menu item from its command user-interface handler if the menu is attached to a dialog box in Visual C++ - When a drop-down menu is displayed, the WM_INITMENUPOPUP message is sent prior to displaying the menu items. The MFC CFrameWnd::OnInitMenuPopup function iterates through the menu items and calls the update command UI handler for the item, if there is one. The appearance of each menu item is updated to reflect its state (enabled/disabled, checked/unchecked). The update UI mechanism doesn't work for a dialog box-based application because CDialog has no OnInitMenuPopup handler and it uses CWnd's default handler, which does not call update command UI handlers for menu items.

http://support.microsoft.com/kb/242577

Design Patterns | Object Oriented Design

Design Patterns, Design Principles, Object Oriented Design, Java, C#, VB

http://www.oodesign.com/

Standard Template Library Programmer's Guide - SGI.com

The Standard Template Library, or STL, is a C++ library of container classes, algorithms, and iterators; it provides many of the basic algorithms and data structures of computer science. The STL is a generic library, meaning that its components are heavily parameterized: almost every component in the STL is a template. You should make sure that you understand how templates work in C++ before you use the STL.

http://www.sgi.com/tech/stl/

CryptProtectData function - MSDN Library - MSDN.microsoft.com

The CryptProtectData function performs encryption on the data in a DATA_BLOB structure. Typically, only a user with the same logon credential as the user who encrypted the data can decrypt the data. In addition, the encryption and decryption usually must be done on the same computer.

http://msdn.microsoft.com/en-us/library/aa380261

C++ String: How to convert between 'CString' and 'std::string'? - CodeGuru Forums

How to convert between 'CString' and 'std::string'

http://www.codeguru.com/forum/showthread.php?t=231155

Access Rights for Access-Token Objects (Windows) - MSDN

An application cannot change the access control list of an object unless the application has the rights to do so. These rights are controlled by a security descriptor in the access token for the object. For more information about security, see Access Control Model. To get or set the security descriptor for an access token, call the GetKernelObjectSecurity and SetKernelObjectSecurity functions. When you call the OpenProcessToken or OpenThreadToken function to get a handle to an access token, the system checks the requested access rights against the DACL in the token's security descriptor.

http://msdn.microsoft.com/en-us/library/aa374905

DM_REPOSITION Message (Windows) - MSDN

Repositions a top-level dialog box so that it fits within the desktop area. An application can send this message to a dialog box after resizing it to ensure that the entire dialog box remains visible. This message has no effect if the dialog box is a child window.

http://msdn.microsoft.com/en-us/library/ms645409

Thread Safety in the Standard C++ Library (Standard C++ Library) - MSDN

The following thread safety rules apply to all classes in the Standard C++ Library (except shared_ptr and iostream classes, as described below). A single object is thread safe for reading from multiple threads. For example, given an object A, it is safe to read A from thread 1 and from thread 2 simultaneously. If a single object is being written to by one thread, then all reads and writes to that object on the same or other threads must be protected. For example, given an object A, if thread 1 is writing to A, then thread 2 must be prevented from reading from or writing to A. It is safe to read and write to one instance of a type even if another thread is reading or writing to a different instance of the same type. For example, given objects A and B of the same type, it is safe if A is being written in thread 1 and B is being read in thread 2.

http://msdn.microsoft.com/en-us/library/c9ceah3b

Standard C++ Library Overview - MSDN

All C++ library entities are declared or defined in one or more standard headers. To make use of a library entity in a program, write an include directive that names the relevant standard header. The Standard C++ Library consists of 50 required headers. This implementation also includes two additional headers, <hash_map> and <hash_set>, that are not required by the C++ Standard, for a total of 52 headers. These 52 C++ library headers (with the additional 18 Standard C headers) constitute a hosted implementation of the C++ library.

http://msdn.microsoft.com/en-us/library/ct1as7hw

Standard Template Library - MSDN

The Standard Template Library (STL) establishes uniform standards for the application of iterators to STL containers or other sequences that you define, by STL algorithms or other functions that you define. Inthis section: STL Containers, Iterators, Algorithms, Allocators, Function Objects.

http://msdn.microsoft.com/en-us/library/c191tb28

Getting Started with Winsock (Windows) - MSDN

The following is a step-by-step guide to getting started with Windows Sockets programming. It is designed to provide an understanding of basic Winsock functions and data structures, and how they work together. The client and server application that is used for illustration is a very basic client and server. More advanced code examples are included in the samples included with the Microsoft Windows Software Development Kit (SDK). The first few steps are the same for both client and server applications.

http://msdn.microsoft.com/en-us/library/ms738545

About Messages and Message Queues (Windows) - MSDN

Unlike MS-DOS-based applications, Windows-based applications are event-driven. They do not make explicit function calls (such as C run-time library calls) to obtain input. Instead, they wait for the system to pass input to them. The system passes all input for an application to the various windows in the application. Each window has a function, called a window procedure, that the system calls whenever it has input for the window. The window procedure processes the input and returns control to the system. If a top-level window stops responding to messages for more than several seconds, the system considers the window to be not responding. In this case, the system hides the window and replaces it with a ghost window that has the same Z order, location, size, and visual attributes. This allows the user to move it, resize it, or even close the application. However, these are the only actions available because the application is actually not responding.

http://msdn.microsoft.com/en-us/library/ms644927

C++ Coding Standards: Joint Strike Fighter Air Vehicle - Lockheed Martin Corporation - research.att.com

The intent of this document is to provide direction and guidance to C++ programmers that will enable them to employ good programming style and proven programming practices leading to safe, reliable, testable, and maintainable code.

http://www2.research.att.com/~bs/JSF-AV-rules.pdf

How to convert local system time to UTC or GMT - Visual C++ Tips - weseetips.com

First you’ve to get your timezone information by calling – GetTimeZoneInformation(). Then get the local time by calling – GetSystemTime() and translate it to UMT or GMT by calling – TzSpecificLocalTimeToSystemTime(). See the sample code snippet below.

http://weseetips.com/2008/05/28/how-to-convert-local-system-time-to-utc-or-gmt/

freopen: Reopen stream with different file or mode - C++ Reference - CPlusPlus.com

freopen first tries to close any file already associated with the stream given as third parameter and disassociates it. Then, whether that stream was successfuly closed or not, freopen opens the file whose name is passed in the first parameter, filename, and associates it with the specified stream just as fopen would do using the mode value specified as the second parameter. This function is specially useful for redirecting predefined streams like stdin, stdout and stderr to specific files. A sample code in this article redirects the output that would normally go to the standard output (stdout) to a file called myfile.txt.

http://www.cplusplus.com/reference/clibrary/cstdio/freopen/

Does Windows have a limit of 2000 threads per process? - The Old New Thing | MSDN Blogs - Blogs.MSDN.com

Often I see people asking why they can't create more than around 2000 threads in a process. The reason is not that there is any particular limit inherent in Windows. Rather, the programmer failed to take into account the amount of address space each thread uses. A thread consists of some memory in kernel mode (kernel stacks and object management), some memory in user mode (the thread environment block, thread-local storage, that sort of thing), plus its stack. (Or stacks if you're on an Itanium system.) Usually, the limiting factor is the stack size. Why does it give up at around 2000? Because the default stack size assigned by the linker is 1MB, and 2000 stacks times 1MB per stack equals around 2GB, which is how much address space is available to user-mode programs. You can try to squeeze more threads into your process by reducing your stack size, which can be done either by tweaking linker options or manually overriding the stack size passed to the CreateThread functions..

http://blogs.msdn.com/b/oldnewthing/archive/2005/07/29/444912.aspx

How to: Convert Between Various String Types - Visual C++ | MSDN Library - Microsoft.com

This topic demonstrates how to convert various Visual C++ string types into other strings. The strings types that are covered include char *, wchar_t*, _bstr_t, CComBSTR, CString, basic_string, and System.String. In all cases, a copy of the string is made when converted to the new type. Any changes made to the new string will not affect the original string, and vice versa.

http://msdn.microsoft.com/en-us/library/ms235631

C++ Reference Guide - Guides | Programming | C/C++ - InformIT.com

Reference guide covering all aspects of the C++ language good and easy to use sample source code.

http://www.informit.com/guides/guide.aspx?g=cplusplus

Add the Command Prompt to the Windows Explorer Right-Click Menu - HowToGeek.com

A hidden functionality in Windows allows you to right click on a directory, and select "Command Prompt Here" from the menu. Start regedit.exe and navigate to HKEY_CLASSES_ROOT\Directory\shell. Create new key "CommandPrompt" (without quotes) and change the text of (Default) value to "Command Prompt Here" (without quotes). Create new key "Command" (without quotes) and change the text of (Default) value to "cmd.exe /k cd %1" (without quotes). Now when you right click on a folder, you should see the "Command Prompt Here" item in the menu.

http://www.howtogeek.com/howto/windows/add-the-command-prompt-to-the-windows-explorer-right-click-menu/

C++ FAQ - Parashift.com

The C++ Frequently Asked Questions by Marshall Cline.

http://www.parashift.com/c++-faq/

Use MSCONFIG to Manage Your Startup Programs - PCDon.com

If programs not currently being used are running, the ones you are using are slowed down even more. What might such a needlessly running program be? Well, a good example is Adobe Reader.

http://www.pcdon.com/092705_UsingMSCONFIG.html

Winsock Programmer’s FAQ: Winsock Programmer's FAQ

This FAQ answers the most commonly-asked questions about Winsock. The bulk of it was written back when mailing lists and news groups were the best ways to find people who knew Winsock deeply, and so drew heavily from those resources. Today, there are better places to ask questions.

http://tangentsoft.net/wskfaq/

GetModuleFileName Function (Windows) - MSDN Library - Microsoft.com

Retrieves the fully-qualified path for the file that contains the specified module. The module must have been loaded by the current process. To locate the file for a module that was loaded by another process, use the GetModuleFileNameEx function.

http://msdn.microsoft.com/en-us/library/ms683197

C++ Reference Wiki - CPPReference.com

C++ programming reference website.

http://www.cppreference.com/wiki/

STL Containers - C++ Reference - cplusplus.com

Reference page for Containers found in the C++ Standard Template Library.

http://www.cplusplus.com/reference/stl/

_stat, _wstat Functions - MSDN Library - Microsoft.com

Get status information on a file.

http://msdn.microsoft.com/en-us/library/14h5k7ff.aspx

Multiple map : map : map multimap : C++ Tutorial - java2s.com

Code example for multimap from the book "The C++ Standard Library - A Tutorial and Reference" by Nicolai M. Josuttis, Addison-Wesley, 1999.

http://www.java2s.com/Tutorial/Cpp/0460__map-multimap/Multiplemap.htm

Using Run-Time Dynamic Linking (Windows) - MSDN Library - Microsoft.com

You can use the same DLL in both load-time and run-time dynamic linking. The following example uses the LoadLibrary function to get a handle to a DLL.

http://msdn.microsoft.com/en-us/library/ms686944(VS.85).aspx

Predefined Macros - MSDN Library - Microsoft.com

This page lists predefined ANSI C and Microsoft C++ implementation macros. The compiler recognizes predefined ANSI C macros and the Microsoft C++ implementation provides several more. These macros take no arguments and cannot be redefined. Some of the predefined macros listed below are defined with multiple values.

http://msdn.microsoft.com/en-us/library/b0084kay.aspx

Visual Studio Ideas - McTainsh.com

Source Code for Visual C++, C#, .NET and Java Developers

http://www.mctainsh.com/

How to create and parse a simple XML document using MSXML.dll - Visual C++ Ideas - McTainsh.com

XML is becoming a popular way to pass complex data in a mostly human readable form. In the article is discussed how to create an XML document then parse the document to get particular data out of it. It is quite easy to create XML using simple text strings but we will use the very powerful MSXML Document Object Model. Remember, DOM is goood.

http://www.mctainsh.com/Articles/COM/UsingXmlDom.aspx

DOM Basics with C++ and MSXML - by Michael C. Rawlins - InformIT.com

Michael C. Rawlins introduces C++ developers to using Microsoft's MSXML for producing and consuming XML documents using the Document Object Model (DOM). Article is provided courtesy of Addison Wesley. Michael C. Rawlins is the author of Using XML with Legacy Business Applications.

http://www.informit.com/articles/article.aspx?p=169461

How Do I Use DOM? - MSDN Library - Microsoft.com

Series of exercises on programming with XML DOM APIs in C/C++, Visual Basic, and JScript. The following table describes these hands-on tutorials: Program with DOM in C/C++, Program with DOM in C/C++ Using Smart Pointer Class Wrappers, Program with DOM in Visual Basic, Program with DOM in JScript, Program with DOM in VBScript.

http://msdn.microsoft.com/en-us/library/ms756005(VS.85).aspx

Get Ready to Work with MSXML (C/C++) - MSDN Library - Microsoft.com

This article describes how to get ready to work with MSXML in native C/C++ projects.

http://msdn.microsoft.com/en-us/library/ms765540(VS.85).aspx

Beginner's Guide to XML - Data Developer Center | Learn | MSXML | MSDN - Microsoft.com

This page contains resources to help developers get up to speed with XML. For additional resources see the Learning Resources page. For more resources see the Resources & Community page.

http://msdn.microsoft.com/en-us/data/ff683554.aspx

pragma message - Pragma Directives and the __Pragma Keyword - MSDN - Microsoft.com

Sends a string literal to the standard output without terminating the compilation. A typical use of the message pragma is to display informational messages at compile time.

http://msdn.microsoft.com/en-us/library/x7dkzch2.aspx

How to use the #pragma message to generate user-defined warning messages in Visual C++ - Microsoft Support - Microsoft.com

KB155196: Have the compiler generate user-defined warning messages and displayed in the Developer Studio's Output window that you can double-click to get to the line of code with the message. See @lgillen's note: "#pragma message() is a crappy replacement for GCC's #warning. How long has MS been this lame?"

http://support.microsoft.com/kb/155196

STL map in C++ - C++ Tutorial - Java2S.com

Demonstatiion of use and programming with STL maps in C++; Using strings as the key and value in a map; Using string-string maps and looping through the value key-pairs; Using char-int maps; Using string-float maps; Multiple maps; Storing objects in a map; A phone list in which a person's name is the key and the phone number is the value; Computing an inner product of tuples represented as maps.

http://www.java2s.com/Tutorial/Cpp/0460__map-multimap/0020__map.htm

DLLs - MSDN Library - Microsoft.com

A dynamic-link library (DLL) is an executable file that acts as a shared library of functions. Dynamic linking provides a way for a process to call a function that is not part of its executable code. The executable code for the function is located in a DLL, which contains one or more functions that are compiled, linked, and stored separately from the processes that use them. DLLs also facilitate the sharing of data and resources. Multiple applications can simultaneously access the contents of a single copy of a DLL in memory.

http://msdn.microsoft.com/en-us/library/1ez7dh12.aspx

Walkthrough: Creating and Using a Managed Assembly (C++) - MSDN Library - Microsoft.com

Starters' walkthrough to create and use a Managed Assembly in C++ using Visual C++. A managed assembly is a kind of library that you can create to reuse code efficiently. Instead of re-implementing the same routines in many programs, you can write them once and then reference them from applications that require the functionality.

http://msdn.microsoft.com/en-us/library/ms235638.aspx

Walkthrough: Creating and Using a Static Library (C++) - MSDN Library - Microsoft.com

Starters' walkthrough to create and use a static library (LIB) in C++ using Visual C++. Using static libraries is a great way to reuse code. Rather than re-implementing the same routines in every program that you create, you write them one time and reference them from applications that need the functionality.

http://msdn.microsoft.com/en-us/library/ms235627.aspx

Walkthrough: Creating and Using a Dynamic Link Library (C++) - MSDN Library - Microsoft.com

Starters' walkthrough to create and use a dynamic link library (DLL) in C++ using Visual C++. Using DLLs is a great way to reuse code. Rather than re-implementing the same routines in every program that you create, you write them one time and reference them from applications that need the functionality.

http://msdn.microsoft.com/en-us/library/ms235636.aspx

How to Open Any Text Document In Notepad Quickly - Support - Microsoft.com

KB 193717: This article describes how to create a shortcut to Notepad.exe in the Windows\SendTo folder so that you can right-click any text file, and then click Notepad to open the file in Notepad. You can use this method to similarly add other program shortcuts you want to use to open files quickly from the Send to.. sub-menu.

http://support.microsoft.com/kb/193717/en-us

How to Use Notepad to Create a Log File - Support - Microsoft.com

KB 260563: Microsoft Notepad is a word processing tool included with Windows and is installed by default under the Accessories program group. You can use it to create a log-type file that adds the current date and time each time the Notepad file is opened. This article describes how to create a log file with Notepad.

http://support.microsoft.com/kb/260563

Process Explorer Executable [EXE] - Live.SysInternals.com

This Process Explorer executable can be run directly - without installation - from Live.SysInternals.com. You won't get the Help support file, however. Just save the executable (EXE) file and fire it up. A word of caution: This URL links directly to an exe file. This is for use by experienced Process Explorer users only. Newbies, visit the Process Explorer page on TechNet at http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

http://live.sysinternals.com/procexp.exe

Process Explorer - by Mark Russinovich | SysInternals | Microsoft Technet - TechNet.Microsoft.com

SysInternals' Process Explorer by Mark Russinovich at Microsoft Technet is a must-have system utility that finds massive usage by Windows developers. Additionally, Windows users who know about the Windows Task Manager and use it frequently to control the running applications and processes or to check on the current system status & performance levels, should find good use of this application. Process Explorer is kind of an advanced form of the Task Manager that ships with Windows, but provides details up to levels much more deeper. This program can easily be set to replace the Task Manager. Some mysteries it helps you unearth easily are, say, which program has a particular file or directory open, the handles and DLLs and memory-mapped files that each of the processes have opened or loaded, and many more.. The unique capabilities of Process Explorer make it useful for tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Introduction To Windows Programming

Most likely you have heard the term 'event-driven' before, but what does that have to do with Windows programming? Much. If you're used to dos coding (or similar system code), you're probably accustomed to having programs execute lines of code, one by one, in order from start to finish via function calls and such until the program is done or accomplishes some task. This is not how Windows programming works. Windows programming is typically based on 'events'. What kind of events? An event can be anything such as a mouse click or a button click on a window. So if a user clicks a button, how does our program know to execute the code for a button click? For our purposes, imagine a sort of omnipresent sentinel that sits around and waits for these events then converts them into 'messages' that our program can deal with. Each window is sent messages based on events and such, which are then accordingly processed. So if a button is clicked, the parent window is sent a message (via a function call) that tells it what has happened. How does a window receive a message? Each window has a 'window procedure' that handles all of the messages sent to it. We'll see more on that and how to react to messages in a bit. First we need to create a window.

https://www.flipcode.com/archives/Introduction_To_Windows_Programming.shtml

Introduction To Basic Multithreaded Programming

The Operating System that you use was probably written with the idea of threads, or processes in mind. This means, you can run programs of your choosing. A process is a running program, and a program is a set of instructions that the machine can understand. Of course, you can run more than one process at a time. You probably are right now, correct? When you open up separate programs, they run as processes in their own separate memory space. This means that each program running has a chunk of memory to which it and only it can use. That's how many programs can run without changing variables and states of other running programs. Follow? If all of your system memory could be controlled by any arbitary running program, it would be chaotic!

https://www.flipcode.com/archives/Introduction_To_Basic_Multithreaded_Programming.shtml

Working With Menus And Dialog Boxes

In case you honestly don't know what a menu is in Windows, perhaps this document is not for you (in fact its definitely not). Every Windows user probably knows what a menu is and uses a variety of them on a regular basis. But how do we program one? If you recall from the previous tutorial, everything translates down to a message that can be processed through our window procedure. This is true even for menu item clicks. Lets take a look at how to add a menu to a program such as the simple application from the previous tutorial. I won't actually be adding it for you -- that's left as an excercise for the reader.

https://www.flipcode.com/archives/Working_With_Menus_And_Dialog_Boxes.shtml

Creating And Using DLLs

Creating a dll is nothing too far out. Basically, you write your functions then compile them almost like you would any other library. If you're using MSVC, create a new project and set the target as a Win32 Dynamic-Link Library. That way when you compile your code, it should produce a dll, an import library (.lib), and an export library (.exp). Here's some sample code that shows how the sample DLL included with this tutorial is put together

https://www.flipcode.com/archives/Creating_And_Using_DLLs.shtml

C++ Exception Handling

Exception handling can be a very personal and complex topic. The C language gave the programmer very few exception handling capabilities, as the programmers wanted more control over exceptions themselves. Thankfully, the C++ standards committee crafted a simple, but powerful form of exception handling for the C++ language that still gives the programmer quite a bit of control. Many coders eschew this method that I will present shortly, so more power to you. Most of the information I learned on C++ exception handling was from the wonderful Deep C++ column on MSDN.

https://www.flipcode.com/archives/C_Exception_Handling.shtml

Multithreading by Dan Royer Part 1

Multithreading. What a terrifying word. Not one month ago the thought of writing a multithreaded application made my brain hurt and my skin crawl. Fortunately, it turns out the skin crawling was a completely unrelated medical issue and that multithreading is actually quite easy, provided you're careful in your implementation. In this tutorial I'll show you a few of the places to use multithreading, and give you everything you need to run threads. Lastly, I'll show you how to let two or more threads access the same piece of information without screwing each other up.

https://www.flipcode.com/archives/Multithreading-Part_1.shtml

Multithreading by Dan Royer Part 2

Last time on "The Young and the Multithreading"... we scratched into the surface of setting up more than one thread using a simple thread wrapper. But one very important part that wasn't discussed was how to protect data that is used by more than one thread.

https://www.flipcode.com/archives/Multithreading-Part_2.shtml

Exploring the C++ Unit Testing Framework Jungle - Games From Within - GamesFromWithin.com

One of the topics I've been meaning to get to for quite a while is the applicability of test-driven development in games. I will get to that soon. I promise! In the meanwhile I'm now in the situation that I need to choose a unit-testing framework to roll out for my team at work. So, before I get to talk about how to use test-driven development in games, or the value of unit testing, or anything like that, we dive deep into a detailed comparison of existing C++ unit-testing frameworks. Hang on tight. It's going to be a long and bumpy ride with a plot twist at the end.

https://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle

HTML to PDF Converter

HTML-PDF-Converter lets you convert a web page to PDF documents for free. The service is online, with a plain and intuitive interface, and does not need any PDF printer driver to be installed on the local system. The converter simply asks for the URL of the Web page to convert, and after a short while it has the PDF file ready for download. You would want to use this, for instance, to keep a copy of a web page that you wish to preserve for your archive, as a single-file document instead of saving them as an HTML web page along with a bunch of other support files containing the images, scripts, etc.

http://www.html-pdf-converter.com/

Sysinternals

The Sysinternals web site was created in 1996 by Mark Russinovich to host his advanced system utilities and technical information. Whether you’re an IT Pro or a developer, you’ll find Sysinternals utilities to help you manage, troubleshoot and diagnose your Windows and Linux systems and applications.

https://learn.microsoft.com/en-us/sysinternals/

Sysinternals Live Directory

SysInternals Live service is a file share allowing access to all Sysinternals utilities. Utilities here can be directly downloaded or executed from the Web. The directory can be browsed using a Web browser or even the Windows Explorer like a file-share. The tools can be executed directly using their paths in Windows Explorer or a command prompt as http://live.sysinternals.com/<toolname> or \\live.sysinternals.com\tools\<toolname>. To browse the file share you can also use "\\live.sysinternals.com" from the Run dialog.

http://live.sysinternals.com/

CWnd::GetSafeHwnd (MFC) - Development Tools and Languages | Visual Studio | Visual C++ | Reference | Visual C++ Libraries | MFC | MFC Classes | CWnd Class | Member Functions | MSDN Library - MSDN.Microsoft.com

Returns the window handle for a window. Returns NULL if the CWnd is not attached to a window or if it is used with a NULL CWnd pointer.

http://msdn.microsoft.com/en-us/library/d64ehwhz

Sysinternals Desktops v1.0 - TechNet | TechCenters | Windows Sysinternals | Downloads | Miscellaneous | Desktops - TechNet.Microsoft.com

Desktops allows you to organize your applications on up to four virtual desktops. Read email on one, browse the web on the second, and do work in your productivity software on the third, without the clutter of the windows you’re not using. After you configure hotkeys for switching desktops, you can create and switch desktops either by clicking on the tray icon to open a desktop preview and switching window, or by using the hotkeys.

http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx

Notepad++

Notepad++ is a free source code editor (and Notepad replacement), which supports several programming languages, running under the MS Windows environment. This project, based on the Scintilla edit component (a very powerful editor component), written in C++ with pure win32 api and STL (that ensures the higher execution speed and smaller size of the program), is under the GPL License.

https://notepad-plus-plus.org/

WinMerge

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.

https://winmerge.org/

Debugging Tools for Windows - WHDC | Developer Tools | Debugging - Microsoft.com

You can use Debugging Tools for Windows to debug drivers, applications, and services on systems that are running Windows NT 4.0, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. You can also use Debugging Tools for Windows to debug the operating system itself. Versions of the Debugging Tools for Windows package are available for 32-bit x86, native Intel Itanium, and native x64 platforms.

http://www.microsoft.com/whdc/devtools/debugging/default.mspx

Developing a WIA Scanner Driver - MSDN - Microsoft.com

A WIA scanner driver developer can create either a WIA microdriver or a WIA minidriver.

http://msdn.microsoft.com/en-us/library/ms792298.aspx

The Function Pointer Tutorials - Newty.de

A neat tutorial on how to create and use function pointers and callbacks in C and C++.

http://www.newty.de/fpt/index.html

WIA Architecture Overview - MSDN - Microsoft.com

WIA has three main components: the WIA service, the WIA driver service library, and a vendor user-mode driver.

http://msdn.microsoft.com/en-us/library/ms792495.aspx

Description of digital certificates - Help and Support - Microsoft.com

This article is a general overview of digital certificates and how they relate to digitally signed Office macros, signed programs, and ActiveX controls. Digital signatures and certificates of authenticity can be applied to executable programs, ActiveX controls, or Office Visual Basic for Applications macros. These signatures provide you with the assurance that what you are about to use comes from a realiable source and that it has not been tampered with. Digital certificates help to eliminate macro viruses from being introduced into your Office documents, your computer, and your local network.

http://support.microsoft.com/kb/q206637/

Command-line reference A-Z - TechNet - Microsoft.com

Reference of all commands for the Windows command-line.

http://technet.microsoft.com/en-us/library/bb491071.aspx

How to Run Legacy Applications Using Windows XP - TechNet - Microsoft.com

Installing a new version of the Microsoft® Windows® operating system often poses a problem for the average user when it comes to supporting older applications. Microsoft Windows XP is an exception to this rule. Because of the extensive support for application compatibility within Windows XP, nearly every Windows program available can be run successfully on Windows XP.

http://technet.microsoft.com/en-us/library/bb456991.aspx

How to Convert FAT Disks to NTFS - TechNet - Microsoft.com

This article describes how to convert FAT disks to NTFS. You can convert a FAT or FAT32 volume to an NTFS volume without formatting the volume, though it is still a good idea to back up your data before you convert.

http://technet.microsoft.com/en-us/library/bb456984.aspx

Convert - TechNet - Microsoft.com

Converts FAT and FAT32 volumes to NTFS

http://technet.microsoft.com/en-us/library/bb490885.aspx

GetImage Sample: Demonstrates the Windows Image Acquisition API - MSDN

The GetImage sample demonstrates the Windows Image Acquisition (WIA) application programming interfaces (APIs).

http://msdn.microsoft.com/en-us/library/7eh90ebz

WinMain Entry Point (Windows) - MSDN

The WinMain function is the conventional name for the user-provided entry point for a Microsoft Windows-based application.

http://msdn.microsoft.com/en-us/library/ms633559

How To Programmatically Cause the Creation of a User's Profile - Help and Support - Microsoft.com

This article demonstrates how to programmatically cause a user's profile to be created without requiring an interactive logon.

http://support.microsoft.com/kb/196070

Visual C++ Walkthroughs

Walkthroughs give step-by-step instructions for common scenarios, which makes them a good place to start learning about the product or a particular feature area.

http://msdn.microsoft.com/en-us/library/e6w9eycd.aspx

Visual C++ Sample Applications

This section lists the sample applications included with Visual C++.

http://msdn.microsoft.com/en-us/library/1370z17c.aspx

Using INF Files - MSDN - Microsoft.com

An information file (.inf) provides installation instructions that the Internet Component Download service provided in Microsoft Internet Explorer 3.0 or later uses to install and register software components downloaded from the Internet, as well as any files required by the components. The INF file is a text file that specifies the files that need to be present or downloaded for your component to run.

http://msdn.microsoft.com/en-us/library/aa741213

SHGetSpecialFolderLocation Function (Windows) - MSDN - Microsoft.com

Retrieves a pointer to the ITEMIDLIST structure of a special folder.

http://msdn.microsoft.com/en-us/library/bb762203

How Do I: Implement Custom Dialog Controls? - MSDN

Join Jonathon Wood of SoftCircuits as he demonstrates how to create your own dialog-box controls from scratch.

http://msdn.microsoft.com/en-us/visualc/cc843613.aspx

Windows API Reference (Windows) - MSDN - Microsoft.com

The following topics provide information about the programming elements included in the Windows API.

http://msdn.microsoft.com/en-us/library/aa383749

C++ Annotations by Frank B. Brokken [ISBN-90-367-0470-7]

Published at the University of Groningen, this document is intended for knowledgeable users of C (or any other language using a C-like grammar, like Perl or Java) who would like to know more about, or make the transition to, C++. This document is the main textbook for Frank's C++ programming courses, which are yearly organized at the University of Groningen. The C++ Annotations do not cover all aspects of C++, though. In particular, C++'s basic grammar, which is, for all practical purposes, equal to C's grammar, is not covered. For this part of the C++ language, the reader should consult other texts, like a book covering the C programming language.

http://www.icce.rug.nl/documents/cplusplus/

CreateProcessAsUser() windowstations and desktops - Help and Support - Microsoft.com

When a process is started by means of the CreateProcessAsUser function, the process will be started into a windowstation and desktop combination based on the value of lpDesktop in the STARTUPINFO structure parameter:..

http://support.microsoft.com/kb/165194

Structural Definition of .inf Files - TechNet - Microsoft.com

Although the IEAK wizard, Internet Explorer batch files, and third-party programs can customize Setup, you can also use setup information files (.inf) files to develop a customized setup solution. This appendix describes the sections of an .inf file and provides a sample.

http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/ierk/appxh_a.mspx

GetCurrentThread

This function returns a pseudohandle for the current thread.

http://msdn.microsoft.com/en-us/library/aa908744

CreateProcessWithTokenW Function (Windows) - MSDN

Creates a new process and its primary thread. The new process runs in the security context of the specified token. It can optionally load the user profile for the specified user. The process that calls CreateProcessWithTokenW must have the SE_IMPERSONATE_NAME privilege. If this function fails with ERROR_PRIVILEGE_NOT_HELD (1314), use the CreateProcessAsUser or CreateProcessWithLogonW function instead. Typically, the process that calls CreateProcessAsUser must have the SE_INCREASE_QUOTA_NAME privilege and may require the SE_ASSIGNPRIMARYTOKEN_NAME privilege if the token is not assignable. CreateProcessWithLogonW requires no special privileges, but the specified user account must be allowed to log on interactively. Generally, it is best to use CreateProcessWithLogonW to create a process with alternate credentials.

http://msdn.microsoft.com/en-us/library/ms682434

Services in Windows Vista - Windows Hardware Developer Central - Microsoft.com

This paper provides information about changes to Microsoft Windows services for Microsoft Windows Vista.

http://www.microsoft.com/whdc/system/vista/Vista_Services.mspx

Dialog Boxes Overview - MSDN

Standalone applications typically have a main window that both displays the main data over which the application operates and exposes the functionality to process that data through user interface (UI) mechanisms like menu bars, tool bars, and status bars. A non-trivial application may also display additional windows to do the following: Display specific information to users, Gather information from users and Both display and gather information. These types of windows are known as dialog boxes, and there are two types: modal and modeless.

http://msdn.microsoft.com/en-us/library/aa969773

CreateFile Function (Windows) - MSDN

Creates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe. The function returns a handle that can be used to access the file or device for various types of I/O depending on the file or device and the flags and attributes specified. To perform this operation as a transacted operation, which results in a handle that can be used for transacted I/O, use the CreateFileTransacted function.

http://msdn.microsoft.com/en-us/library/aa363858

SYSTEM_INFO

This structure contains information about the current computer system. This includes the processor type, page size, memory addresses, and OEM identifier.

http://msdn.microsoft.com/en-us/library/aa911521

CreateEnvironmentBlock Function (Windows) - MSDN

Retrieves the environment variables for the specified user. This block can then be passed to the CreateProcessAsUser function. To free the buffer when you have finished with the environment block, call the DestroyEnvironmentBlock function. If the environment block is passed to CreateProcessAsUser, you must also specify the CREATE_UNICODE_ENVIRONMENT flag. After CreateProcessAsUser has returned, the new process has a copy of the environment block, and DestroyEnvironmentBlock can be safely called. User-specific environment variables such as %USERPROFILE% are set only when the user's profile is loaded. To load a user's profile, call the LoadUserProfile function.

http://msdn.microsoft.com/en-us/library/aa373491

WM_NCHITTEST Message (Windows) - MSDN

Sent to a window in order to determine what part of the window corresponds to a particular screen coordinate. This can happen, for example, when the cursor moves, when a mouse button is pressed or released, or in response to a call to a function such as WindowFromPoint. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse. A window receives this message through its WindowProc function. Windows Vista: When creating custom frames that include the standard caption buttons, this message should first be passed to the DwmDefWindowProc function. This enables the Desktop Window Manager (DWM) to provide hit-testing for the captions buttons. If DwmDefWindowProc does not handle the message, further processing of WM_NCHITTEST may be needed.

http://msdn.microsoft.com/en-us/library/ms645618

basic_string::assign (C++ Std Lib) - MSDN

Assigns new character values to the contents of a string. The strings can be assigned new character values. The new value can be either a string and C-string or a single character. The operator= may be used if the new value can be described by a single parameter; otherwise the member function assign, which has multiple parameters, can be used to specify which part of the string is to be assigned to a target string.

http://msdn.microsoft.com/en-us/library/90ed6715

Connecting to a Socket (Windows) - MSDN

For a client to communicate on a network, it must connect to a server. Call the connect function, passing the created socket and the sockaddr structure as parameters. Check for general errors.

http://msdn.microsoft.com/en-us/library/ms737612

List Box Controls - MSDN

This article is a complete reference for list box controls. It describes all list box control styles, messages, and notifications in more detail than found in the Microsoft® Windows® version 3.x Software Development Kit (SDK) documentation. List box controls display a list of items from which the user can choose one or more items. List box controls can be either single column (one column of choices) or multiple column (one or more columns of choices), single selection (allowing only one item to be selected at a time) or multiple selection (allowing one or more items to be selected at a time).

http://msdn.microsoft.com/en-us/library/ms997541

Common HRESULT Values (Windows) - MSDN

The following HRESULT values are the most common. More values are contained in the header file Winerror.h.

http://msdn.microsoft.com/en-us/library/aa378137

strncmp, wcsncmp

Compare characters of two strings. The strncmp function lexicographically compares, at most, the first count characters in string1 and string2 and returns a value indicating the relationship between the substrings. strncmp is case-sensitive. Unlike strcoll, strncmp is not affected by locale. wcsncmp is the wide-character version of strncmp. The arguments and return value of wcsncmp are wide-character strings. These two functions behave identically otherwise. wcsncmp is the case-sensitive version of _wcsnicmp.

http://msdn.microsoft.com/en-us/library/ms860448

strstr, wcsstr, _mbsstr, _mbsstr_l (CRT) - MSDN

Return a pointer to the first occurrence of a search string in a string. The strstr function returns a pointer to the first occurrence of strSearch in str. The search does not include terminating null characters. wcsstr and _mbsstr are wide-character and multibyte-character versions of strstr. The arguments and return value of wcsstr are wide-character strings; those of _mbsstr are multibyte-character strings. _mbsstr validates its parameters. If str or strSearch is NULL, the invalid parameter handler is invoked, as described in Parameter Validation . If execution is allowed to continue, _mbsstr sets errno to EINVAL and returns 0. strstr and wcsstr do not validate their parameters. These three functions behave identically otherwise.

http://msdn.microsoft.com/en-us/library/z9da80kz

Imaging Devices Design Guide

This section contains information about Windows Image Acquisition (WIA) drivers, and Still Image (STI) drivers. The WIA programming interface should be used to develop imaging drivers for Microsoft Windows Me, Windows XP, and later operating systems. The STI programming interface should only be used to develop imaging drivers for Microsoft Windows 98 and Windows 2000. This section includes: Windows Image Acquisition Drivers, Still Image Drivers, Web Services on Devices.

http://msdn.microsoft.com/en-us/library/ff542729

CoInitialize Function (COM)

Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA). New applications should call CoInitializeEx instead of CoInitialize. You need to initialize the COM library on a thread before you call any of the library functions except CoGetMalloc, to get a pointer to the standard allocator, and the memory allocation functions. After the concurrency model for a thread is set, it cannot be changed. A call to CoInitialize on an apartment that was previously initialized as multithreaded will fail and return RPC_E_CHANGED_MODE. CoInitializeEx provides the same functionality as CoInitialize and also provides a parameter to explicitly specify the thread's concurrency model. CoInitialize calls CoInitializeEx and specifies the concurrency model as single-thread apartment. Applications developed today should call CoInitializeEx rather than CoInitialize.

http://msdn.microsoft.com/en-us/library/ms678543

FormatMessage function (Windows) - MSDN

Formats a message string. The function requires a message definition as input. The message definition can come from a buffer passed into the function. It can come from a message table resource in an already-loaded module. Or the caller can ask the function to search the system's message table resource(s) for the message definition. The function finds the message definition in a message table resource based on a message identifier and a language identifier. The function copies the formatted message text to an output buffer, processing any embedded insert sequences if requested. Within the message text, several escape sequences are supported for dynamically formatting the message. These escape sequences and their meanings are shown in the following tables. All escape sequences start with the percent character (%).

http://msdn.microsoft.com/en-us/library/ms679351

DrawText - Windows CE .NET - MSDN

This function draws formatted text in the specified rectangle. DrawText formats the text according to the specified format method. The DrawText function uses the selected font, text color, and background color for the device context to draw the text. Unless you specify the DT_NOCLIP value, DrawText clips the text so that it does not appear outside the specified rectangle. DrawText assumes that all formatting has multiple lines unless you specify the DT_SINGLELINE format. If the selected font is too large for the specified rectangle, the DrawText function does not attempt to substitute a smaller font. For Windows CE 2.10 and later, line breaking is supported for the Chinese, Korean, and Japanese languages.

http://msdn.microsoft.com/en-us/library/ms900650

Retrieving the Last-Error Code (Windows) - MSDN

When many system functions fail, they set the last-error code. If your application needs more details about an error, it can retrieve the last-error code using the GetLastError function and display a description of the error using the FormatMessage function. The following example includes an error-handling function that prints the error message and terminates the process. The lpszFunction parameter is the name of the function that set the last-error code.

http://msdn.microsoft.com/en-us/library/ms680582

Initializing Winsock (Windows) - MSDN

All processes (applications or DLLs) that call Winsock functions must initialize the use of the Windows Sockets DLL before making other Winsock functions calls. This also makes certain that Winsock is supported on the system. The WSAStartup function is called to initiate use of WS2_32.dll. The WSADATA structure contains information about the Windows Sockets implementation. The MAKEWORD(2,2) parameter of WSAStartup makes a request for version 2.2 of Winsock on the system, and sets the passed version as the highest version of Windows Sockets support that the caller can use.

http://msdn.microsoft.com/en-us/library/ms738566

list::push_back (Standard C Library) - MSDN

Adds an element to the end of a list. If an exception is thrown, the list is left unaltered and the exception is rethrown.

http://msdn.microsoft.com/en-us/library/tysfte5b

List Box Handlers (MFC)

The following map entries have the corresponding function prototype: ON_LBN_DBLCLK, ON_LBN_ERRSPACE, ON_LBN_KILLFOCUS, ON_LBN_SELCHANGE, ON_LBN_SETFOCUS.

http://msdn.microsoft.com/en-us/library/f4yfxt6d

socket function (Windows)

The socket function creates a socket that is bound to a specific transport service provider. The socket function causes a socket descriptor and any related resources to be allocated and bound to a specific transport-service provider. Winsock will utilize the first available service provider that supports the requested combination of address family, socket type and protocol parameters. The socket that is created will have the overlapped attribute as a default. For Windows, the Microsoft-specific socket option, SO_OPENTYPE, defined in Mswsock.h can affect this default. See Microsoft-specific documentation for a detailed description of SO_OPENTYPE. Sockets without the overlapped attribute can be created by using WSASocket. All functions that allow overlapped operation (WSASend, WSARecv, WSASendTo, WSARecvFrom, and WSAIoctl) also support nonoverlapped usage on an overlapped socket if the values for parameters related to overlapped operation are NULL.

http://msdn.microsoft.com/en-us/library/ms740506

OpenProcessToken Function (Windows) - Win32 and COM Development | Security | Authorization | Authorization Reference | Authorization Functions | MSDN Library - MSDN.Microsoft.com

The OpenProcessToken function opens the access token associated with a process. Close the access token handle returned through the TokenHandle parameter by calling CloseHandle.

http://msdn.microsoft.com/en-us/library/aa379295

Using Run-Time Dynamic Linking (Windows) - MSDN

You can use the same DLL in both load-time and run-time dynamic linking. The following example uses the LoadLibrary function to get a handle to the Myputs DLL (see Creating a Simple Dynamic-Link Library). If LoadLibrary succeeds, the program uses the returned handle in the GetProcAddress function to get the address of the DLL's myPuts function. After calling the DLL function, the program calls the FreeLibrary function to unload the DLL.

http://msdn.microsoft.com/en-us/library/ms686944

How to Create an HTML Editor Application - MSDN

This tutorial describes how to use features found in Microsoft Internet Explorer 5.5 or later to create an HTML Editor Application. The application you create in this tutorial contains an editable region where users can type and format text using all of the standard formatting commands. For example, users can make the text bold or italic, change the font size, and make bulleted or numbered lists. A toolbar provides the formatting buttons, buttons for opening and saving files, and drop-down list boxes for font and block formatting selections. A menu allows alternate access to the functionality provided by the toolbar. As of Internet Explorer 6, you can also use the HtmlDlgSafeHelper object to change the face or color of the font. With this HTML Editor Application, users can create HTML documents and save them to disk in either HTML or text format. If saved as an .htm file, the documents are viewable in Windows Internet Explorer or in the HTML Editor Application.

http://msdn.microsoft.com/en-us/library/ms537834

GetTokenInformation Function (Windows)

The GetTokenInformation function retrieves a specified type of information about an access token. The calling process must have appropriate access rights to obtain the information. To determine if a user is a member of a specific group, use the CheckTokenMembership function. For an example that uses this function, see Getting the Logon SID or Searching for a SID in an Access Token.

http://msdn.microsoft.com/en-us/library/aa446671

OSVERSIONINFOEX Structure (Windows) - MSDN

OSVERSIONINFOEX Structure Contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and information about product suites and the latest Service Pack installed on the system. This structure is used with the GetVersionEx and VerifyVersionInfo functions. Relying on version information is not the best way to test for a feature. Instead, refer to the documentation for the feature of interest. For more information on common techniques for feature detection, see Operating System Version. If you must require a particular operating system, be sure to use it as a minimum supported version, rather than design the test for the one operating system. This way, your detection code will continue to work on future versions of Windows. The following table summarizes the values returned by supported versions of Windows.

http://msdn.microsoft.com/en-us/library/ms724833

Services (Windows) - MSDN

A service application conforms to the interface rules of the Service Control Manager (SCM). It can be started automatically at system boot, by a user through the Services control panel applet, or by an application that uses the service functions. Services can execute even when no user is logged on to the system. A driver service conforms to the device driver protocols. It is similar to a service application, but it does not interact with the SCM. For simplicity, the term service refers to a service application in this overview.

http://msdn.microsoft.com/en-us/library/ms685141

Registry Entries for Still Image Devices (Windows Driver Kit) - MSDN

Microsoft STI makes use of several registry entries, some of which can be modified by vendor-supplied components.

http://msdn.microsoft.com/en-us/library/ff547024

CFileFind Class (MFC)

Performs local file searches and is the base class for CGopherFileFind and CFtpFileFind, which perform Internet file searches. CFileFind includes member functions that begin a search, locate a file, and return the title, name, or path of the file. For Internet searches, the member function GetFileURL returns the file's URL. CFileFind is the base class for two other MFC classes designed to search particular server types: CGopherFileFind works specifically with gopher servers, and CFtpFileFind works specifically with FTP servers. Together, these three classes provide a seamless mechanism for the client to find files, regardless of the server protocol, the file type, or location, on either a local machine or a remote server. The following code will enumerate all the files in the current directory, printing the name of each file.

http://msdn.microsoft.com/en-us/library/f33e1618

LocalSystem Account (Windows) - MSDN

The LocalSystem account is a predefined local account used by the service control manager. This account is not recognized by the security subsystem, so you cannot specify its name in a call to the LookupAccountName function. It has extensive privileges on the local computer, and acts as the computer on the network. Its token includes the NT AUTHORITY\SYSTEM and BUILTIN\Administrators SIDs; these accounts have access to most system objects. The name of the account in all locales is .\LocalSystem. The name, LocalSystem or ComputerName\LocalSystem can also be used. This account does not have a password. If you specify the LocalSystem account in a call to the CreateService or ChangeServiceConfig function, any password information you provide is ignored. A service that runs in the context of the LocalSystem account inherits the security context of the SCM. The user SID is created from the SECURITY_LOCAL_SYSTEM_RID value. The account is not associated with any logged-on user account.

http://msdn.microsoft.com/en-us/library/ms684190

CString - MSDN

A CString object consists of a variable-length sequence of characters. CString provides methods and operators using a syntax similar to that of Basic. Concatenation and comparison operators, together with simplified memory management, make CString objects easier to use than ordinary character arrays. CString does not have a base class. CString objects also have the following characteristics: • CString objects can grow as a result of concatenation operations. • CString objects follow, value semantics. Think of a CString object as an actual string, not as a pointer to a string. • You can freely substitute CString objects for const char* and LPCTSTR function arguments. • A conversion operator gives direct access to the characters of the string as a read-only array of characters (a C-style string).

http://msdn.microsoft.com/en-us/library/ms908299

Using CString (ATL-MFC) - MSDN

The topics in this section describe programming by using CString. CString, CStringA, and CStringW are Microsoft-specific string classes that are available for general C++ development. A CStringA object contains string data that is based on the char type, and supports single-byte and multibyte (MBCS) strings. Similarly, a CStringW object contains string data that is based on the wchar_t type, and supports Unicode strings. A CString object supports either the char type or the wchar_t type. Which one it supports depends on which one of the symbols, MBCS or UNICODE, is defined at compile time. A CString object keeps character data in a CStringData object. CString accepts null-terminated C-style strings, but does not retain the null character in the stored character data. Instead, CString tracks string length. CString does provide a null terminator when it exports a C-style string. You can insert a null character amidst stored character data, but it may produce unexpected results.

http://msdn.microsoft.com/en-us/library/ms174288

INF Files for Still Image Devices (Windows Driver Kit) - MSDN

The default class installer for still image devices, sti_ci.dll, recognizes a special set of INF file entries. Within an INF file, these entries must be placed within a device's INF DDInstall Section. The entries are described in the following table.

http://msdn.microsoft.com/en-us/library/ff542762

Changing Environment Variables (Windows) - MSDN

Each process has an environment block associated with it. The environment block consists of a null-terminated block of null-terminated strings (meaning there are two null bytes at the end of the block), where each string is in the form: name=value. All strings in the environment block must be sorted alphabetically by name. The sort is case-insensitive, Unicode order, without regard to locale. Because the equal sign is a separator, it must not be used in the name of an environment variable.

http://msdn.microsoft.com/en-us/library/ms682009

strchr, wcschr, _mbschr, _mbschr_l (CRT) - MSDN

Find a character in a string, using the current locale or a specified LC_CTYPE conversion state category. The strchr function finds the first occurrence of c in str, or it returns NULL if c is not found. The null terminating character is included in the search. wcschr , _mbschr and _mbschr_l are wide-character and multibyte-character versions of strchr. The arguments and return value of wcschr are wide-character strings; those of _mbschr are multibyte-character strings. _mbschr recognizes multibyte-character sequences. Also, if the string is a null pointer, _mbschr invokes the invalid parameter handler, as described in Parameter Validation. If execution is allowed to continue, _mbschr returns NULL and sets errno to EINVAL. strchr and wcschr do not validate their parameters. These three functions behave identically otherwise.

http://msdn.microsoft.com/en-us/library/b34ccac3

Windows Sockets Error Codes (Windows) - MSDN

Most Windows Sockets 2 functions do not return the specific cause of an error when the function returns. For information, see the Handling Winsock Errors topic. The WSAGetLastError function returns the last error that occurred for the calling thread. When a particular Windows Sockets function indicates an error has occurred, this function should be called immediately to retrieve the extended error code for the failing function call. These error codes and a short text description associated with an error code are defined in the Winerror.h header file. The FormatMessage function can be used to obtain the message string for the returned error. For information on how to handle error codes when porting socket applications to Winsock, see Error Codes - errno, h_errno and WSAGetLastError. The following list describes the possible error codes returned by the WSAGetLastError function. Errors are listed in numerical order with the error macro name.

http://msdn.microsoft.com/en-us/library/ms740668

INF DDInstall Section (Windows Driver Kit)

Each per-Models DDInstall section contains an optional DriverVer directive and one or more directives referencing additional named sections in the INF file, shown here with the most frequently specified INF directives, CopyFiles and AddReg, listed first. The sections referenced by these directives contain instructions for installing driver files and writing any device-specific and/or driver-specific information into the registry. Throughout the Windows Driver Kit (WDK) documentation, the term DDInstall is used to refer to an install-section-name, with or without platform extensions. Therefore, "DDInstall section" means "a named section within an INF, having the format [install-section-name] or [install-section-name.ntxxx]". When you create names for DDInstall sections, you should include a device-specific prefix, such as [WDMPNPB003_Device] or [GPR400.Install.NT].

http://msdn.microsoft.com/en-us/library/ff547344

CWnd::FromHandle (MFC) - MSDN

Returns a pointer to a CWnd object when given a handle to a window. If a CWnd object is not attached to the handle, a temporary CWnd object is created and attached. Returns a pointer to a CWnd object when given a handle to a window. If a CWnd object is not attached to the handle, a temporary CWnd object is created and attached. The pointer may be temporary and should not be stored for later use.

http://msdn.microsoft.com/en-us/library/e547yfza

C/C++ Code Example: Reading Messages Asynchronously Using a Callback Function - MSDN

The following example includes two application-defined functions that can be used for asynchronously reading the messages arriving in a specified queue. The first function is the callback function invoked when a message is found or arrives at the queue within the time-out period specified or when the time-out period elapses. The second function receives the format name of the queue to be monitored and the length of the time interval for monitoring the queue from a caller in the application, and contains a call to MQReceiveMessage that specifies a callback function. For more information about reading messages asynchronously, see Asynchronous Reading. An application using these functions must include the Windows.h, Stdio.h, and Mq.h header files. This example uses two events to signal whether the callback function was invoked because a message was received or because the time-out period elapsed during a pending I/O operation. The handles to these events must be declared globally.

http://msdn.microsoft.com/en-us/library/ms699828

Processes in the Client Security Context (Windows)

A server application can call the CreateProcessAsUser function to create a new process that runs in a client's security context. When called with a client's access token, CreateProcessAsUser requires the SE_ASSIGNPRIMARYTOKEN_NAME and SE_INCREASE_QUOTA_NAME privileges, which are held by Windows services running in the LocalSystem Account. The CreateProcessAsUser function also requires a primary access token. A server can get a primary access token for a client either by starting a logon session for the client or by impersonating the client and duplicating the impersonation token. The following procedures describe two ways to create a client process.

http://msdn.microsoft.com/en-us/library/aa379308

Getting the System Version (Windows) - Win32 and COM Development | System Services | Windows System Information | System Information | Using System Information | MSDN Library - MSDN.Microsoft.com

Determining the version information of the currently running operating system. The following example uses the GetVersionEx, GetSystemMetrics, GetProductInfo, and GetNativeSystemInfo functions to determine the version information of the currently running operating system. If compatibility mode is in effect, the example displays the operating system selected for application compatibility. The example displays the information to the console.

http://msdn2.microsoft.com/en-us/library/ms724429.aspx

SHCreateDirectoryEx Function - Win32 and COM Development | User Interface | Windows Shell | Shell Reference | Shell Functions | MSDN Library - MSDN.Microsoft.com

Creates a new file system folder. This function creates a file system folder whose fully qualified path is given by pszPath. If one or more of the intermediate folders do not exist, they are created as well. SHCreateDirectoryEx also verifies that the files are visible.

http://msdn2.microsoft.com/en-us/library/ms647698.aspx

Imaging Devices Reference - MSDN - Microsoft.com

This section includes: IWiaMiniDrv Interface, WIA Driver Services Library Functions, WIA Properties, WIA Utility Library Functions and Classes, IWiaMiniDrvCallBack Interface, IWiaDrvItem Interface, IWiaLog Interface and Diagnostic Log Macros, WIA Microdriver Functions, Structures, and Commands, WIA User Interface Extensions, WIA Structures, Still Image Interfaces.

http://msdn2.microsoft.com/en-us/library/ms794466.aspx

Windows Image Acquisition Drivers

The Microsoft Windows Image Acquisition (WIA) programming interface is a Still Image (STI) architecture for the Microsoft Windows Me, Windows XP, and later platforms. This documentation explains how to develop a WIA driver that supports communication to imaging devices such as digital cameras and scanners.

http://msdn2.microsoft.com/en-us/library/ms792201.aspx

Anatomy and Characteristics of a Window - Win32 Tutorial - FunctionX.com

For the user to use an application, it must display the window that can be located on the screen. A window is primarily distinguishable from the rest of the screen by its being surrounded by borders. To create a window that has borders, add the WS_BORDER flag to the dwStyle of the CreateWindow() or the CreateWindowEx() functions.

http://www.functionx.com/win32/Lesson07.htm

A light-weighted client-server socket class in C++ - Internet & Network | The Code Project - CodeProject.com

A multi-platform client/server socket in C++. A generic, light-weighted client/server socket class that is written in C++ is presented here, together with a mini-messenger that is constructed by using this class. There is indeed a vast amount of information about socket programming over the Internet, and it is not time-consuming for one to download relevant code directly, therefore, it is certainly necessary to discuss the advantage of this class first.

http://www.codeproject.com/internet/client_server_socket.asp

Programming Windows TCP Sockets in C++ for the Beginners - Internet / Network | The Code Project - CodeProject.com

Helps programmers new to Winsock start programming TCP sockets in C++.

http://www.codeproject.com/internet/beginningtcp_cpp.asp

Creating a Basic Winsock Application (Windows) - MSDN - Microsoft.com

Begin programming the Winsock application. Use the Winsock API by including the Winsock 2 header files. The Winsock2.h header file contains most of the Winsock functions, structures, and definitions. The Ws2tcpip.h header file contains definitions introduced in the WinSock 2 Protocol-Specific Annex document for TCP/IP that includes newer functions and structures used to retrieve IP addresses.

http://msdn.microsoft.com/en-us/library/ms737629.aspx

IP Helper Functions (Windows) - MSDN - Microsoft.com

The following functions retrieve and modify configuration settings for the TCP/IP transport on the local computer. The following categorical listing can help determine which collection of functions is best suited for a given task.

http://msdn.microsoft.com/en-us/library/aa366071.aspx

SlickEdit

Powerful text editor

https://www.slickedit.com/

Windows API - WndProc - Toymaker.info

The WndProc is the function you write to receive all input directed at your window. You will have already told Windows to call this function with messages by supplying a pointer to this function in the class structure (it is a callback function). Advanced Note: because we supplied a pointer to a function to Windows the function cannot be a class member function unless it is defined as static, this is why the C code required by the Windows API is somewhat clumsy to use with object oriented programming.

http://www.toymaker.info/Games/html/wndproc.html

Windows API - Advanced Issues - Toymaker.info

There is much more you can do with the Windows API than simply display a window. You can create menus and dialogs using the resource editor and draw graphics using the GDI commands. I have written just a few notes below for those who wish to explore these areas further: GDI - Drawing pixels, lines, text, filled shapes etc., Resources - Creating and displaying dialogs and menus, Playing a sound - playing a .wav file is easy using the Windows API.

http://www.toymaker.info/Games/html/advanced.html

Windows Imaging Architecture - WIA

Windows Image Acquisition (WIA) architecture includes various components provided by the ISV, the IHV, and Microsoft, as shown in the following illustration.

http://www.microsoft.com/whdc/device/stillimage/WIA-arch.mspx

TWAIN.org - Standard for image acquisition devices.

The TWAIN Working Group is a not-for-profit organization which represents the imaging industry. TWAIN’s purpose is to provide and foster a universal public standard which links applications and image acquisition devices. The ongoing mission of this organization is to continue to enhance the standard to accommodate future technologies.

http://www.twain.org/

Windows Imaging Component

Still image peripherals include digital cameras and scanning devices such as sheet-fed, flatbed, handheld, and film scanners. All imaging peripherals should use USB or IEEE 1394 to connect to PC systems. Windows driver support is provided under Windows Image Acquisition (WIA). WIA is both an application programming interface (API) and a device driver interface (DDI). WIA supports still digital cameras and scanners. It allows retrieving still images from IEEE 1394-based digital video (DV) camcorders and USB-based "web cams."

http://www.microsoft.com/whdc/device/stillimage/default.mspx

Migrating TWAIN drivers to WIA - Device Fundamentals | Imaging - Microsoft.com

This paper provides information about Microsoft Windows Image Acquisition (WIA) architecture and the process a developer can follow to port a Still Image Architecture (STI)-compliant TWAIN data source to a WIA driver for the Microsoft Windows family of operating systems. The paper also provides guidelines for TWAIN developers to implement WIA for existing TWAIN drivers. Microsoft Word file: http://download.microsoft.com/download/5/7/7/577a5684-8a83-43ae-9272-ff260a9c20e2/Migrating TWAIN drivers to WIA.doc

http://www.microsoft.com/whdc/device/stillimage/TWAIN-port.mspx

Meandering Through theMaze of MFC Message and Command Routing - by Paul DiLascia | Microsoft Systems Journal (MSJ) July 1995 - Microsoft.com

If you've ever written even a simple program using Visual C++™ and MFC, you're familiar with messages and commands. You know that MFC uses something called "message maps" to route Windows® messages to your virtual functions. But being familiar with something is not the same as understanding it. How does it all work? And what if you ever want to do something unusual? Paul DiLascia is a freelance software consultant specializing in developing C++ applications for Windows. He is the author of Windows++: Writing Reusable Code in C++ (Addison-Wesley, 1992).

http://www.microsoft.com/msj/0795/dilascia/dilascia.aspx

How to add tooltips for controls to an MFC modal dialog box - Support - Microsoft.com

To make the CToolTipCtrl class work correctly, you must call the CToolTipCtrl::RelayEvent function. When you use this function, the mouse messages can be passed to the tooltip control. For a non-modal dialog box window in an MFC application, use the window's CWnd::PreTranslateMessage function to call the CToolTipsCtrl::RelayEvent function. However, for a modal dialog box in MFC versions earlier than version 4.0, the CDialog::PreTranslateMessage function is not called because modal dialog boxes have their own message loops. In MFC 4.0 and later versions, this is not a problem because of changes to the implementation of DoModal. Therefore, to use the CToolTipCtrl class in a modal dialog box, you must use a different approach for versions earlier than 4.0. This article gives you step-by-step examples that show you how to use the CToolTipCtrl class in an MFC modal dialog box for MFC 4.0 and earlier versions.

http://support.microsoft.com/Default.aspx?kbid=141758