void Main_OnInitDialog (HWND hDlg) { // Resize and reposition the main window // RECT rWindow = gr.rMain; if (!rWindow.right) GetWindowRect (hDlg, &rWindow); ResizeWindow (hDlg, awdMain, rwaMoveToHere, &rWindow); // Add tabs to the main window's tab control // HWND hTab = GetDlgItem (hDlg, IDC_TAB); TabCtrl_SetImageList (hTab, AfsAppLib_CreateImageList (FALSE)); TCHAR szText[ cchRESOURCE ]; TC_ITEM tci; tci.mask = TCIF_TEXT | TCIF_PARAM | TCIF_IMAGE; tci.pszText = szText; for (size_t iTab = 0; iTab < cTABS; ++iTab) { tci.iImage = aTABS[ iTab ].idiImage; tci.lParam = (LPARAM)aTABS[ iTab ].tt; GetString (tci.pszText, aTABS[ iTab ].idsText); TabCtrl_InsertItem (hTab, iTab, &tci); } // Subclass the tab control, so that we can make it forward any WM_SIZE // messages to its child window. // Subclass_AddHook (hTab, Main_TabHookProc); // Since we just subclassed this control, our new wndproc wasn't around // when the window was created. Any WM_CREATE processing we'd ordinarily // in that wndproc must therefore be done here. // WM_CREATE: RECT rTab; GetRectInParent (hTab, &rTab); ResizeWindow (hTab, awdTabChild, rwaMoveToHere, &rTab); // Select an appropriate tab and display it. // Main_PrepareTabChild (gr.iTabLast); // Tell the admin client that we're interested in any actions that occur // ULONG status; asc_ActionListen (g.idClient, g.hMain, &status); }
EXPORTED BOOL ADMINAPI AfsAppLib_asc_ActionListen (UINT_PTR idClient, HWND hNotify, ULONG *pStatus) { return asc_ActionListen (idClient, hNotify, pStatus); }