6 #include "TaAfsUsrMgr.h"
11 * DEFINITIONS ________________________________________________________________
20 } WINDOWLISTENTRY, *LPWINDOWLISTENTRY;
22 static WINDOWLISTENTRY *aWindowList = NULL;
23 static size_t cWindowList = 0;
25 #define cREALLOC_WINDOWLIST 4
29 * ROUTINES ___________________________________________________________________
33 void WindowList_Add (HWND hWnd, WINDOWLISTTYPE wlt, ASID idObject)
35 // See if this window is already in the list
37 for (size_t ii = 0; ii < cWindowList; ++ii)
39 if (aWindowList[ ii ].hWnd == hWnd)
43 // Add this window to the list
45 for (ii = 0; ii < cWindowList; ++ii)
47 if (!aWindowList[ ii ].hWnd)
50 if (REALLOC (aWindowList, cWindowList, 1+ii, cREALLOC_WINDOWLIST))
52 aWindowList[ ii ].hWnd = hWnd;
53 aWindowList[ ii ].wlt = wlt;
54 aWindowList[ ii ].idObject = idObject;
55 AfsAppLib_RegisterModelessDialog (hWnd);
60 HWND WindowList_Search (WINDOWLISTTYPE wlt, ASID idObject)
62 for (size_t ii = 0; ii < cWindowList; ++ii)
64 if (!aWindowList[ ii ].hWnd)
66 if (aWindowList[ ii ].wlt != wlt)
68 if ((idObject != ASID_ANY) && (aWindowList[ ii ].idObject != idObject))
70 return aWindowList[ ii ].hWnd;
76 void WindowList_Remove (HWND hWnd)
78 for (size_t ii = 0; ii < cWindowList; ++ii)
80 if (aWindowList[ ii ].hWnd == hWnd)
81 aWindowList[ ii ].hWnd = NULL;