This example gets the text from a Dialog Box entry field as an integer value.

#define INCL_WINDIALOGS

#include <OS2.H>

#define ID_ENTRYFLD 900

HAB hab;
HWND  hwnd;
ULONG  msg;
MPARAM mp1;
SHORT iconverted;

/* . */
 switch(msg)
  {
   case WM_INITDLG:

   case WM_COMMAND:
   switch(SHORT1FROMMP(mp1))
    {
     case DID_OK:
      WinQueryDlgItemShort(hwnd,
                           ID_ENTRYFLD,
                           &iconverted, /* integer result */
                           TRUE); /* Get the short      */

    }
   }


[Back] [Next]