home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / s12133.zip / APPCMD.C < prev    next >
C/C++ Source or Header  |  1988-11-16  |  2KB  |  104 lines

  1. #define INCL_WIN
  2.  
  3. #include <os2.h>
  4. #include <stddef.h>
  5. #include "APP.h"
  6. #include <string.h>
  7.  
  8. extern HWND hwndList;
  9. int index;
  10. char szEdit[256] = "This is a test";
  11. char temp[15];
  12.  
  13. MRESULT FAR PASCAL APPCommand( hWnd, message, mp1, mp2 )
  14. HWND    hWnd;
  15. USHORT  message;
  16. MPARAM  mp1;
  17. MPARAM  mp2;
  18. {
  19.  
  20.  
  21.             index = strlen ("Window");
  22.             strncpy (temp, "Window", index);
  23.             temp [index] = '\0';
  24.             WinSendMsg (hwndList, LM_INSERTITEM, MPFROM2SHORT (LIT_SORTASCENDING, 0),
  25.                 MPFROMP (temp));
  26.             index = strlen ("PM Land");
  27.             strncpy (temp, "PM Land", index);
  28.             temp [index] = '\0';
  29.  
  30.             WinSendMsg (hwndList, LM_INSERTITEM, MPFROM2SHORT (LIT_SORTASCENDING, 0),
  31.                 MPFROMP (temp));
  32.  
  33.            return (0);
  34.  
  35.  
  36. }
  37. /*
  38. */
  39.  
  40.  
  41. MRESULT FAR PASCAL About( hWndDlg, message, mp1, mp2 )
  42. HWND    hWndDlg;
  43. USHORT  message;
  44. MPARAM  mp1;
  45. MPARAM  mp2;
  46. {
  47.     switch( message )
  48.     {
  49.       case WM_COMMAND:
  50.         switch( LOUSHORT( mp1 ) )
  51.         {
  52.           case DID_OK:
  53.             WinDismissDlg( hWndDlg, TRUE );
  54.             break;
  55.  
  56.           default:
  57.             break;
  58.         }
  59.         break;
  60.  
  61.       default:
  62.     return WinDefDlgProc( hWndDlg, message, mp1, mp2 );
  63.     }
  64.     return FALSE;
  65. }
  66. /*
  67. */
  68.  
  69. MRESULT FAR PASCAL EditDlg( hWndDlg, message, mp1, mp2 )
  70. HWND    hWndDlg;
  71. USHORT  message;
  72. MPARAM  mp1;
  73. MPARAM  mp2;
  74. {
  75.     switch( message )
  76.     {
  77.       case WM_INITDLG:
  78.       WinSetDlgItemText( hWndDlg, IDEDIT, szEdit );
  79.           break;
  80.  
  81.       case WM_COMMAND:
  82.           switch( LOUSHORT( mp1 ) ) {
  83.               case DID_OK:
  84.           WinQueryDlgItemText( hWndDlg, IDEDIT, 256, szEdit );
  85.                   WinDismissDlg( hWndDlg, TRUE );
  86.                   break;
  87.  
  88.               case DID_CANCEL:
  89.                   WinDismissDlg( hWndDlg, FALSE );
  90.                   break;
  91.  
  92.               default:
  93.                   break;
  94.           }
  95.           break;
  96.  
  97.       default:
  98.         return( WinDefDlgProc( hWndDlg, message, mp1, mp2 ) );
  99.     }
  100.     return FALSE;
  101. }
  102. /*
  103. */
  104.