Examples
Sample Control Anchoring
// Dialog layout anchors as RCDATA ID_MAINDIALOG_LAYOUT RCDATA BEGIN IDC_EDIT_FIRSTNAME, 3, 6, // ANCOR_LEFT | ANCOR_TOP, ANCOR_RIGHT | ANCOR_TOP IDC_EDIT_LASTNAME, 3, 6, // ANCOR_LEFT | ANCOR_TOP, ANCOR_RIGHT | ANCOR_TOP IDOK, 12, 12, // ANCOR_RIGHT | ANCOR_BOTTOM, ANCOR_RIGHT | ANCOR_BOTTOM IDCANCEL, 12, 12, // ANCOR_RIGHT | ANCOR_BOTTOM, ANCOR_RIGHT | ANCOR_BOTTOM IDC_RESIZE, 12, 12 // ANCOR_RIGHT | ANCOR_BOTTOM, ANCOR_RIGHT | ANCOR_BOTTOM END
Note: control IDs should be defined with L suffix to make them the same size as DWROD type
#define IDC_EDIT_FIRSTNAME 1001L #define IDC_EDIT_LASTNAME 1002L #define IDC_RESIZE 1003L #define IDOK 1L #define IDCANCEL 2L
Layout Resource Generation
Work in progress
Dialog Integration
// In your dialog procedure attach_layout(hInstance, hDlg, MAKEINTRESOURCE(MY_DIALOG_LAYOUT)); // on WM_INITDIALOG detach_layout(hDlg); // on WM_DESTROY