This function is used to process messages while a dialog is active.
#include <os2.h> #define INCL_WIN #define INCL_WINDIALOGS #define IDD_OPEN WM_USER+200 #define IDM_OPEN WM_USER+201 HWND hwndDlg; HWND hwndFrame; PFNWP OpenDlg; /* Inside client procedure */ switch(msg) { case WM_COMMAND: /* The user has chosen a menu item. */ /* Process the selection accordingly. */ switch (SHORT1FROMMP(mp1)) { case IDM_OPEN: if (WinDlgBox(HWND_DESKTOP, hwndFrame, /* Handle of the owner */ OpenDlg, /* Dialog procedure address */ (ULONG)0, /* Location of dialog resource */ IDD_OPEN, /* Resource identifier */ NULL)) /* Application-specific data */ { WinProcessDlg(hwndDlg); } break; } break; }