1. Bu site çerez kullanmaktadır. Siteyi kullanmaya devam etmeniz halinde çerez kullanımı ile ilgili site koşullarını kabul etmiş sayılırsınız. Daha Fazlasını Öğren.
  2. Forum İllegal Uyarısı Forum kuralları gereği forumda video ve illagal paylaşım yapmak yasaktır.Program Arşivimizde ise kısıtlanmış sürüm yada dağıtımı serbest olan (trial - freeware) yazılımlar yayınlayınız..Aksi takdirde mesajlarınız silinecektir..

Introduction to ResEdit

Konusu 'Görsel ve Resimli Anlatımlar' forumundadır ve guclusat tarafından 28 Ocak 2013 başlatılmıştır.

  1. guclusat
    Offline

    guclusat Tanınmış Üye Süper Moderatör

    Katılım:
    14 Haziran 2009
    Mesajlar:
    9.756
    Ödül Puanları:
    48
    Introduction

    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:
    [​IMG]
    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.
    [​IMG]
    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.
    [​IMG]
    If you click in the [​IMG] 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.
    [​IMG]
    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
    [​IMG]
    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".
    [​IMG]
    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.
    [​IMG]
    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.
    [​IMG]
    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.
    [​IMG]
    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.
    [​IMG]
    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".
    [​IMG]
    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.

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

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

    BOOL CALLBACK AppDlgProc(HWND hDlgUINT uMsgWPARAM wParamLPARAM lParam)
    {
      switch(
    uMsg)
      {
      case 
    WM_INITDIALOG:
        
    SetClassLongPtr(hDlgGCLP_HICON, (long)LoadIcon(0IDI_APPLICATION));
        return 
    1;
      case 
    WM_COMMAND:
        switch(
    wParam)
        {
        case 
    IDOK:
          return 
    0;
        case 
    IDCANCEL:
          
    EndDialog(hDlg0);
        }
      }
      return 
    0;
    }

    int WINAPI WinMain(HINSTANCE hInstanceHINSTANCE hPrevInstance
        
    LPSTR lpCmdLineint nCmdShow)
    {
      
    InitCommonControls();
      
    DialogBoxParam(hInstance, (LPCTSTR)IDD_DIALOG10AppDlgProc0);
      return 
    0;
    }
    [​IMG]
     

Sayfayı Paylaş