Click here to Skip to main content
13,357,973 members (59,767 online)
Click here to Skip to main content
Add your own
alternative version


31 bookmarked
Posted 26 Jun 2009

Introduction to ResEdit

, 26 Jun 2009
Rate this:
Please Sign up or sign in to vote.
An quick introduction to ResEdit resource editor


This article in an introduction to a resource editor named ResEdit. It explains how to create a resource script with ResEdit and then how to use it in Visual Studio.

First you will need to download ResEdit from here.

Create a Script with ResEdit

Launch ResEdit.exe:

Insert a dialog

The first step is to create a new project in ResEdit. Click on "File>New Project" (or Ctrl-N), and choose a file to save to project.

Insert a dialog

Then you can create new resources. In this example, we will create an dialog box displaying an icon image. To insert a dialog box resource, right-click on the resource tree and select "Add resource>Dialog" (you can also use the Ctrl-D shortcut). A new dialog named IDD_DIALOG1 is created.

Insert a dialog

If you click in the toolbar button, you will see IDD_DIALOG is a symbolic indentifier for 100. You can change this value of the symbol by clicking on the "Modify" button.

Insert a dialog

Now, let's insert some controls in the dialog box. The Toolbox panel displays all the control types you can insert in a dialog box. For example we can insert a "Static text" control to display some text. Click on the "Static text" control in the toolbox, and make a selection in the dialog box. The static text has been created.

You can change the text value in the "Caption" property

Insert a dialog

Now, we are going to create an icon to display it in the dialog box. Right-click on the resource tree and select "Add resource>Icon". A dialog box asks you if you want to use an existing file, or create a new icon. Select "Create a new resource".

Insert a dialog

A new empty icon is created (a .ico file is created in your file system). A 32x32 pixel 32-bit image format is automatically added.

Insert a dialog

The icon editor is quite basic for now, you can only use a pen to draw something. Then, right click on the icon editor tab header and click on save to save your modifications in the .ico file.

Insert a dialog

Now we are going to display the icon we just created in the dialog box. Select the dialog box tab, select "Picture control" in the toolbox and create a control in the dialog. An empty picture is added in the dialog box. Now change the control type to "Icon" in the property panel. Then the "Image" property should be enabled. You can now select the icon you created in the "Image" property.

Insert a dialog

To have visual effects enabled in the program, we need to insert a manifest resource. Right click on the resource tree and select "Add resource>Manifest", and accept the default manifest file.

Insert a dialog

Now click on "File>Save" to save the resource script.

Using the Script with Visual Studio 2008

This parts explains how to use the script you created in the first part in a Visual Studio project. In this tutorial, I'm using Visual Studio 2008 but you can use an older version of Visual Studio either.

At the beginning, we have a simple Win32 project with a one source file which defines the WinMain function. Right-click on the project and select "Add>Existing item".

Insert a dialog - Click to enlarge image

Then choose the files your created with ResEdit (only the .rc file and resource.h).

In the main source file, you have to include "resource.h" to be able to use all symbol definitions. The following code will display the dialog box defined in the resource script.

#define _WIN32_WINNT 0x0600
#define _WIN32_IE 0x0700
#include <windows.h>
#include "resource.h"

#pragma comment(lib, "comctl32.lib")

    SetClassLongPtr(hDlg, GCLP_HICON, (long)LoadIcon(0, IDI_APPLICATION));
    return 1;
  case WM_COMMAND:
    case IDOK:
      return 0;
    case IDCANCEL:
      EndDialog(hDlg, 0);
  return 0;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
				LPSTR lpCmdLine, int nCmdShow)
  DialogBoxParam(hInstance, (LPCTSTR)IDD_DIALOG1, 0, AppDlgProc, 0);
  return 0;
Insert a dialog - Click to enlarge image


  • 26th July, 2009: Initial post


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


About the Author

France France
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionIntegration with VC++ 2010 Express Pin
luckiejacky745696910-Jan-14 17:26
memberluckiejacky745696910-Jan-14 17:26 
GeneralMy vote of 3 Pin
buyong9-Oct-11 22:35
memberbuyong9-Oct-11 22:35 
GeneralDo you plan to open source of this realy great program? (-) Pin
alglib2-Feb-10 23:56
memberalglib2-Feb-10 23:56 
GeneralRe: Do you plan to open source of this realy great program? (-) Pin
llothar9-Jul-15 8:17
memberllothar9-Jul-15 8:17 
GeneralResEdit generates DIALOG instead of DIALOGEX Pin
ilhando9-Jul-09 7:40
memberilhando9-Jul-09 7:40 
GeneralRe: ResEdit generates DIALOG instead of DIALOGEX Pin
resedit9-Jul-09 9:43
memberresedit9-Jul-09 9:43 
GeneralRe: ResEdit generates DIALOG instead of DIALOGEX Pin
ilhando10-Jul-09 3:14
memberilhando10-Jul-09 3:14 
GeneralPardon my ignorance... Pin
Matthew Page1-Jul-09 8:24
memberMatthew Page1-Jul-09 8:24 
GeneralRe: Pardon my ignorance... Pin
resedit1-Jul-09 9:48
memberresedit1-Jul-09 9:48 
GeneralResEdit with VC 2008 Pin
MeriInssi30-Jun-09 12:21
memberMeriInssi30-Jun-09 12:21 
I tried ResEdit some while ago, but I had problemns with VC++ 2008. Either the include files did not match or then there was something strange in those new include files (2008 versions). ResEdit typically failed??!!
GeneralRe: ResEdit with VC 2008 Pin
resedit30-Jun-09 12:25
memberresedit30-Jun-09 12:25 
GeneralRe: ResEdit with VC 2008 Pin
MeriInssi2-Jul-09 13:00
memberMeriInssi2-Jul-09 13:00 
GeneralBug in ResEdit Pin
T800G30-Jun-09 7:00
memberT800G30-Jun-09 7:00 
GeneralRe: Bug in ResEdit Pin
resedit30-Jun-09 10:06
memberresedit30-Jun-09 10:06 
AnswerRe: Bug in ResEdit [modified] Pin
resedit30-Jun-09 11:00
memberresedit30-Jun-09 11:00 
AnswerRe: Bug in ResEdit Pin
T800G1-Jul-09 5:35
memberT800G1-Jul-09 5:35 
GeneralRe: Bug in ResEdit Pin
cnhnyu11-Nov-09 22:16
membercnhnyu11-Nov-09 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 26 Jun 2009
Article Copyright 2009 by resedit
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid