/*++ Copyright (c) 1994 Microsoft Corporation Module Name: config.c Abstract: This module contains routines related to the [CONFIGURE...] button of the main dialog. Author: Jim Kelly (JimK) 22-Mar-1995 Revision History: --*/ #include /////////////////////////////////////////////////////////////////////// // // // Local Function Prototypes // // // /////////////////////////////////////////////////////////////////////// LONG SecMgrpDlgProcConfigure( HWND hwnd, UINT wMsg, DWORD wParam, LONG lParam ); /////////////////////////////////////////////////////////////////////// // // // Module-wide variables // // // /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // // Externally callable functions // // // /////////////////////////////////////////////////////////////////////// VOID SecMgrpButtonConfigure( HWND hwnd ) /*++ Routine Description: This function is used to display the Configure System Security dialog. This is tricky because there are actually several such dialogs. We must choose the right one based upon the number of areas that we have to present. Then we must set the names of the buttons in the dialog to match the names of the areas. Arguments hwnd - window handle. Return Values: None. --*/ { ULONG Dialog, ButtonsInDialog; ASSERT(SecMgrpAreaCount > 0); ASSERT(SecMgrpAreaCount <= 16); // // Select the right dialog based upon the number of areas // if (SecMgrpAreaCount <= 4) { Dialog = SECMGR_ID_DLG_SECURITY_AREAS_4; ButtonsInDialog = 4; } else if (SecMgrpAreaCount <= 6) { Dialog = SECMGR_ID_DLG_SECURITY_AREAS_6; ButtonsInDialog = 6; } else if (SecMgrpAreaCount <= 9) { Dialog = SECMGR_ID_DLG_SECURITY_AREAS_9; ButtonsInDialog = 9; } else if (SecMgrpAreaCount <= 12) { Dialog = SECMGR_ID_DLG_SECURITY_AREAS_12; ButtonsInDialog = 12; } else if (SecMgrpAreaCount <= 16) { Dialog = SECMGR_ID_DLG_SECURITY_AREAS_16; ButtonsInDialog = 16; } DialogBoxParam(SecMgrphInstance, MAKEINTRESOURCE(Dialog), hwnd, (DLGPROC)SecMgrpDlgProcConfigure, ButtonsInDialog); return; } /////////////////////////////////////////////////////////////////////// // // // Module-wide functions // // // /////////////////////////////////////////////////////////////////////// LONG SecMgrpDlgProcConfigure( HWND hwnd, UINT wMsg, DWORD wParam, LONG lParam ) /*++ Routine Description: This function is the dialog process for the [CONFIGURE...] button. Arguments lParam - Contains the number of (area) buttons in the dialog. Return Values: TRUE - the message was handled. FALSE - the message was not handled. --*/ { ULONG ButtonsInDialog = (lParam), i; int Index; HWND Control, Button; LPCWSTR AreaName; switch (wMsg) { case WM_INITDIALOG: // // Set the security level // SecMgrpSetSecurityLevel( hwnd, FALSE, SECMGR_ID_ICON_SECURITY_LEVEL); // // Set text of buttons that are used // for (i=0; iName ); } // // hide the buttons that are unused // for (i=SecMgrpAreaCount; iFlags & SECMGR_AREA_FLAG_AREA_VIEW) { (*SecMgrpAreas[AreaIndex]->SmedlyControl->Api->InvokeArea) (hwnd, SecMgrpAllowChanges, Interactive, SecMgrpAreas[AreaIndex]); // // Indicate that this area has been invoked at least once // SecMgrpAreas[AreaIndex]->Flags |= SECMGRP_AREA_FLAG_AREA_INITIALIZED; } return; }