home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 8 / 08.iso / d / d022 / 1.ddi / SAMPLES / STRINGS / USERCODE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-10  |  1.7 KB  |  66 lines

  1. /*Filename: USERCODE.C                                      */
  2. /*"STRINGS" Generated by WindowsMAKER                       */
  3. /*Author: Bill G.                                           */
  4.  
  5. #include <WINDOWS.H>
  6. #include "STRINGS.H"
  7.  
  8. HWND hwndText=0;
  9. #define ID_CHILD 100
  10.  
  11. long BLD_WM_CREATEMsg(hWnd,message,wParam,lParam) /* Procedure for message processing */
  12. HWND hWnd;
  13. unsigned message;
  14. WORD wParam;     
  15. LONG lParam;     
  16.     {
  17.      /* Create an text control together with the child */
  18.      hwndText = CreateWindow ("static",
  19.               NULL,
  20.               WS_CHILD|WS_VISIBLE|SS_LEFT,
  21.               0,
  22.               0,
  23.               0,
  24.               0,
  25.               hWnd,
  26.               ID_CHILD,
  27.               hInst,
  28.               NULL);
  29.     return DefWindowProc(hWnd, message, wParam, lParam);
  30.     }
  31.  
  32. long BLD_WM_SIZEMsg(hWnd,message,wParam,lParam) /* Procedure for message processing */
  33. HWND hWnd;
  34. unsigned message;
  35. WORD wParam;     
  36. LONG lParam;     
  37.     {
  38.     RECT rect;
  39.     LONG l1,l2;
  40.     l1=GetDialogBaseUnits();
  41.     l2=(8*HIWORD(l1))/8;
  42.      GetClientRect (hWnd, &rect);
  43.      MoveWindow (hwndText,
  44.                  rect.left,
  45.                  rect.top+rect.bottom-(int)l2,
  46.                  rect.right-rect.left,
  47.                  (int)l2,
  48.                  TRUE);
  49.     return DefWindowProc(hWnd, message, wParam, lParam);
  50.     }
  51.  
  52. long BLD_WM_MENUSELECTMsg(hWnd,message,wParam,lParam) /* Procedure for message processing */
  53. HWND hWnd;
  54. unsigned message;
  55. WORD wParam;     
  56. LONG lParam;     
  57.     {
  58.     char szText[200+1];
  59.     if (LoadString(hInst,wParam,szText,200))
  60.        SetWindowText(hwndText,szText);
  61.     else
  62.        SetWindowText(hwndText,"");
  63.     return DefWindowProc(hWnd, message, wParam, lParam);
  64.     }
  65.  
  66.