home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12317.ZIP / APPCMD.C < prev    next >
C/C++ Source or Header  |  1988-12-30  |  1KB  |  72 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.  
  14. /******************************************************************/
  15. /*  This function adds two strings to the listbox.          */
  16. /******************************************************************/
  17. MRESULT FAR PASCAL ADDStrings( hWnd, message, mp1, mp2 )
  18. HWND    hWnd;
  19. USHORT  message;
  20. MPARAM  mp1;
  21. MPARAM  mp2;
  22. {
  23.  
  24.  
  25.        index = strlen ("String1");
  26.        strncpy (temp, "String1", index);
  27.        temp [index] = '\0';
  28.        WinSendMsg (hwndList, LM_INSERTITEM, MPFROM2SHORT (LIT_SORTASCENDING, 0),
  29.            MPFROMP (temp));
  30.        index = strlen ("String2");
  31.        strncpy (temp, "String2", index);
  32.        temp [index] = '\0';
  33.  
  34.        WinSendMsg (hwndList, LM_INSERTITEM, MPFROM2SHORT (LIT_SORTASCENDING, 0),
  35.            MPFROMP (temp));
  36.  
  37.        return (0);
  38.  
  39.  
  40. }
  41. /*
  42. */
  43.  
  44.  
  45. MRESULT FAR PASCAL About( hWndDlg, message, mp1, mp2 )
  46. HWND    hWndDlg;
  47. USHORT  message;
  48. MPARAM  mp1;
  49. MPARAM  mp2;
  50. {
  51.     switch( message )
  52.     {
  53.       case WM_COMMAND:
  54.         switch( LOUSHORT( mp1 ) )
  55.         {
  56.           case DID_OK:
  57.             WinDismissDlg( hWndDlg, TRUE );
  58.             break;
  59.  
  60.           default:
  61.             break;
  62.         }
  63.         break;
  64.  
  65.       default:
  66.     return WinDefDlgProc( hWndDlg, message, mp1, mp2 );
  67.     }
  68.     return FALSE;
  69. }
  70. /*
  71. */
  72.