2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 #include <afs/param.h>
15 #include "TaAfsUsrMgr.h"
20 * DEFINITIONS ________________________________________________________________
29 } WINDOWLISTENTRY, *LPWINDOWLISTENTRY;
31 static WINDOWLISTENTRY *aWindowList = NULL;
32 static size_t cWindowList = 0;
34 #define cREALLOC_WINDOWLIST 4
38 * ROUTINES ___________________________________________________________________
42 void WindowList_Add (HWND hWnd, WINDOWLISTTYPE wlt, ASID idObject)
44 // See if this window is already in the list
47 for (ii = 0; ii < cWindowList; ++ii)
49 if (aWindowList[ ii ].hWnd == hWnd)
53 // Add this window to the list
55 for (ii = 0; ii < cWindowList; ++ii)
57 if (!aWindowList[ ii ].hWnd)
60 if (REALLOC (aWindowList, cWindowList, 1+ii, cREALLOC_WINDOWLIST))
62 aWindowList[ ii ].hWnd = hWnd;
63 aWindowList[ ii ].wlt = wlt;
64 aWindowList[ ii ].idObject = idObject;
65 AfsAppLib_RegisterModelessDialog (hWnd);
70 HWND WindowList_Search (WINDOWLISTTYPE wlt, ASID idObject)
72 for (size_t ii = 0; ii < cWindowList; ++ii)
74 if (!aWindowList[ ii ].hWnd)
76 if (aWindowList[ ii ].wlt != wlt)
78 if ((idObject != ASID_ANY) && (aWindowList[ ii ].idObject != idObject))
80 return aWindowList[ ii ].hWnd;
86 void WindowList_Remove (HWND hWnd)
88 for (size_t ii = 0; ii < cWindowList; ++ii)
90 if (aWindowList[ ii ].hWnd == hWnd)
91 aWindowList[ ii ].hWnd = NULL;