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
46 for (size_t ii = 0; ii < cWindowList; ++ii)
48 if (aWindowList[ ii ].hWnd == hWnd)
52 // Add this window to the list
54 for (ii = 0; ii < cWindowList; ++ii)
56 if (!aWindowList[ ii ].hWnd)
59 if (REALLOC (aWindowList, cWindowList, 1+ii, cREALLOC_WINDOWLIST))
61 aWindowList[ ii ].hWnd = hWnd;
62 aWindowList[ ii ].wlt = wlt;
63 aWindowList[ ii ].idObject = idObject;
64 AfsAppLib_RegisterModelessDialog (hWnd);
69 HWND WindowList_Search (WINDOWLISTTYPE wlt, ASID idObject)
71 for (size_t ii = 0; ii < cWindowList; ++ii)
73 if (!aWindowList[ ii ].hWnd)
75 if (aWindowList[ ii ].wlt != wlt)
77 if ((idObject != ASID_ANY) && (aWindowList[ ii ].idObject != idObject))
79 return aWindowList[ ii ].hWnd;
85 void WindowList_Remove (HWND hWnd)
87 for (size_t ii = 0; ii < cWindowList; ++ii)
89 if (aWindowList[ ii ].hWnd == hWnd)
90 aWindowList[ ii ].hWnd = NULL;