Page 79 - DCAP408_WEB_PROGRAMMING
P. 79

Unit 4: Windows Controls




          10.  In the Create New File dialog box, in the Name, type CtrlScrollBars              Notes
          11.  In the Type combo box, select rc


















          12.  Click OK
          13.  In the file, type:
          #include  “resource.h”


          IDD_CONTROLS_DLG  DIALOG  DISCARDABLE    200,  150,  235,  151
          STYLE  DS_MODALFRAME  |  WS_POPUP  |  WS_CAPTION  |  WS_SYSMENU
          CAPTION  “Windows  Controls”
          FONT  8,  “MS  Sans  Serif”
          BEGIN
                  PUSHBUTTON
              “&Close”,IDC_CLOSE_BTN,178,7,50,14
          END
          14.  Display the Exercise.cpp file and change it as follows:
          #include  <windows.h>
          #ifdef  __BORLANDC__
              #pragma  argsused
          #endif


          #include  “resource.h”


          //—————————————————————————————————————
          HWND  hWnd;
          HINSTANCE  hInst;
          LRESULT  CALLBACK  DlgProc(HWND  hWnd,  UINT  Msg,  WPARAM  wParam,  LPARAM  lParam);
          //—————————————————————————————————————
          int  APIENTRY  WinMain(  HINSTANCE  hInstance,  HINSTANCE  hPrevInstance,  LPSTR
          lpCmdLine,  int  nCmdShow  )
          {
                  hInst  =  hInstance;




                                           LOVELY PROFESSIONAL UNIVERSITY                                   73
   74   75   76   77   78   79   80   81   82   83   84