home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / taman002.zip / TASKMANA.ZIP / src / kDetailBase.cpp < prev    next >
C/C++ Source or Header  |  2000-04-29  |  3KB  |  109 lines

  1. /* $Id: kDetailBase.cpp,v 1.1 2000/04/29 19:06:34 stknut Exp $
  2.  *
  3.  * Implementation of the detail dialog base class, kDetailBase.
  4.  *
  5.  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  6.  *
  7.  * Project Odin Software License can be found in LICENSE.TXT
  8.  *
  9.  */
  10.  
  11.  
  12. /*******************************************************************************
  13. *   Defined Constants And Macros                                               *
  14. *******************************************************************************/
  15. #define INCL_DOS
  16. #define INCL_DOSERRORS
  17. #define INCL_WIN
  18.  
  19.  
  20. /*******************************************************************************
  21. *   Header Files                                                               *
  22. *******************************************************************************/
  23. #include <os2.h>
  24. #ifdef USE_KLIB
  25.     #include <kAssert.h>
  26.     #include <kLog.h>
  27.     #include <kHeap.h>
  28. #endif
  29. #include <stdio.h>
  30. #include <string.h>
  31. #include <process.h>
  32.  
  33. #include "kBase.h"
  34. #include "kError.h"
  35. #include "kDlgBase.h"
  36.  
  37. #include "kDetailBase.h"
  38.  
  39. #pragma pack(1)
  40. typedef struct _SWCNTRL2          /* swctl */
  41. {
  42.  HWND     hwnd;
  43.  HWND     hwndIcon;
  44.  HPROGRAM hprog;
  45.  PID      idProcess;
  46.  ULONG    idSession;
  47.  ULONG    uchVisibility;
  48.  ULONG    fbJump;
  49.  CHAR     szSwtitle[MAXNAMEL+4];
  50.  ULONG    bProgType;
  51. } SWCNTRL2;
  52.  
  53. typedef SWCNTRL2 *PSWCNTRL2;
  54.  
  55. typedef struct _SWENTRY2          /* swent */
  56. {
  57.  HSWITCH hswitch;
  58.  SWCNTRL2 swctl;
  59. } SWENTRY2;
  60. typedef SWENTRY2 *PSWENTRY2;
  61.  
  62. typedef struct _SWBLOCK2          /* swblk */
  63. {
  64.  ULONG    cswentry;
  65.  SWENTRY2 aswentry[1];
  66. } SWBLOCK2;
  67. typedef SWBLOCK2 *PSWBLOCK2;
  68.  
  69.  
  70.  
  71. /**
  72.  * Constructor - adds the dialog to the switch list.
  73.  * @param     hwnd      Handle to the dialog window.
  74.  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  75.  */
  76. kDetailBase::kDetailBase(HWND hwnd)
  77. {
  78.     //HSWITCH     hswMain;                /* Handle to main windows switch entry. */
  79.  
  80.     /*
  81.      *  Add to tasklist
  82.      *      Remove switch entry for this dialog window if it exists.
  83.      *      Get main window sitch handle.
  84.      *      Create switch entry for this dialog window.
  85.      */
  86.     hsw = WinQuerySwitchHandle(hwnd, 0);
  87.     #if 0
  88.     if (hsw != NULLHANDLE)
  89.         WinRemoveSwitchEntry(hsw);
  90.     hsw = NULLHANDLE;
  91.  
  92.     hswMain = WinQuerySwitchHandle(NULLHANDLE, getpid());
  93.     if (hswMain != NULL)
  94.     {
  95.         SWCNTRL swctl = {0};
  96.  
  97.         WinQuerySwitchEntry(hswMain, &swctl);
  98.         swctl.hwnd = hwnd;
  99.         swctl.hprog = hswMain;
  100.         strcpy(swctl.szSwtitle, "summy");
  101.         hsw = WinAddSwitchEntry(&swctl);
  102.  
  103.         SWBLOCK2    aswb[40] = {0};
  104.         WinQuerySwitchList(WinQueryAnchorBlock(hwnd), (PSWBLOCK)(&aswb[0]), sizeof(aswb));
  105.     }
  106.     #endif
  107. }
  108.  
  109.