Click here to Skip to main content
15,891,704 members
Articles / Desktop Programming / WTL

How To Create a Self-Restartable Application

Rate me:
Please Sign up or sign in to vote.
4.71/5 (29 votes)
21 Aug 2006CPOL3 min read 112.7K   4.6K   122  
This article describes the way to add restarting support to your Win32 applications.
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#pragma once

// Change these values to use different versions
#ifndef WINVER				// Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0500		// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501	// Change this to the appropriate value to target Windows 2000 or later.
#endif						

#ifndef _WIN32_IE			// Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0500	// Change this to the appropriate value to target IE 5.0 or later.
#endif

#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _WTL_NO_UNION_CLASSES
#define _WTL_NO_WTYPES
#define _WTL_NO_CSTRING
// Correct property page notifications
#define _WTL_NEW_PAGE_NOTIFY_HANDLERS

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

// turns off ATL's hiding of some common and often safely ignored warning messages
#define _ATL_ALL_WARNINGS

#include <atlbase.h>
using namespace ATL;
#include <atlstr.h>
#include <atlapp.h>
#include <atlcoll.h>
#include <atlsync.h>

extern CAppModule _Module;

#include <atlwin.h>

#include <atlmisc.h>
#include <atlcrack.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>


#include "RestartAPI.h"

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions