home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1996 April / WHAT_PC_APR_96.ISO / internet / twinsock / src / about.c next >
Encoding:
C/C++ Source or Header  |  1995-01-21  |  1.0 KB  |  49 lines

  1. /*
  2.  *  TwinSock - "Troy's Windows Sockets"
  3.  *
  4.  *  Copyright (C) 1994  Troy Rollo <troy@cbme.unsw.EDU.AU>
  5.  *
  6.  *  This program is free software; you can redistribute it and/or modify
  7.  *  it under the terms of the license in the file LICENSE.TXT included
  8.  *  with the TwinSock distribution.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
  13.  */
  14. #include <windows.h>
  15.  
  16. extern    HINSTANCE hinst;
  17.  
  18. BOOL    CALLBACK
  19. AboutDlgProc(    HWND    hDlg,
  20.         UINT    wMsg,
  21.         WPARAM    wParam,
  22.         LPARAM    lParam)
  23. {
  24.     if (wMsg == WM_COMMAND &&
  25.         (wParam == IDOK || wParam == IDCANCEL))
  26.     {
  27.         EndDialog(hDlg, TRUE);
  28.         return TRUE;
  29.     }
  30.     else if (wMsg == WM_INITDIALOG)
  31.     {
  32.         return TRUE;
  33.     }
  34.     else
  35.     {
  36.         return FALSE;
  37.     }
  38. }
  39.  
  40. void
  41. About(HWND hwndParent)
  42. {
  43.     FARPROC    fpDlgProc;
  44.  
  45.     fpDlgProc = MakeProcInstance((FARPROC) AboutDlgProc, hinst);
  46.     DialogBox(hinst, "ABOUT_DLG", hwndParent, fpDlgProc);
  47.     FreeProcInstance(fpDlgProc);
  48. }
  49.