Code Example

The source code that follows the sample form image, is automatically generated from the DFM file only.

SDK converted form




//------------------------------------
// CPP
//------------------------------------
//VCL Form Converter, by Luigi Bianchi (Copyright, 2000-2013)
 
 
#include <windows.h>
 
#include <commctrl.h>
#include <windows.h>
#include <windowsx.h>
#include <winuser.h>

 
#include "MoreCode.cpp"
 
#ifndef ZeroMemory
   #define ZeroMemory(x, y) setmem(x, y, 0)
#endif
 
#ifdef UNICODE
   #define STRCAT(x, y) wcscat(x, y)
#else
   #define STRCAT(x, y) strcat(x, y)
#endif
 
#include "MainForm.hpp"
 
HMODULE hMod = GetModuleHandle(0);
 
//{{Implementation}}
// ---------------------------
// ---------------------------
//   
// ---------------------------
// ---------------------------
 
 
//BEFORE_DIALOG_PROC
 
 
BOOL CALLBACK TTranslateFormNameDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
//INSIDE_DIALOG_PROC
   static HIMAGELIST hilImageList1;
   static HWND hCtlLabel1;
   static HWND hCtlSpeedButton1;
   static HBITMAP hBmpSpeedButton1 = 0;
   static HWND hCtlBevel1;
   static HWND hCtlBevel2;
   static HWND hCtlBevel3;
   static HWND hCtlBevel4;
   static HWND hCtlBevel5;
   static HWND hCtlBevel6;
   static HWND hCtlBevel7;
   static HWND hCtlBevel8;
   static HWND hCtlBevel9;
   static HWND hCtlBevel10;
   static HWND hCtlBevel11;
   static HWND hCtlBevel12;
   static HWND hCtlBevel13;
   static HWND hCtlBevel14;
   static HWND hCtlBevel15;
   static HWND hCtlBevel16;
   static HWND hCtlStatusBar1;
   static HWND hCtlHeaderControl1;
   static HWND hCtlAnimate1;
   static HBITMAP hBmpImage1ST;
   static HBITMAP hBmpImageNST;
   static HWND hCtlBitBtn1;
   static HWND hCtlBitBtn2;
   static HWND hCtlCheckBox1;
   static HWND hCtlRadioButton1;
   static HWND hCtlListBox1;
   static HWND hCtlComboBox1;
   static HWND hCtlGroupBox1;
   static HWND hCtlTreeView1;
   static HWND hCtlListView1;
   static HWND hCtlRichEdit1;
   static HWND hCtlScrollBar1;
   static HWND hCtlScrollBar2;
   static HWND hCtlEdit2;
   static HWND hCtlEdit3;
   static HWND hCtlTabControl1;
   static HWND hCtlTrackBar1;
   static HWND hCtlMonthCalendar1;
   static HWND hCtlDateTimePicker1;
   static HWND hCtlRadioGroup1;
   static HWND hCtlProgressBar1;
   static HWND hCtlPanel1;
   static HWND hCtlCheckBox2;
   static HWND hCtlCheckBox3;
   static HWND hCtlRadioButton2;
   static HWND hCtlRadioButton3;
   static HWND hCtlCheckBox4;
   static HWND hCtlTabControl2;
   static HWND hCtlMemo3;
   static HWND hCtlProgressBar2;
   static HWND hCtlCSpinEdit1;
   static HWND hCtlTabControl3;
   static HWND hCtlEdit4;
   static HWND hCtlUpDown1;
   static HWND hCtlButton1;
   static HWND hCtlButton2;
   static HWND hCtlPanel2;
   static HWND hCtlButton3;
 
 
   switch (uMsg)
   {
//INSIDE_SWITCH_MESSAGE
      case WM_COMMAND:
      {
         WORD dwCtrlId = LOWORD(wParam);
         WORD dwHi = HIWORD(wParam);
         switch (dwCtrlId)
         {
//INSIDE_WM_COMMAND
            case IDC_SPEEDBUTTON1:
            {
            }
            break;
 
            case IDOK:
            {
            }
            break;
 
            case IDCANCEL:
            {
            }
            break;
 
            case IDC_CHECKBOX1:
            {
            }
            break;
 
            case IDC_RADIOBUTTON1:
            {
            }
            break;
 
            case IDC_CHECKBOX2:
            {
            }
            break;
 
            case IDC_CHECKBOX3:
            {
            }
            break;
 
            case IDC_RADIOBUTTON2:
            {
            }
            break;
 
            case IDC_RADIOBUTTON3:
            {
            }
            break;
 
            case IDC_CHECKBOX4:
            {
            }
            break;
 
            case IDC_BUTTON1:
            {
            }
            break;
 
            case IDC_BUTTON2:
            {
            }
            break;
 
            case IDC_BUTTON3:
            {
            }
            break;
 
            case IDC_SUBITEM11:
            {
            //    IDC_SUBITEM11
            }
            break;
 
            case IDC_PIPPO1:
            {
            //    IDC_PIPPO1
            }
            break;
 
            case IDC_CIAO131:
            {
            //    IDC_CIAO131
            }
            break;
 
            case IDC_CIAO141:
            {
            //    IDC_CIAO141
            }
            break;
 
            case IDC_N11:
            {
            //    IDC_N11
            }
            break;
 
            case IDC_CIAO211:
            {
            //    IDC_CIAO211
            }
            break;
 
            case IDC_MENU221:
            {
            //    IDC_MENU221
            }
            break;
 
            case IDC_CIAO311:
            {
            //    IDC_CIAO311
            }
            break;
 
            case IDC_CIAO321:
            {
            //    IDC_CIAO321
            }
            break;
 
            case IDC_CIAO331:
            {
            //    IDC_CIAO331
            }
            break;
 
            case IDC_CIAO341:
            {
            //    IDC_CIAO341
            }
            break;
 
         }
         if (dwCtrlId && (dwCtrlId < IDCLOSE))
         EndDialog(hWnd, dwCtrlId);
      }
      break;//WM_COMMAND
 
      case WM_INITDIALOG:
      {
//INSIDE_WM_INITDIALOG
         hilImageList1 = ImageList_Create(16, 16, ILC_COLOR, 0, 4);
         HBITMAP hbmpImageList1;
         hbmpImageList1 = LoadBitmap(hMod, MAKEINTRESOURCE(IDC_IMAGELIST1_BMP_0));
         ImageList_Add(hilImageList1, hbmpImageList1, NULL);
         hbmpImageList1 = LoadBitmap(hMod, MAKEINTRESOURCE(IDC_IMAGELIST1_BMP_1));
         ImageList_Add(hilImageList1, hbmpImageList1, NULL);
         hbmpImageList1 = LoadBitmap(hMod, MAKEINTRESOURCE(IDC_IMAGELIST1_BMP_2));
         ImageList_Add(hilImageList1, hbmpImageList1, NULL);
         hbmpImageList1 = LoadBitmap(hMod, MAKEINTRESOURCE(IDC_IMAGELIST1_BMP_3));
         ImageList_Add(hilImageList1, hbmpImageList1, NULL);
         hbmpImageList1 = LoadBitmap(hMod, MAKEINTRESOURCE(IDC_IMAGELIST1_BMP_4));
         ImageList_Add(hilImageList1, hbmpImageList1, NULL);

         hCtlLabel1 = GetDlgItem(hWnd, IDC_LABEL1);   //Label1

         hCtlSpeedButton1 = GetDlgItem(hWnd, IDC_SPEEDBUTTON1);   //SpeedButton1
         hBmpSpeedButton1 = LoadMappedBitmap(hMod, IDC_SPEEDBUTTON1);
         SendMessage(hCtlSpeedButton1, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hBmpSpeedButton1);
 

         hCtlBevel1 = GetDlgItem(hWnd, IDC_BEVEL1);   //Bevel1

         hCtlBevel2 = GetDlgItem(hWnd, IDC_BEVEL2);   //Bevel2

         hCtlBevel3 = GetDlgItem(hWnd, IDC_BEVEL3);   //Bevel3

         hCtlBevel4 = GetDlgItem(hWnd, IDC_BEVEL4);   //Bevel4

         hCtlBevel5 = GetDlgItem(hWnd, IDC_BEVEL5);   //Bevel5

         hCtlBevel6 = GetDlgItem(hWnd, IDC_BEVEL6);   //Bevel6

         hCtlBevel7 = GetDlgItem(hWnd, IDC_BEVEL7);   //Bevel7

         hCtlBevel8 = GetDlgItem(hWnd, IDC_BEVEL8);   //Bevel8

         hCtlBevel9 = GetDlgItem(hWnd, IDC_BEVEL9);   //Bevel9

         hCtlBevel10 = GetDlgItem(hWnd, IDC_BEVEL10);   //Bevel10

         hCtlBevel11 = GetDlgItem(hWnd, IDC_BEVEL11);   //Bevel11

         hCtlBevel12 = GetDlgItem(hWnd, IDC_BEVEL12);   //Bevel12

         hCtlBevel13 = GetDlgItem(hWnd, IDC_BEVEL13);   //Bevel13

         hCtlBevel14 = GetDlgItem(hWnd, IDC_BEVEL14);   //Bevel14

         hCtlBevel15 = GetDlgItem(hWnd, IDC_BEVEL15);   //Bevel15

         hCtlBevel16 = GetDlgItem(hWnd, IDC_BEVEL16);   //Bevel16

         hCtlStatusBar1 = GetDlgItem(hWnd, IDC_STATUSBAR1);   //StatusBar1
         {
            int nStatusBar1_Parts[3]; 
            int size = 0;
            size += 50;
            nStatusBar1_Parts[0] = size;
            size += 200;
            nStatusBar1_Parts[1] = size;
            size += 150;
            nStatusBar1_Parts[2] = size;
            SendMessage(hCtlStatusBar1, SB_SETPARTS, 3, (LPARAM)nStatusBar1_Parts);
            SendMessage(hCtlStatusBar1, SB_SETTEXT, 0, (LPARAM)(LPCSTR)TEXT("Panel 1"));
            SendMessage(hCtlStatusBar1, SB_SETTEXT, 1, (LPARAM)(LPCSTR)TEXT("Panel 2"));
            SendMessage(hCtlStatusBar1, SB_SETTEXT, 2, (LPARAM)(LPCSTR)TEXT("Panel 3"));
         }
         SendMessage(hCtlStatusBar1, SB_SIMPLE, 0, 0); 

         hCtlHeaderControl1 = GetDlgItem(hWnd, IDC_HEADERCONTROL1);   //HeaderControl1
         {
            HDITEM hCtlHeaderControl1Item;
            ZeroMemory(&hCtlHeaderControl1Item, sizeof(HDITEM));
            hCtlHeaderControl1Item.mask = HDI_FORMAT | HDI_TEXT | HDI_WIDTH;
 
            hCtlHeaderControl1Item.cxy = 80;
            hCtlHeaderControl1Item.pszText = TEXT("Section 1");
            Header_InsertItem(hCtlHeaderControl1, 0, &hCtlHeaderControl1Item);
 
            hCtlHeaderControl1Item.cxy = 73;
            hCtlHeaderControl1Item.pszText = TEXT("Section 2");
            Header_InsertItem(hCtlHeaderControl1, 1, &hCtlHeaderControl1Item);
         }

         hCtlAnimate1 = GetDlgItem(hWnd, IDC_ANIMATE1);   //Animate1
         if (Animate_OpenEx(hCtlAnimate1, hMod, IDC_ANIMATE1))
            Animate_Play(hCtlAnimate1, 0, -1, -1);
 
         hBmpImage1ST = LoadMappedBitmap(hMod, IDC_IMAGE1ST);
         hBmpImageNST = LoadMappedBitmap(hMod, IDC_IMAGENST);

         hCtlBitBtn1 = GetDlgItem(hWnd, IDOK);   //BitBtn1

         hCtlBitBtn2 = GetDlgItem(hWnd, IDCANCEL);   //BitBtn2

         hCtlCheckBox1 = GetDlgItem(hWnd, IDC_CHECKBOX1);   //CheckBox1

         hCtlRadioButton1 = GetDlgItem(hWnd, IDC_RADIOBUTTON1);   //RadioButton1

         hCtlListBox1 = GetDlgItem(hWnd, IDC_LISTBOX1);   //ListBox1
         {
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 0"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 1"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 2"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 3"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 4"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 5"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 6"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 7"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 8"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 9"));
            ListBox_AddString(hCtlListBox1, TEXT("ListBox Item 10"));
         }

         hCtlComboBox1 = GetDlgItem(hWnd, IDC_COMBOBOX1);   //ComboBox1
         {
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 0"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 1"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 2"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 3"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 4"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 5"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 6"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 7"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 8"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 9"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 10"));
            ComboBox_AddString(hCtlComboBox1, TEXT("ComboBox Item 11"));
            ComboBox_SetCurSel(hCtlComboBox1, 1);
         }

         hCtlGroupBox1 = GetDlgItem(hWnd, IDC_GROUPBOX1);   //GroupBox1

         hCtlTreeView1 = GetDlgItem(hWnd, IDC_TREEVIEW1);   //TreeView1
         {
            HTREEITEM hCtlTreeView1TreeItemPrev = (HTREEITEM)TVI_FIRST;
            HTREEITEM hCtlTreeView1TreeItemPrevRootItem = NULL;
            HTREEITEM hCtlTreeView1TreeItemPrevLev2Item = NULL;
            TV_INSERTSTRUCT hCtlTreeView1InsertStruct;
            ZeroMemory(&hCtlTreeView1InsertStruct, sizeof(TV_INSERTSTRUCT));
            hCtlTreeView1InsertStruct.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
 

           hCtlTreeView1InsertStruct.item.pszText = TEXT("item1");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = TVI_ROOT; //0

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevRootItem = hCtlTreeView1TreeItemPrev;
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si11");
           hCtlTreeView1InsertStruct.item.iImage = 1;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevRootItem;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevLev2Item = hCtlTreeView1TreeItemPrev;
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si12");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevRootItem;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevLev2Item = hCtlTreeView1TreeItemPrev;
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si121");
           hCtlTreeView1InsertStruct.item.iImage = 2;
           hCtlTreeView1InsertStruct.item.state = 2;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevLev2Item;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si122");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevLev2Item;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si1221");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevLev2Item;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si13");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevRootItem;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevLev2Item = hCtlTreeView1TreeItemPrev;
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("item2");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = TVI_ROOT; //0

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevRootItem = hCtlTreeView1TreeItemPrev;
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si21");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevRootItem;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevLev2Item = hCtlTreeView1TreeItemPrev;
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si22");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevRootItem;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevLev2Item = hCtlTreeView1TreeItemPrev;
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si221");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevLev2Item;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si222");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevLev2Item;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);
 
           hCtlTreeView1InsertStruct.item.pszText = TEXT("si23");
           hCtlTreeView1InsertStruct.item.iImage = 0;
           hCtlTreeView1InsertStruct.item.state = -1;
           hCtlTreeView1InsertStruct.hParent = hCtlTreeView1TreeItemPrevRootItem;

           hCtlTreeView1TreeItemPrev = TreeView_InsertItem(hCtlTreeView1, &hCtlTreeView1InsertStruct);

           hCtlTreeView1TreeItemPrevLev2Item = hCtlTreeView1TreeItemPrev;
 

           TreeView_SetImageList(hCtlTreeView1, hilImageList1, TVSIL_NORMAL);
         }

         hCtlListView1 = GetDlgItem(hWnd, IDC_LISTVIEW1);   //ListView1
         {

           LVCOLUMN hCtlListView1Col;

           ZeroMemory(&hCtlListView1Col, sizeof(LVCOLUMN));

           hCtlListView1Col.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
 

           DWORD ex_style = ListView_GetExtendedListViewStyle(hCtlListView1);

           ListView_SetExtendedListViewStyle(hCtlListView1, ex_style | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
 

           hCtlListView1Col.pszText = TEXT("Column 1");

           hCtlListView1Col.cx = 100;

           ListView_InsertColumn(hCtlListView1, 0, &hCtlListView1Col);
 

           hCtlListView1Col.pszText = TEXT("Column 2");

           hCtlListView1Col.cx = 100;

           ListView_InsertColumn(hCtlListView1, 1, &hCtlListView1Col);

           ListView_SetImageList(hCtlListView1, hilImageList1, LVSIL_SMALL);
 

           ListView_SetImageList(hCtlListView1, hilImageList1, LVSIL_NORMAL);
 

           LVITEM lvihCtlListView1;

           ZeroMemory(&lvihCtlListView1, sizeof(LVITEM));
           lvihCtlListView1.mask = LVIF_IMAGE | LVIF_TEXT;
 
           lvihCtlListView1.iItem = 0;
           lvihCtlListView1.iImage = 0;
           lvihCtlListView1.pszText = TEXT("1");

           ListView_InsertItem(hCtlListView1, &lvihCtlListView1);
 
           lvihCtlListView1.iItem = 1;
           lvihCtlListView1.iImage = 1;
           lvihCtlListView1.pszText = TEXT("2");

           ListView_InsertItem(hCtlListView1, &lvihCtlListView1);
 
           lvihCtlListView1.iItem = 2;
           lvihCtlListView1.iImage = 2;
           lvihCtlListView1.pszText = TEXT("3");

           ListView_InsertItem(hCtlListView1, &lvihCtlListView1);
 
           lvihCtlListView1.iItem = 3;
           lvihCtlListView1.iImage = 3;
           lvihCtlListView1.pszText = TEXT("4");

           ListView_InsertItem(hCtlListView1, &lvihCtlListView1);
         }

         hCtlRichEdit1 = GetDlgItem(hWnd, IDC_RICHEDIT1);   //RichEdit1
         {

           TCHAR *sz_tmp = TEXT(\

           "RichEdit1\r\n"\

           "Line1\r\n"\

           "Line2\r\n"\

           "Line3\r\n"\

           "Line4\r\n"\

           "Line5\r\n"\

           "Line6\r\n"\

           "Line7\r\n"\

           "Line8\r\n"\

           "Line9\r\n"\

           "Line10\r\n"\

           "....\r\n"\

           "Line100\r\n"\

           "....\r\n"\

           "Line1000\r\n"\

           " \r\n"\

           );
         SendMessage(hCtlRichEdit1, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) sz_tmp);
         }

         hCtlScrollBar1 = GetDlgItem(hWnd, IDC_SCROLLBAR1);   //ScrollBar1
         SendMessage(hCtlScrollBar1, SBM_SETRANGE, 0, 100);
         SendMessage(hCtlScrollBar1, SBM_SETPOS, 0, TRUE);

         hCtlScrollBar2 = GetDlgItem(hWnd, IDC_SCROLLBAR2);   //ScrollBar2
         SendMessage(hCtlScrollBar2, SBM_SETRANGE, 0, 100);
         SendMessage(hCtlScrollBar2, SBM_SETPOS, 20, TRUE);

         hCtlEdit2 = GetDlgItem(hWnd, IDC_EDIT2);   //Edit2
         SendMessage(hCtlEdit2, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) TEXT("Edit2"));

         hCtlEdit3 = GetDlgItem(hWnd, IDC_EDIT3);   //Edit3
         SendMessage(hCtlEdit3, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) TEXT("Edit3"));

         hCtlTabControl1 = GetDlgItem(hWnd, IDC_TABCONTROL1);   //TabControl1
         {

           TCITEM hCtlTabControl1Item;

           ZeroMemory(&hCtlTabControl1Item, sizeof(TCITEM));

           hCtlTabControl1Item.mask = TCIF_TEXT | TCIF_IMAGE;
 

           hCtlTabControl1Item.pszText = TEXT("First Tab");

           hCtlTabControl1Item.iImage = 0;

           TabCtrl_InsertItem(hCtlTabControl1, 0, &hCtlTabControl1Item);
 

           hCtlTabControl1Item.pszText = TEXT("Second Tab ");

           hCtlTabControl1Item.iImage = 1;

           TabCtrl_InsertItem(hCtlTabControl1, 1, &hCtlTabControl1Item);
 

           hCtlTabControl1Item.pszText = TEXT("Third Tab");

           hCtlTabControl1Item.iImage = 2;

           TabCtrl_InsertItem(hCtlTabControl1, 2, &hCtlTabControl1Item);
         }
         TabCtrl_SetCurSel(hCtlTabControl1, 1);
         TabCtrl_SetImageList(hCtlTabControl1, hilImageList1);
         if (0 + 16) 

           TabCtrl_SetItemSize(hCtlTabControl1, 0, 16);

         hCtlTrackBar1 = GetDlgItem(hWnd, IDC_TRACKBAR1);   //TrackBar1
         {

           SendMessage(hCtlTrackBar1, TBM_SETRANGE, FALSE, MAKELPARAM(1, 99));

           SendMessage(hCtlTrackBar1, TBM_SETSEL, FALSE, MAKELPARAM(20, 40));

           SendMessage(hCtlTrackBar1, TBM_SETPOS, TRUE, 55);

           SendMessage(hCtlTrackBar1, TBM_SETTICFREQ, 10, 0);

           SendMessage(hCtlTrackBar1, TBM_SETLINESIZE, 7, 0);

           SendMessage(hCtlTrackBar1, TBM_SETPAGESIZE, 5, 0);

           SendMessage(hCtlTrackBar1, TBM_SETTHUMBLENGTH, 20, 0);
         }

         hCtlMonthCalendar1 = GetDlgItem(hWnd, IDC_MONTHCALENDAR1);   //MonthCalendar1
         MonthCal_SetColor(hCtlMonthCalendar1, MCSC_BACKGROUND, GetSysColor(COLOR_BTNFACE));

         hCtlDateTimePicker1 = GetDlgItem(hWnd, IDC_DATETIMEPICKER1);   //DateTimePicker1

         hCtlRadioGroup1 = GetDlgItem(hWnd, IDC_RADIOGROUP1);   //RadioGroup1
         CheckRadioButton(hWnd, IDC_RADIOGROUP1 + 1, IDC_RADIOGROUP1 + 4 ,  IDC_RADIOGROUP1 + 3 + 1);

         hCtlProgressBar1 = GetDlgItem(hWnd, IDC_PROGRESSBAR1);   //ProgressBar1
         {

           SendMessage(hCtlProgressBar1, PBM_SETRANGE32, 0, 100);

           SendMessage(hCtlProgressBar1, PBM_SETPOS, 21, 0);
         }

         hCtlPanel1 = GetDlgItem(hWnd, IDC_PANEL1);   //Panel1

         hCtlCheckBox2 = GetDlgItem(hWnd, IDC_CHECKBOX2);   //CheckBox2

         hCtlCheckBox3 = GetDlgItem(hWnd, IDC_CHECKBOX3);   //CheckBox3
         SendMessage(hCtlCheckBox3, BM_SETCHECK, BST_CHECKED, 0);

         hCtlRadioButton2 = GetDlgItem(hWnd, IDC_RADIOBUTTON2);   //RadioButton2

         hCtlRadioButton3 = GetDlgItem(hWnd, IDC_RADIOBUTTON3);   //RadioButton3
         CheckRadioButton(hWnd, IDC_RADIOBUTTON3, IDC_RADIOBUTTON3, IDC_RADIOBUTTON3);

         hCtlCheckBox4 = GetDlgItem(hWnd, IDC_CHECKBOX4);   //CheckBox4

         hCtlTabControl2 = GetDlgItem(hWnd, IDC_TABCONTROL2);   //TabControl2
         {

           TCITEM hCtlTabControl2Item;

           ZeroMemory(&hCtlTabControl2Item, sizeof(TCITEM));

           hCtlTabControl2Item.mask = TCIF_TEXT | TCIF_IMAGE;
 

           hCtlTabControl2Item.pszText = TEXT("one");

           hCtlTabControl2Item.iImage = 0;

           TabCtrl_InsertItem(hCtlTabControl2, 0, &hCtlTabControl2Item);
 

           hCtlTabControl2Item.pszText = TEXT("two");

           hCtlTabControl2Item.iImage = 1;

           TabCtrl_InsertItem(hCtlTabControl2, 1, &hCtlTabControl2Item);
 

           hCtlTabControl2Item.pszText = TEXT("three");

           hCtlTabControl2Item.iImage = 2;

           TabCtrl_InsertItem(hCtlTabControl2, 2, &hCtlTabControl2Item);
 

           hCtlTabControl2Item.pszText = TEXT("four");

           hCtlTabControl2Item.iImage = 3;

           TabCtrl_InsertItem(hCtlTabControl2, 3, &hCtlTabControl2Item);
 

           hCtlTabControl2Item.pszText = TEXT("five");

           hCtlTabControl2Item.iImage = 4;

           TabCtrl_InsertItem(hCtlTabControl2, 4, &hCtlTabControl2Item);
         }
         TabCtrl_SetCurSel(hCtlTabControl2, 3);
         TabCtrl_SetImageList(hCtlTabControl2, hilImageList1);
         if (0 + 0) 

           TabCtrl_SetItemSize(hCtlTabControl2, 0, 0);

         hCtlMemo3 = GetDlgItem(hWnd, IDC_MEMO3);   //Memo3
