BOOL CJXCRetailOnlineDlg::OnInitDialog() { CNDDialog::OnInitDialog(); //未查询,初始不在线 m_bOnline = 2; InitListView(); SetEditFont(); CIBAHelpper::CreateFont(m_BigFont, 23, 700); GetDlgItem(IDC_STATIC_MONEY)->SetFont(&m_BigFont); //编辑框的各种限制 m_edtCount.DisableMask(); m_edtCount.SetValidChars(_T("1234567890")); m_edtCount.SetLimitText(3); m_edtCount.SetWindowText(_T("1")); GetDlgItem(IDOK)->EnableWindow(FALSE); GetDlgItem(IDC_BUTTON_CLEAR)->EnableWindow(FALSE); GetDlgItem(IDC_BUTTON_DEL)->EnableWindow(FALSE); GetDlgItem(IDC_BUTTON_ADD)->EnableWindow(FALSE); //捆绑快捷键 AddFocusEnter(IDC_EDIT_IDCARDSNO, IDC_BUTTON_QUERY); AddFocusEnter(IDC_EDIT_TERMID, IDC_BUTTON_QUERY); AddFocusEnter(IDC_EDIT_COUNT, IDC_BUTTON_ADD); //首次焦点位置 GetDlgItem(IDC_EDIT_TERMID)->SetFocus(); return FALSE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
void UpdateIPv6AddressField(HWND hwndDlg, ULONG ulLabelId, TCHAR *szAddr) { HWND hListViewWnd = GetDlgItem(hwndDlg, IDC_IPV6_LISTBOX); int iCount = 0; DWORD dwID = 0; LVITEM lvi = {0}; int i; BOOL bFound = FALSE; TCHAR szOldVal[INET6_ADDRSTRLEN]; if (!bListViewInit) { InitListView(hwndDlg); } // Locate the line that contains the info to be updated for (i = 0; i < NUM_IPV6ITEMS; i++) { if (ulLabelId == ViewInfo[i].CtrlID) { // found the one we want to update ListView_GetItemText(hListViewWnd, ViewInfo[i].RowID, 1, szOldVal, INET6_ADDRSTRLEN); if (wcscmp(szOldVal, szAddr)) { ListView_SetItemText(hListViewWnd, ViewInfo[i].RowID, 1, szAddr); } break; } } }
void CShiftCashView::OnInitialUpdate() { CIBAFormView::OnInitialUpdate(); InitListView(); SetEditFont(); GetDlgItem(IDC_STATIC_RESULT)->SetFont(&m_Font); GetDlgItem(IDC_STATIC_SHIFTCASH)->SetFont(&m_Font); }
BOOL CDlgBundleTimeList::OnInitDialog() { CIBADialog::OnInitDialog(); InitListView(); FillBundleTimeList(); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
void CNDTermConsumeView::OnInitialUpdate() { CIBAFormView::OnInitialUpdate(); InitListView(); InitTimeControl(); GetDlgItem(IDC_STATIC_RESULT)->SetFont(&m_Font); m_cboTermID.SetFont(&m_Font); SetTimer(1000, 1000 * 60, NULL); }
BOOL CHSDownloadData::OnInitDialog() { CDialog::OnInitDialog(); m_pManager = (IChannelManager*)CWinnerApplication::GetObject(OBJ_CHANNELMANAGER); m_pDataSource = (IDataSourceEx*)CWinnerApplication::GetObject(OBJ_HSDATAENGINE); if (m_pDataSource && !IsBadReadPtr(m_pDataSource,1)) { m_nDataSourceID = m_pDataSource->HSDataSource_DataSouceInit(this,NULL); } //创建行情连接 m_lHandle = m_pManager->CreateConnector(CEV_Connect_HQ,""); m_nTaskMask = 0xFFFF; m_nCulType = 1; InitListView(); DownLoadData(); return TRUE; }
BOOL CALLBACK IPv6QuickCfgDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { BOOL fRetVal = FALSE; HRESULT hr = S_OK; switch (uMsg) { case WM_INITDIALOG: InitListView(hwndDlg); RefreshIPv6CfgDialog(hwndDlg); SetFullScreen(hwndDlg); SetTimer(hwndDlg, 1, IPQC_RFSH_TIMEOUT, NULL); fRetVal = TRUE; break; case WM_TIMER: RefreshIPv6CfgDialog(hwndDlg); fRetVal = FALSE; break; case WM_COMMAND: switch ( LOWORD(wParam) ) { case IDCANCEL: DestroyWindow(GetParent(hwndDlg)); break; default: break; } fRetVal = FALSE; break; case WM_DESTROY: bListViewInit = FALSE; break; default: fRetVal = FALSE; } return fRetVal; } // IPQuickCfgDialogProc
INT_PTR CALLBACK ListDlgPRoc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static HWND hList = NULL; static LVCOLUMN lvCol{ 0 }; static LVITEM lvItem{ 0 }; static CSettings* settings{ 0 }; switch (message) { case WM_INITDIALOG: InitCommonControls(); settings = reinterpret_cast<CSettings*>(lParam); EnumWindows(EnumWindowsProc, NULL); hList = CreateListView(hWnd); InitListView(hList); break; case WM_NOTIFY: return ListViewNotify(settings->spotify, hWnd, lParam, settings->program); case WM_SIZE: ResizeListView(hList, hWnd); break; case WM_COMMAND: if (LOWORD(wParam) == IDOK) { saveSelection(settings->spotify, hList, settings->program); EndDialog(hWnd, 0); } break; case WM_CLOSE: case WM_DESTROY: EndDialog(hWnd, 0); break; default: break; } return 0; }
void OnInitDialog() { btnOK->Enable(false); { CWaitCursor wc(this); // free the internal token list first, just in case we are being displayed twice FreeTokenInfo(); FetchTokenInfo(); InitListView(); } bInitialized = TRUE; // TODO: Implement me /* ARROWCURSOR; CWindow win; int heightChange; RECT oldRect = {0}, newRect = {0}; NONCLIENTMETRICS ncm; memset(&ncm, 0, sizeof(ncm)); ncm.cbSize = sizeof(ncm); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); HDC hDC = this->GetDC(); HANDLE hFont = ::CreateFontIndirect(&ncm.lfMessageFont); ::SelectObject(hDC, hFont); if (hFont) ::DeleteObject(hFont); // get the current size of the explanation control win.Attach(GetDlgItem(IDC_EXPLANATION)); win.GetWindowRect(&oldRect); // sometimes the width is calculated wrong, so we don't resize width int rightSide = oldRect.right; // calculate the height of the new text and find the delta heightChange = oldRect.bottom; ::DrawText(hDC, m_reason, m_reason.size(), &oldRect, DT_CALCRECT | DT_LEFT | DT_WORDBREAK); // | DT_NOPREFIX heightChange = oldRect.bottom - heightChange; this->ReleaseDC(hDC); // resize the explanation control using the new height and // change the text of the explanation control oldRect.right = rightSide; this->ScreenToClient(&oldRect); win.MoveWindow(&oldRect, TRUE); win.SetWindowText(myExplanation); win.Detach(); // resize the main dialog window this->GetWindowRect(&oldRect); oldRect.bottom += heightChange; this->MoveWindow(&oldRect, TRUE); // move the token list win.Attach(GetDlgItem(IDC_TOKEN_LIST)); win.GetWindowRect(&oldRect); this->ScreenToClient(&oldRect); oldRect.top += heightChange; oldRect.bottom += heightChange; win.MoveWindow(&oldRect, TRUE); win.Detach(); // move the refresh button win.Attach(GetDlgItem(IDREFRESH)); win.GetWindowRect(&oldRect); this->ScreenToClient(&oldRect); oldRect.top += heightChange; oldRect.bottom += heightChange; win.MoveWindow(&oldRect, TRUE); win.Detach(); // move the ok button win.Attach(GetDlgItem(wxID_OK)); win.GetWindowRect(&oldRect); this->ScreenToClient(&oldRect); oldRect.top += heightChange; oldRect.bottom += heightChange; win.MoveWindow(&oldRect, TRUE); win.Detach(); // move the cancel button win.Attach(GetDlgItem(wxID_CANCEL)); win.GetWindowRect(&oldRect); this->ScreenToClient(&oldRect); oldRect.top += heightChange; oldRect.bottom += heightChange; win.MoveWindow(&oldRect, TRUE); win.Detach(); */ // TODO: Implement change detection here //m_tokenChange = new TokenChangeDetector(hDlg); //m_tokenChangeCookie = gMonitor->RegisterChangeConsumer(m_tokenChange); //gConsumerCookieList.add(m_tokenChangeCookie); //SetTimer(hDlg, 1, 500, NULL); }