home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / Chip_2002-02_cd1.bin / sharewar / apaths / APSOURCE.ZIP / CPlApplet.c < prev    next >
C/C++ Source or Header  |  2001-03-26  |  2KB  |  78 lines

  1. /* CPlApplet.c - March 26th, 2001
  2. **
  3. **      Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
  4. **
  5. **      This function forms the main entry point for an MS Windows 95/NT
  6. **      Control Panel applet. This routine is called by Control.exe when
  7. **      first launched.
  8. **
  9. **      Called:     w   = window handle of the parent.
  10. **                  msg = MS Windows CPL messages.
  11. **                  wp  = WPARAM argument.
  12. **                  lp  = LPARAM argument.
  13. **
  14. **      Returns:    Results based upon the message being processed.
  15. **
  16. **      Notes:      This is an exported API function.
  17. */
  18.  
  19. #include "AppPaths.h"
  20.  
  21. static void     inquire     (HINSTANCE module,LPNEWCPLINFO info);
  22.  
  23. LONG CALLBACK CPlApplet (HWND w,UINT msg,LONG wp,LONG lp)
  24. {
  25.     UNUSED_ARG (wp);
  26.  
  27.     switch (msg) {
  28.  
  29.         case CPL_INIT : 
  30.              return (TRUE);
  31.              break;
  32.  
  33.         case CPL_GETCOUNT : 
  34.              return (1); 
  35.              break; 
  36.  
  37.         case CPL_NEWINQUIRE :
  38.              inquire (applet,(LPNEWCPLINFO) lp); 
  39.              break;
  40.             
  41.         case CPL_DBLCLK :
  42.              Property (w); 
  43.              break; 
  44.  
  45.         case CPL_STOP : 
  46.              break; 
  47.  
  48.         case CPL_EXIT :
  49.              break; 
  50.  
  51.         default :
  52.              break;
  53.              }
  54.  
  55.     return (FALSE);
  56. }
  57.  
  58. static void inquire (HINSTANCE module,LPNEWCPLINFO info)
  59. {
  60.      info->dwSize           = sizeof (NEWCPLINFO); 
  61.      info->dwFlags          = NIL; 
  62.      info->dwHelpContext    = NIL; 
  63.      info->lData            = NIL; 
  64.      info->hIcon            = LoadIcon (module,(LPCTSTR) APPLICATION_ICON);
  65.  
  66.      if (*helpfile)
  67.          lstrcpy (info->szHelpFile,helpfile);
  68.      else
  69.         *info->szHelpFile = EOS;
  70.  
  71.      LoadString (module,CPANEL_NAME,info->szName,32); 
  72.      LoadString (module,CPANEL_DESC,info->szInfo,64); 
  73.  
  74.     return;
  75. }
  76.  
  77. /* end of CPlApplet.c - written by Gregory Braun */
  78.