//SendMessage(hCtlMemo3, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) TEXT(""));
         {

           TCHAR *sz_tmp = TEXT(\

           "This is a VCL \r\n"\

           "memo \r\n"\

           "field\r\n"\

           "\r\n"\

           "This is a VCL \r\n"\

           "memo \r\n"\

           "field\r\n"\

           "\r\n"\

           "This is a VCL \r\n"\

           "memo \r\n"\

           "field\r\n"\

           "\r\n"\

           " \r\n"\
         );
            SendMessage(hCtlMemo3, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) sz_tmp);
         }

         hCtlProgressBar2 = GetDlgItem(hWnd, IDC_PROGRESSBAR2);   //ProgressBar2
         {

           SendMessage(hCtlProgressBar2, PBM_SETRANGE32, -100, 100);

           SendMessage(hCtlProgressBar2, PBM_SETPOS, 0, 0);
         }

         hCtlCSpinEdit1 = GetDlgItem(hWnd, IDC_CSPINEDIT1);   //CSpinEdit1
         SendMessage(hCtlCSpinEdit1, UDM_SETBUDDY, (WPARAM)GetDlgItem(hWnd, IDC_EDIT_IDC_CSPINEDIT1), 0);
         SendMessage(hCtlCSpinEdit1, UDM_SETRANGE32,  20,  80);
         SendMessage(hCtlCSpinEdit1, UDM_SETPOS32, 0, 23);

         hCtlTabControl3 = GetDlgItem(hWnd, IDC_TABCONTROL3);   //TabControl3
         {

           TCITEM hCtlTabControl3Item;

           ZeroMemory(&hCtlTabControl3Item, sizeof(TCITEM));

           hCtlTabControl3Item.mask = TCIF_TEXT | TCIF_IMAGE;
 

           hCtlTabControl3Item.pszText = TEXT("One");

           hCtlTabControl3Item.iImage = 0;

           TabCtrl_InsertItem(hCtlTabControl3, 0, &hCtlTabControl3Item);
 

           hCtlTabControl3Item.pszText = TEXT("Two");

           hCtlTabControl3Item.iImage = 1;

           TabCtrl_InsertItem(hCtlTabControl3, 1, &hCtlTabControl3Item);
 

           hCtlTabControl3Item.pszText = TEXT("Three");

           hCtlTabControl3Item.iImage = 2;

           TabCtrl_InsertItem(hCtlTabControl3, 2, &hCtlTabControl3Item);
 

           hCtlTabControl3Item.pszText = TEXT("Four");

           hCtlTabControl3Item.iImage = 3;

           TabCtrl_InsertItem(hCtlTabControl3, 3, &hCtlTabControl3Item);
         }
         TabCtrl_SetCurSel(hCtlTabControl3, 1);
         TabCtrl_SetImageList(hCtlTabControl3, hilImageList1);
         if (0 + 0) 

           TabCtrl_SetItemSize(hCtlTabControl3, 0, 0);

         hCtlEdit4 = GetDlgItem(hWnd, IDC_EDIT4);   //Edit4
         SendMessage(hCtlEdit4, WM_SETTEXT, 0, (LPARAM) (LPCTSTR) TEXT("23"));

         hCtlUpDown1 = GetDlgItem(hWnd, IDC_UPDOWN1);   //UpDown1
         SendMessage(hCtlUpDown1, UDM_SETBUDDY, (WPARAM)hCtlEdit4, 0);
         SendMessage(hCtlUpDown1, UDM_SETRANGE32,  20,  80);
         SendMessage(hCtlUpDown1, UDM_SETPOS32, 0, 23);

         hCtlButton1 = GetDlgItem(hWnd, IDC_BUTTON1);   //Button1

         hCtlButton2 = GetDlgItem(hWnd, IDC_BUTTON2);   //Button2

         hCtlPanel2 = GetDlgItem(hWnd, IDC_PANEL2);   //Panel2

         hCtlButton3 = GetDlgItem(hWnd, IDC_BUTTON3);   //Button3
 
      }
      break;//WM_INITDIALOG
 
      case WM_PAINT:
      {
         PAINTSTRUCT ps;
         BeginPaint(hWnd, &ps);
//INSIDE_WM_PAINT

         RECT rectBevel1;
         rectBevel1.left = 111;
         rectBevel1.top = 4;
         rectBevel1.right = (111 + 75);
         rectBevel1.bottom = (4 + 10);
         MapDialogRect(hWnd, &rectBevel1);
         DrawEdge(ps.hdc, &rectBevel1, BDR_RAISEDINNER, BF_RECT);

         RECT rectBevel2;
         rectBevel2.left = 111;           
         rectBevel2.top = 19;           
         rectBevel2.right = (111 + 75);
         rectBevel2.bottom = (19 + 10);
         MapDialogRect(hWnd, &rectBevel2);
         DrawEdge(ps.hdc, &rectBevel2, BDR_SUNKENINNER, BF_RECT);

         RECT rectBevel3;
         rectBevel3.left = 543;
         rectBevel3.top = 121;
         rectBevel3.right = (543 + 27);
         rectBevel3.bottom = (121 + 10);
         MapDialogRect(hWnd, &rectBevel3);
         DrawEdge(ps.hdc, &rectBevel3, BDR_SUNKENINNER, BF_RECT);

         RECT rectBevel4;
         rectBevel4.left = 541;
         rectBevel4.top = 12;
         rectBevel4.right = (541 + 27);
         rectBevel4.bottom = (12 + 10);
         MapDialogRect(hWnd, &rectBevel4);
         DrawEdge(ps.hdc, &rectBevel4, BDR_RAISEDINNER, BF_RECT);

         RECT rectBevel5;
         rectBevel5.left = 543;
         rectBevel5.top = 135;
         rectBevel5.right = (543 + 27);
         rectBevel5.bottom = (135 + 10);
         MapDialogRect(hWnd, &rectBevel5);
         DrawEdge(ps.hdc, &rectBevel5, BDR_SUNKENINNER, BF_BOTTOM);

         RECT rectBevel6;
         rectBevel6.left = 541;
         rectBevel6.top = 27;
         rectBevel6.right = (541 + 27);
         rectBevel6.bottom = (27 + 10);
         MapDialogRect(hWnd, &rectBevel6);
         DrawEdge(ps.hdc, &rectBevel6, BDR_RAISEDINNER, BF_BOTTOM);

         RECT rectBevel7;
         rectBevel7.left = 543;
         rectBevel7.top = 149;
         rectBevel7.right = (543 + 27);
         rectBevel7.bottom = (149 + 10);
         MapDialogRect(hWnd, &rectBevel7);
         DrawEdge(ps.hdc, &rectBevel7, BDR_SUNKENINNER, BF_RECT);

         RECT rectBevel8;
         rectBevel8.left = 541;
         rectBevel8.top = 41;
         rectBevel8.right = (541 + 27);
         rectBevel8.bottom = (41 + 10);
         MapDialogRect(hWnd, &rectBevel8);
         DrawEdge(ps.hdc, &rectBevel8, BDR_RAISEDINNER, BF_RECT);

         RECT rectBevel9;
         rectBevel9.left = 543;
         rectBevel9.top = 163;
         rectBevel9.right = (543 + 27);
         rectBevel9.bottom = (163 + 10);
         MapDialogRect(hWnd, &rectBevel9);
         DrawEdge(ps.hdc, &rectBevel9, BDR_SUNKENINNER, BF_LEFT);

         RECT rectBevel10;
         rectBevel10.left = 541;
         rectBevel10.top = 55;
         rectBevel10.right = (541 + 27);
         rectBevel10.bottom = (55 + 10);
         MapDialogRect(hWnd, &rectBevel10);
         DrawEdge(ps.hdc, &rectBevel10, BDR_RAISEDINNER, BF_LEFT);

         RECT rectBevel11;
         rectBevel11.left = 543;
         rectBevel11.top = 177;
         rectBevel11.right = (543 + 27);
         rectBevel11.bottom = (177 + 10);
         MapDialogRect(hWnd, &rectBevel11);
         DrawEdge(ps.hdc, &rectBevel11, BDR_SUNKENINNER, BF_RIGHT);

         RECT rectBevel12;
         rectBevel12.left = 541;
         rectBevel12.top = 69;
         rectBevel12.right = (541 + 27);
         rectBevel12.bottom = (69 + 10);
         MapDialogRect(hWnd, &rectBevel12);
         DrawEdge(ps.hdc, &rectBevel12, BDR_RAISEDINNER, BF_RIGHT);

         RECT rectBevel13;
         rectBevel13.left = 543;        
         rectBevel13.top = 192;
         rectBevel13.right = (543 + 27);
         rectBevel13.bottom = (192 + 10);
         MapDialogRect(hWnd, &rectBevel13);
         DrawEdge(ps.hdc, &rectBevel13, BDR_SUNKENINNER, BF_BOTTOM);

         RECT rectBevel14;
         rectBevel14.left = 541;
         rectBevel14.top = 83;
         rectBevel14.right = (541 + 27);
         rectBevel14.bottom = (83 + 10);
         MapDialogRect(hWnd, &rectBevel14);
         DrawEdge(ps.hdc, &rectBevel14, BDR_RAISEDINNER, BF_BOTTOM);

         RECT rectBevel15;
         rectBevel15.left = 543;
         rectBevel15.top = 206;
         rectBevel15.right = (543 + 27);
         rectBevel15.bottom = (206 + 10);
         MapDialogRect(hWnd, &rectBevel15);
         DrawEdge(ps.hdc, &rectBevel15, BDR_SUNKENINNER, BF_TOP);

         RECT rectBevel16;
         rectBevel16.left = 541;
         rectBevel16.top = 97;
         rectBevel16.right = (541 + 27);
         rectBevel16.bottom = (97 + 10);
         MapDialogRect(hWnd, &rectBevel16);
         DrawEdge(ps.hdc, &rectBevel16, BDR_RAISEDINNER, BF_TOP);
         RECT rectImage1ST;
         rectImage1ST.left = 447;
         rectImage1ST.top = 190;
         rectImage1ST.right = (447 + 70);
         rectImage1ST.bottom = (190 + 70);
         MapDialogRect(hWnd, &rectImage1ST);
         HDC hdcImage1ST = CreateCompatibleDC(ps.hdc);
         SelectObject(hdcImage1ST, hBmpImage1ST);
         BITMAP bmpImage1ST;
         GetObject(hBmpImage1ST, sizeof(BITMAP), &bmpImage1ST);
         StretchBlt(ps.hdc, rectImage1ST.left, rectImage1ST.top, rectImage1ST.right - rectImage1ST.left, rectImage1ST.bottom - rectImage1ST.top, hdcImage1ST, 0, 0, bmpImage1ST.bmWidth,          bmpImage1ST.bmHeight, SRCCOPY);
         DeleteDC(hdcImage1ST);
 
         RECT rectImageNST;
         rectImageNST.left = 521;
         rectImageNST.top = 215;
         rectImageNST.right = (521 + 48);
         rectImageNST.bottom = (215 + 44);
         MapDialogRect(hWnd, &rectImageNST);
         HDC hdcImageNST = CreateCompatibleDC(ps.hdc);
         SelectObject(hdcImageNST, hBmpImageNST);
         BITMAP bmpImageNST;
         GetObject(hBmpImageNST, sizeof(BITMAP), &bmpImageNST);
         BitBlt(ps.hdc, rectImageNST.left, rectImageNST.top, rectImageNST.right - rectImageNST.left, rectImageNST.bottom - rectImageNST.top, hdcImageNST, 0, 0, SRCCOPY);
         DeleteDC(hdcImageNST);
 

         RECT rectPanel1;
         rectPanel1.left = 437;
         rectPanel1.top = 0;
         rectPanel1.right = (437 + 49);
         rectPanel1.bottom = (0 + 79);
         MapDialogRect(hWnd, &rectPanel1);
         DrawEdge(ps.hdc, &rectPanel1, BDR_RAISEDINNER | 0x00, BF_RECT);

         RECT rectPanel2;
         rectPanel2.left = 442;
         rectPanel2.top = 44;
         rectPanel2.right = (442 + 38);
         rectPanel2.bottom = (44 + 30);
         MapDialogRect(hWnd, &rectPanel2);
         DrawEdge(ps.hdc, &rectPanel2, BDR_SUNKENINNER | 0x00, BF_RECT);
 
         EndPaint(hWnd, &ps);
      }
      break;//WM_PAINT
 
      case WM_DRAWITEM:
      {
         LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
         HDC hdcMem = CreateCompatibleDC(lpdis->hDC);
//INSIDE_WM_DRAWITEM
 
DeleteDC(hdcMem);
      }
      break;//WM_DRAWITEM
 
      case WM_CLOSE:
      {
//INSIDE_WM_CLOSE
 
      }
      break;//WM_CLOSE
 
      case WM_DESTROY:
      {
//INSIDE_WM_DESTROY
          
      }
      break;//WM_DESTROY
 
   }; // switch (uMsg)
//OUT_OF_SWITCH_MESSAGE
      return FALSE;
}; // DIALOG_PROC
//OUT_OF_DIALOG_PROC
 
© Copyright (2000-2013), Luigi Bianchi
Last Update: May 28, 2013