home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / PRIMAR.ZIP / TEST.HLP (.txt) < prev   
OS/2 Help File  |  1991-10-25  |  2KB  |  54 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Extended Help for the worplace window ΓòÉΓòÉΓòÉ
  3.  
  4. The demo program has a fully working help support. You just have to select a 
  5. menu item, press F1 and you will see the related application code. 
  6.  
  7.  
  8. ΓòÉΓòÉΓòÉ 2. File Open Help ΓòÉΓòÉΓòÉ
  9.  
  10. When you select this option, you will create a primary window, that was created 
  11. with the help of the PrimaryWindow Class. It is good programming style is you 
  12. hide the use of the function SeiCreateDialogWindow in a creation function. 
  13.  
  14. In the following you see the entire creation function. 
  15.  
  16. HWND EXPENTRY CreateDummy ( HWND hwnd, PVOID pParamDummy) {
  17.   USHORT  usrc;
  18.   HMODULE hModule;
  19.   HWND    hwndFrame;
  20.   usrc = DosGetModHandle (DLL_NAME, &hModule);
  21.   hwndFrame = SeiCreateDialogWindow (HWND_DESKTOP,      // Parent
  22.                                      hwnd,              // Owner
  23.                                      WS_VISIBLE,        // Frame style
  24.                                      NULL,              // FCF
  25.                                      DlgWinProc,        // WinProc
  26.                                      NULL,              // Title
  27.                                      hModule,           // Resource
  28.                                      DLG_MAIN,          // ResourceID
  29.                                      pParamDummy);
  30.   return (hwndFrame);
  31.   }
  32.  
  33. The function was invoked in the window procedure of the client window of our 
  34. workplace during the handling of the WM_CREATE message. 
  35.  
  36. Here is the code: 
  37.  
  38.         case MN_FILEOPEN: {
  39.              HWND      hwndDummy;
  40.              /*--------------------------------------*/
  41.              /* Create a primary or secondary window */
  42.              /*--------------------------------------*/
  43.              hwndDummy = CreateDummy (hwnd, "Charly Brown");
  44.         } break;
  45.  
  46.  
  47. ΓòÉΓòÉΓòÉ 3. File Exit Help ΓòÉΓòÉΓòÉ
  48.  
  49. When  you  select  the  exit  option ,  a  WM _ QUIT  message  is  posted . 
  50.  
  51.         case MN_FILEEXIT: {
  52.              WinPostMsg (hwnd, WM_QUIT, 0L, 0L);
  53.         } break;
  54.