Documentation
API Reference
Installation
- Add
dialog-layout
to your project using CMake or by copyinglayout.h
andlayout.c
. - Include the header:
#include "layout.h"
- Compile and link with
layout.c
in your sources.
Usage
- Create your Win32 dialog resource as usual in your
.rc
file. - Create a layout resource (.bin, using the documented format) and add it as an RCDATA resource.
- In your dialog procedure:
attach_layout(GetModuleHandle(NULL), hDlg, _T("MY_DIALOG_LAYOUT")); // in WM_INITDIALOG detach_layout(hDlg); // in WM_DESTROY
Layout Resource Format
Each layout item is a struct:
typedef struct { DWORD id; WORD top_left_anchor; WORD bottom_right_anchor; } LAYOUT_ITEM_RC;
See examples for a generator script and sample anchor setup.