LRESULT CDfuFilterView::OnInitDialog(HWND /*hWnd*/, LPARAM /*lParam*/) { SetMsgHandled(false); DlgResize_Init(false,false); m_results = GetDlgItem(IDC_TREE_DFU); WTL::CImageList img, state; img.CreateFromImage(IDB_REP,16,0,RGB(255,0,255), IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS); img.SetBkColor(GetSysColor(COLOR_WINDOW)); state.CreateFromImage(IDB_REP_MASK, 8, 0, RGB(255,0,255), IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS); state.SetBkColor(GetSysColor(COLOR_WINDOW)); m_search = GetDlgItem(IDC_BUTTON_SEARCH); m_Tree = GetDlgItem(IDC_TREE_DFU); m_Tree.SetImageLists(img, state); return 0; }
LRESULT CVectorView::OnInitDialog(HWND /*hWnd*/, LPARAM /*lParam*/) { SetMsgHandled(false); DlgResize_Init(false,false); WTL::CImageList img, state; img.CreateFromImage(IDB_REP,16,0,RGB(255,0,255), IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS); img.SetBkColor(GetSysColor(COLOR_WINDOW)); ATLTRACE(_T("IDB_REP images=%d\n"), img.GetImageCount() ); state.CreateFromImage(IDB_REP_MASK, 8, 0, RGB(255,0,255), IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS); state.SetBkColor(GetSysColor(COLOR_WINDOW)); m_Tree = GetDlgItem(IDC_TREE_REPOSITORY); m_Tree.SetImageLists(img, state); DoDataExchange(); Refresh(); return 0; }
LRESULT CSyntaxView::OnInitDialog(HWND /*hWnd*/, LPARAM /*lParam*/) { SetMsgHandled(false); DlgResize_Init(false,false); m_list = GetDlgItem(IDC_LIST_SYNTAX); m_list.AddColumn(_T("Message"), 0); m_list.AddColumn(_T("Code"), 1); m_list.AddColumn(_T("Location"), 2); m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); boost::filesystem::path iniPath; GetIniPath(iniPath); CComPtr<IConfig> iniFile = CreateIConfig(QUERYBUILDER_INI, iniPath); m_checkErrors = iniFile->Get(GLOBAL_SYNTAX_SHOWERRORS); m_checkWarnings = iniFile->Get(GLOBAL_SYNTAX_SHOWWARNINGS); m_checkInformation = iniFile->Get(GLOBAL_SYNTAX_SHOWINFORMATION); DoDataExchange(); return 0; }
LRESULT LogWindow::OnInitDialog(HWND, LPARAM) { DlgResize_Init(false); _events.Attach(GetDlgItem(IDC_EVENTS)); _events.AddColumn(L"Type", 1); _events.AddColumn(L"Timestamp", 2); _events.AddColumn(L"Source", 3); _events.AddColumn(L"Message", 4); _events.SetImageList(_imageList, LVSIL_SMALL); _events.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); _events.SetColumnWidth(0, 75); _events.SetColumnWidth(1, 75); _events.SetColumnWidth(2, 100); _events.SetColumnWidth(3, LVSCW_AUTOSIZE_USEHEADER); WriteInfo(L"System", TEXT(OPENIM_VERSION_STRING) L" (built: " TEXT(OPENIM_BUILD_TIMESTAMP) L")", 0); return 0; }
LRESULT ConnectCameraDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DoDataExchange(DDX_LOAD); CenterWindow(GetParent()); DlgResize_Init(false, false); // load image lists { m_ilIcons.Create(16,15, ILC_MASK | ILC_COLOR32, 0, 0); CBitmap bmpIcons; bmpIcons.LoadBitmap(IDB_ICONS); m_ilIcons.Add(bmpIcons, RGB(255, 0, 255)); } // set up cameras list { m_lcCameras.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); m_lcCameras.SetImageList(m_ilIcons, LVSIL_SMALL); CRect rcCamera; m_lcCameras.GetClientRect(&rcCamera); m_lcCameras.InsertColumn(0, _T("Camera"), LVCFMT_LEFT, rcCamera.Width()); RefreshCameraList(); } if (m_lcCameras.GetItemCount() > 0) m_lcCameras.SelectItem(0); m_instance.AsyncWaitForCamera(std::bind(&ConnectCameraDlg::OnCameraAdded, this)); return TRUE; }
LRESULT CMapDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // center the dialog on the screen CenterWindow(); /* // set icons HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR); SetIcon(hIcon, TRUE); HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); SetIcon(hIconSmall, FALSE); */ DlgResize_Init(); m_Map.SubclassWindow(GetDlgItem(IDC_FRAME)); m_Map.MapInit(m_hWnd); GetDlgItem(IDC_LOADNAMES).ShowWindow (m_Map.m_pMainMap == 0 ); return TRUE; }
LRESULT CDetailDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // The dialog will be resizable, init resize map now. DlgResize_Init(); CErrorReportSender* pSender = CErrorReportSender::GetInstance(); // Mirror this window if RTL language is in use CString sRTL = pSender->GetLangStr(_T("Settings"), _T("RTLReading")); if(sRTL.CompareNoCase(_T("1"))==0) { Utility::SetLayoutRTL(m_hWnd); } // Set dialog caption text. SetWindowText(pSender->GetLangStr(_T("DetailDlg"), _T("DlgCaption"))); // Set up file preview control. m_previewMode = PREVIEW_AUTO; m_filePreview.SubclassWindow(GetDlgItem(IDC_PREVIEW)); m_filePreview.SetBytesPerLine(10); m_filePreview.SetEmptyMessage(pSender->GetLangStr(_T("DetailDlg"), _T("NoDataToDisplay"))); // Init "Privacy Policy" link. m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY)); m_linkPrivacyPolicy.SetHyperLink(pSender->GetCrashInfo()->m_sPrivacyPolicyURL); m_linkPrivacyPolicy.SetLabel(pSender->GetLangStr(_T("DetailDlg"), _T("PrivacyPolicy"))); if(!pSender->GetCrashInfo()->m_sPrivacyPolicyURL.IsEmpty()) m_linkPrivacyPolicy.ShowWindow(SW_SHOW); else m_linkPrivacyPolicy.ShowWindow(SW_HIDE); // Set up header text CStatic statHeader = GetDlgItem(IDC_HEADERTEXT); statHeader.SetWindowText(pSender->GetLangStr(_T("DetailDlg"), _T("DoubleClickAnItem"))); // Set up the list control m_list = GetDlgItem(IDC_FILE_LIST); m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); m_list.InsertColumn(0, pSender->GetLangStr(_T("DetailDlg"), _T("FieldName")), LVCFMT_LEFT, 150); m_list.InsertColumn(1, pSender->GetLangStr(_T("DetailDlg"), _T("FieldDescription")), LVCFMT_LEFT, 180); m_list.InsertColumn(3, pSender->GetLangStr(_T("DetailDlg"), _T("FieldSize")), LVCFMT_RIGHT, 60); // Init icons for the list m_iconList.Create(16, 16, ILC_COLOR32|ILC_MASK, 3, 1); m_list.SetImageList(m_iconList, LVSIL_SMALL); FillFileItemList(); // Init "Preview" static control m_statPreview = GetDlgItem(IDC_PREVIEWTEXT); m_statPreview.SetWindowText(pSender->GetLangStr(_T("DetailDlg"), _T("Preview"))); // Init "OK" button m_btnClose = GetDlgItem(IDOK); m_btnClose.SetWindowText(pSender->GetLangStr(_T("DetailDlg"), _T("Close"))); // Init "Export..." button m_btnExport = GetDlgItem(IDC_EXPORT); m_btnExport.SetWindowText(pSender->GetLangStr(_T("DetailDlg"), _T("Export"))); // center the dialog on the screen CenterWindow(); return TRUE; }
LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { g_Settings->RegisterChangeCB(Debugger_WaitingForStep, this, (CSettings::SettingChangedFunc)StaticWaitingForStepChanged); g_Settings->RegisterChangeCB(Debugger_SteppingOps, this, (CSettings::SettingChangedFunc)StaticSteppingOpsChanged); m_CommandList.Attach(GetDlgItem(IDC_CMD_LIST)); m_BreakpointList.Attach(GetDlgItem(IDC_BP_LIST)); m_AddressEdit.Attach(GetDlgItem(IDC_ADDR_EDIT)); m_PCEdit.Attach(GetDlgItem(IDC_PC_EDIT)); m_ViewPCButton.Attach(GetDlgItem(IDC_VIEWPC_BTN)); m_StepButton.Attach(GetDlgItem(IDC_STEP_BTN)); m_StepOverButton.Attach(GetDlgItem(IDC_STEPOVER_BTN)); m_SkipButton.Attach(GetDlgItem(IDC_SKIP_BTN)); m_GoButton.Attach(GetDlgItem(IDC_GO_BTN)); m_RegisterTabs.Attach(GetDlgItem(IDC_REG_TABS)); m_Scrollbar.Attach(GetDlgItem(IDC_SCRL_BAR)); m_BackButton.Attach(GetDlgItem(IDC_BACK_BTN)); m_ForwardButton.Attach(GetDlgItem(IDC_FORWARD_BTN)); m_OpEdit.Attach(GetDlgItem(IDC_OP_EDIT)); DlgResize_Init(false, true); DlgToolTip_Init(); GetWindowRect(&m_DefaultWindowRect); // Setup address input m_AddressEdit.SetDisplayType(CEditNumber32::DisplayHex); m_AddressEdit.SetLimitText(8); // Setup PC register input m_PCEdit.SetDisplayType(CEditNumber32::DisplayHex); m_PCEdit.SetLimitText(8); m_bIgnorePCChange = true; m_PCEdit.SetValue(0x80000180, false, true); // Setup View PC button m_ViewPCButton.EnableWindow(FALSE); m_StepButton.EnableWindow(FALSE); m_StepOverButton.EnableWindow(FALSE); m_SkipButton.EnableWindow(FALSE); m_GoButton.EnableWindow(FALSE); // Setup breakpoint list m_BreakpointList.ModifyStyle(NULL, LBS_NOTIFY); RefreshBreakpointList(); // Setup list scrollbar m_Scrollbar.SetScrollRange(0, 100, FALSE); m_Scrollbar.SetScrollPos(50, TRUE); // Setup history buttons ToggleHistoryButtons(); // Op editor m_OpEdit.SetCommandsWindow(this); m_bIgnoreAddrChange = true; m_AddressEdit.SetValue(0x80000000, false, true); ShowAddress(0x80000000, TRUE); if (isStepping()) { m_ViewPCButton.EnableWindow(TRUE); m_StepButton.EnableWindow(TRUE); m_StepOverButton.EnableWindow(TRUE); m_SkipButton.EnableWindow(TRUE); m_GoButton.EnableWindow(TRUE); } _this = this; DWORD dwThreadID = ::GetCurrentThreadId(); hWinMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)HookProc, NULL, dwThreadID); WindowCreated(); m_Attached = true; return TRUE; }
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(); // center the dialog on the screen CenterWindow(); sAppTooltip="MtConnectDboard"; nIcon=0; // set icons HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR); SetIcon(hIcon, TRUE); HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); SetIcon(hIconSmall, FALSE); // register object for message filtering and idle updates //CMessageLoop* pLoop = _Module.GetMessageLoop(); CMessageLoop* pLoop = _thread->GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); UIAddChildWindowContainer(m_hWnd); // Remove Max/Min buttons - if using TrayIcon DWORD style = ::GetWindowLong(this->m_hWnd, GWL_STYLE); style &= ~(WS_MAXIMIZEBOX); // WS_MINIMIZEBOX NOT WS_THICKFRAME ::SetWindowLong(this->m_hWnd, GWL_STYLE, style); // Install tray icon hSmileyIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME)); hIdleIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_IDLEICON)); hStopIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOPICON)); hClearIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_CLEARICON)); InstallIcon(sAppTooltip, hSmileyIcon, IDR_MENU1); CAxWindow wndIE = GetDlgItem(IDC_EXPLORER1); HRESULT hr; hr = wndIE.QueryControl ( &m_spWebBrowser ); if ( m_spWebBrowser ) { CComVariant v; // empty variant m_spWebBrowser->Navigate ( CComBSTR("about:blank"), &v, &v, &v, &v ); } //Handle NavigateComplete2 event from the browser, get the document element, call DispEventAdvise(pDocument). onclick event bubbles, so you can handle it on the document and get clicks from all contained elements. //DispEventAdvise(m_spWebBrowser); //Then you need to register your interface to be used proccess wide: hr = pGIT->RegisterInterfaceInGlobal( (IUnknown*)(IWebBrowser2*)m_spWebBrowser, IID_IWebBrowser2, &dwWebBrowserCookie); //std::string html = MTConnectStreamsParser().CreateHtmlDocument(); //CHtmlTableSnapshots().SetDocumentText(m_spWebBrowser,html); // Icon mapping std::vector<HICON> icons(2); icons[0]=hSmileyIcon; icons[1]=hClearIcon; StateIconMap["EXECUTING"] = icons; // flashing green icons[0]=hSmileyIcon; icons[1]=hSmileyIcon; StateIconMap["IDLE"] = icons; // idle auto icons[0]=hStopIcon; icons[1]=hStopIcon; StateIconMap["STOPPED"] = icons; // stopped icons[0]=hStopIcon; icons[1]=hClearIcon; StateIconMap["FAULT"] = icons; // stopped fault this->SetTimer(1, 250); dlgMainThead = ::GetCurrentThread(); return TRUE; }
LRESULT CShdrFileEchoView::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { DlgResize_Init(); return TRUE; }
LRESULT CDlgTranscode::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { DoDataExchange();//m_BtnSt.SubclassWindow(GetDlgItem(IDC_BTN_ST)); DlgResize_Init(FALSE); HRESULT hr = E_FAIL; static const GUID CLSID_H264EncMs = { 0x6ca50344, 0x051a, 0x4ded, { 0x97, 0x79, 0xa4, 0x33, 0x05, 0x16, 0x5e, 0x35 } }; //{98230571-0087-4204-b020-3282538e57d3} static const GUID CLISD_ColorConvertDMO = { 0x98230571, 0x0087, 0x4204, { 0xb0, 0x20, 0x32, 0x82, 0x53, 0x8e, 0x57, 0xd3 } }; CComPtr<IUnknown> spColorConvertDMO; COM_VERIFY(CoCreateInstance(CLISD_ColorConvertDMO, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID*)&spColorConvertDMO)); if (spColorConvertDMO) { COM_DETECT_INTERFACE_FROM_LIST(spColorConvertDMO); } CComPtr<IUnknown> spUnknown; COM_VERIFY(CoCreateInstance(CLSID_H264EncMs, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID*)&spUnknown)); if (spUnknown) { COM_DETECT_INTERFACE_FROM_LIST(spUnknown); CComQIPtr<IMFTransform> spTransform(spUnknown); //COM_DETECT_INTERFACE_FROM_REGISTER(spUnknown); } //DMO_PARTIAL_MEDIATYPE mediaType; CComPtr<IEnumDMO> spDMOList; //mediaType.type = GUID_NULL; //mediaType.subtype = GUID_NULL; IMFActivate** ppActivates = NULL; UINT32 cMFTs = 0; ::MFTEnumEx(MFT_CATEGORY_VIDEO_ENCODER, MFT_ENUM_FLAG_ALL, NULL, NULL, &ppActivates, &cMFTs); for(DWORD i = 0; i < cMFTs; i++) { //m_Activates.Add(ppActivates[i]); LPWSTR pszName = NULL; ppActivates[i]->GetAllocatedString(MFT_FRIENDLY_NAME_Attribute, &pszName, NULL); //m_strNames.Add(CAtlStringW(pszName)); //item.pszText = m_strNames.GetAt(m_strNames.GetCount() - 1).GetBuffer(); //item.lParam = (LPARAM) m_Activates.GetCount() - 1; //treeInserter.item = item; //TreeView_InsertItem(m_hList, &treeInserter); CoTaskMemFree(pszName); } CoTaskMemFree(ppActivates); return 1; // Let the system set the focus }
LRESULT CBookmarksView::OnInitDialog(HWND /*hWnd*/, LPARAM /*lParam*/) { SetMsgHandled(false); DlgResize_Init(false, false); CRect rc(0, 0, 0, 0); CWindow wndPlaceholder = GetDlgItem(IDC_BOOKMARKS_PLACEHOLDER); wndPlaceholder.GetWindowRect(rc); ScreenToClient(rc); wndPlaceholder.DestroyWindow(); const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; if (!m_list.Create(dwViewStyle, rc, CWnd::FromHandle(m_hWnd), IDC_BOOKMARKS_PLACEHOLDER)) { TRACE0("Failed to create Class View\n"); return -1; // fail to create } m_list.SetOwner(CWnd::FromHandle(m_hWnd)); m_list.m_sortedCol = 0; m_list.m_sortAscending = false; m_list.SetExtendedStyle(m_list.GetExtendedStyle() | LVS_EX_FULLROWSELECT); m_list.EnableMultipleSort(true); int col = 0; m_list.InsertColumn(col++, _T("Line")); m_list.InsertColumn(col++, _T("Type")); m_list.InsertColumn(col++, _T("User")); m_list.InsertColumn(col++, _T("Module")); m_list.InsertColumn(col++, _T("Attribute")); m_list.InsertColumn(col++, _T("Attr Type")); m_list.InsertColumn(col++, _T("Description")); for (int i = 0; i < col; ++i) { m_list.SetColumnWidth(i, LVSCW_AUTOSIZE_USEHEADER); } if (!m_listMaster.Create(dwViewStyle, rc, CWnd::FromHandle(m_hWnd), IDC_BOOKMARKS_PLACEHOLDER)) { TRACE0("Failed to create Class View\n"); return -1; // fail to create } col = 0; m_listMaster.InsertColumn(col++, _T("Line")); m_listMaster.InsertColumn(col++, _T("Type")); m_listMaster.InsertColumn(col++, _T("User")); m_listMaster.InsertColumn(col++, _T("Module")); m_listMaster.InsertColumn(col++, _T("Attribute")); m_listMaster.InsertColumn(col++, _T("Attr Type")); m_listMaster.InsertColumn(col++, _T("Description")); boost::filesystem::path iniPath; GetIniPath(iniPath); CComPtr<IConfig> iniFile = CreateIConfig(QUERYBUILDER_INI, iniPath); m_checkMine = iniFile->Get(GLOBAL_BOOKMARKS_SHOWMINE); m_checkTodos = iniFile->Get(GLOBAL_BOOKMARKS_SHOWTODOS); m_checkHacks = iniFile->Get(GLOBAL_BOOKMARKS_SHOWHACKS); m_list.m_sortedCol = iniFile->Get(GLOBAL_BOOKMARKS_SORTCOLUMN); m_list.m_sortAscending = iniFile->Get(GLOBAL_BOOKMARKS_SORTASCENDING); DoDataExchange(); return 0; }
LRESULT CResendDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { CString sRTL = Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("Settings"), _T("RTLReading")); if(sRTL.CompareNoCase(_T("1"))==0) { Utility::SetLayoutRTL(m_hWnd); } CString sTitle; sTitle.Format(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("DlgCaption")), g_CrashInfo.m_sAppName); SetWindowText(sTitle); // center the dialog on the screen CenterWindow(); // Set window icon HICON hIcon = g_CrashInfo.GetCustomIcon(); if(!hIcon) hIcon = ::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME)); SetIcon(hIcon, 0); // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); m_statText = GetDlgItem(IDC_TEXT); m_statText.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("ClickForDetails"))); m_statSize = GetDlgItem(IDC_SELSIZE); m_statSize.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("SelectedSize"))); m_btnSendNow = GetDlgItem(IDOK); m_btnSendNow.SetWindowText(Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("SendNow"))); m_btnOtherActions = GetDlgItem(IDC_OTHERACTIONS); m_btnOtherActions.SetWindowText(Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("OtherActions"))); m_btnShowLog = GetDlgItem(IDC_SHOWLOG); m_btnShowLog.SetWindowText(Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("ShowLog"))); m_btnShowLog.ShowWindow(SW_HIDE); // Init list control m_listReportsSort.SubclassWindow(GetDlgItem(IDC_LIST)); m_listReports.SubclassWindow(m_listReportsSort.m_hWnd); m_listReports.InsertColumn(0, Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("ColumnCreationDate")), LVCFMT_LEFT, 170); m_listReports.InsertColumn(1, Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("ColumnSize")), LVCFMT_RIGHT, 90); m_listReports.InsertColumn(2, Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("ColumnStatus")), LVCFMT_LEFT, 170); m_listReports.ModifyStyleEx(0, LVS_EX_FULLROWSELECT); m_listReportsSort.SetSortColumn(0); // Sort by creation date int i; for(i=0; i<g_CrashInfo.GetReportCount(); i++) { ErrorReportInfo& eri = g_CrashInfo.GetReport(i); SYSTEMTIME st; Utility::UTC2SystemTime(eri.m_sSystemTimeUTC, st); CString sCreationDate; sCreationDate.Format(_T("%04d-%02d-%02d %02d:%02d:%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond); int nItem = m_listReports.InsertItem(i, sCreationDate); m_listReports.SetItemData(nItem, i); CString sTotalSize = Utility::FileSizeToStr(eri.m_uTotalSize); m_listReports.SetItemText(nItem, 1, sTotalSize); if(eri.m_bSelected) m_listReports.SetCheckState(nItem, TRUE); } UpdateSelectionSize(); m_statConsent = GetDlgItem(IDC_CONSENT); LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); lf.lfHeight = 11; lf.lfWeight = FW_NORMAL; lf.lfQuality = ANTIALIASED_QUALITY; _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma")); CFontHandle hConsentFont; hConsentFont.CreateFontIndirect(&lf); m_statConsent.SetFont(hConsentFont); if(g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty()) { m_statConsent.SetWindowText( Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("MyConsent2"))); } else { m_statConsent.SetWindowText( Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("ResendDlg"), _T("MyConsent"))); } m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY)); m_linkPrivacyPolicy.SetHyperLink(g_CrashInfo.m_sPrivacyPolicyURL); m_linkPrivacyPolicy.SetLabel(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("PrivacyPolicy"))); m_linkPrivacyPolicy.ShowWindow(g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty()?SW_HIDE:SW_SHOW); m_dlgProgress.Create(m_hWnd); m_dlgProgress.ShowWindow(SW_HIDE); m_dlgActionProgress.m_pParent = this; m_dlgActionProgress.Create(m_hWnd); m_dlgActionProgress.SetWindowLong(GWL_ID, IDD_PROGRESSMULTI); CRect rc; m_listReports.GetWindowRect(&rc); ScreenToClient(&rc); m_dlgActionProgress.SetWindowPos(HWND_TOP, rc.left, rc.bottom, 0, 0, SWP_NOZORDER|SWP_NOSIZE); DlgResize_Init(); m_bSendingNow = FALSE; m_bCancelled = FALSE; m_MailClientConfirm = NOT_CONFIRMED_YET; m_fileLog = NULL; m_ActionOnClose = EXIT; if(g_CrashInfo.m_bSilentMode) { BOOL bHandled; OnSendNow(0, 0, 0, bHandled); } else { // Show balloon in 3 seconds. m_nTick = 0; SetTimer(0, 3000); } return TRUE; }
LRESULT CDetailDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(); CString sRTL = Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("Settings"), _T("RTLReading")); if(sRTL.CompareNoCase(_T("1"))==0) { Utility::SetLayoutRTL(m_hWnd); } SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("DlgCaption"))); m_previewMode = PREVIEW_AUTO; m_filePreview.SubclassWindow(GetDlgItem(IDC_PREVIEW)); m_filePreview.SetBytesPerLine(10); m_filePreview.SetEmptyMessage(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("NoDataToDisplay"))); m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY)); m_linkPrivacyPolicy.SetHyperLink(g_CrashInfo.m_sPrivacyPolicyURL); m_linkPrivacyPolicy.SetLabel(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("PrivacyPolicy"))); if(!g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty()) m_linkPrivacyPolicy.ShowWindow(SW_SHOW); else m_linkPrivacyPolicy.ShowWindow(SW_HIDE); CStatic statHeader = GetDlgItem(IDC_HEADERTEXT); statHeader.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("DoubleClickAnItem"))); m_list = GetDlgItem(IDC_FILE_LIST); m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); m_list.InsertColumn(0, Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("FieldName")), LVCFMT_LEFT, 150); m_list.InsertColumn(1, Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("FieldDescription")), LVCFMT_LEFT, 180); m_list.InsertColumn(3, Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("FieldSize")), LVCFMT_RIGHT, 60); m_iconList.Create(16, 16, ILC_COLOR32|ILC_MASK, 3, 1); m_list.SetImageList(m_iconList, LVSIL_SMALL); // Insert items WIN32_FIND_DATA findFileData = {0}; HANDLE hFind = NULL; CString sSize; std::map<CString, ERIFileItem>::iterator p; unsigned i; for (i = 0, p = g_CrashInfo.GetReport(m_nCurReport).m_FileItems.begin(); p != g_CrashInfo.GetReport(m_nCurReport).m_FileItems.end(); p++, i++) { CString sDestFile = p->first; CString sSrcFile = p->second.m_sSrcFile; CString sFileDesc = p->second.m_sDesc; SHFILEINFO sfi; SHGetFileInfo(sSrcFile, 0, &sfi, sizeof(sfi), SHGFI_DISPLAYNAME | SHGFI_ICON | SHGFI_TYPENAME | SHGFI_SMALLICON); int iImage = -1; if(sfi.hIcon) { iImage = m_iconList.AddIcon(sfi.hIcon); DestroyIcon(sfi.hIcon); } int nItem = m_list.InsertItem(i, sDestFile, iImage); CString sFileType = sfi.szTypeName; m_list.SetItemText(nItem, 1, sFileDesc); hFind = FindFirstFile(sSrcFile, &findFileData); if (INVALID_HANDLE_VALUE != hFind) { FindClose(hFind); ULARGE_INTEGER lFileSize; lFileSize.LowPart = findFileData.nFileSizeLow; lFileSize.HighPart = findFileData.nFileSizeHigh; sSize = Utility::FileSizeToStr(lFileSize.QuadPart); m_list.SetItemText(nItem, 2, sSize); } } m_list.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED); m_statPreview = GetDlgItem(IDC_PREVIEWTEXT); m_statPreview.SetWindowText(Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("Preview"))); m_btnClose = GetDlgItem(IDOK); m_btnClose.SetWindowText(Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("Close"))); m_btnExport = GetDlgItem(IDC_EXPORT); m_btnExport.SetWindowText(Utility::GetINIString( g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("Export"))); // center the dialog on the screen CenterWindow(); return TRUE; }
LRESULT PlanetInfoView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(false, true); return 1; }
LRESULT CPlayList::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // Init the CDialogResize code DlgResize_Init(); //Bind keys... m_haccelerator = AtlLoadAccelerators(IDR_ACCELERATORS_PLAYLIST); // bind buttons with objects btnAdd.Attach(GetDlgItem(IDC_BTN_ADD)); btnRemove.Attach(GetDlgItem(IDC_BTN_REMOVE)); btnAddFolder.Attach(GetDlgItem(IDC_BTN_ADDFOLDER)); btnLoadPlayList.Attach(GetDlgItem(IDC_BTN_LOADPL)); btnSavePlayList.Attach(GetDlgItem(IDC_BTN_SAVEPL)); btnPrevMod.Attach(GetDlgItem(IDC_BTN_PREVMODULE)); btnPlayMod.Attach(GetDlgItem(IDC_BTN_PLAYSELECTION)); btnNextMod.Attach(GetDlgItem(IDC_BTN_NEXTMODULE)); HINSTANCE inst = _Module.GetResourceInstance(); // load & set button icons HICON icon = (HICON) ::LoadImage(inst, MAKEINTRESOURCE(IDI_ICON_OPEN), IMAGE_ICON, 16, 16, LR_SHARED); btnLoadPlayList.SetIcon(icon); icon = (HICON) ::LoadImage(inst, MAKEINTRESOURCE(IDI_ICON_SAVE), IMAGE_ICON, 16, 16, LR_SHARED); btnSavePlayList.SetIcon(icon); icon = (HICON) ::LoadImage(inst, MAKEINTRESOURCE(IDI_ICON_PREV), IMAGE_ICON, 16, 16, LR_SHARED); btnPrevMod.SetIcon(icon); icon = (HICON) ::LoadImage(inst, MAKEINTRESOURCE(IDI_ICON_PLAY), IMAGE_ICON, 16, 16, LR_SHARED); btnPlayMod.SetIcon(icon); icon = (HICON) ::LoadImage(inst, MAKEINTRESOURCE(IDI_ICON_NEXT), IMAGE_ICON, 16, 16, LR_SHARED); btnNextMod.SetIcon(icon); // UINT uCToolTipCtrlStyle = TTS_NOPREFIX |TTS_NOFADE | TTS_NOANIMATE; // | TTS_BALLOON UINT uToolFlags = TTF_IDISHWND | TTF_SUBCLASS; ATLVERIFY(NULL != m_wndToolTip[0].Create(m_hWnd, 0, NULL, uCToolTipCtrlStyle)); // WS_POPUP|TTS_NOPREFIX|TTS_NOFADE|TTS_NOANIMATE CToolInfo toolInfo(uToolFlags, btnAdd.m_hWnd, 0, 0, _T("Add file(s)")); m_wndToolTip[0].AddTool(&toolInfo); m_wndToolTip[0].SetDelayTime(TTDT_INITIAL,0); m_wndToolTip[0].SetDelayTime(TTDT_RESHOW,0); m_wndToolTip[0].Activate(TRUE); ATLVERIFY(NULL != m_wndToolTip[1].Create(m_hWnd, 0, NULL, uCToolTipCtrlStyle)); toolInfo.Init(uToolFlags, btnRemove.m_hWnd, 0, 0, _T("Remove File(s)")); m_wndToolTip[1].AddTool(&toolInfo); m_wndToolTip[1].Activate(TRUE); ATLVERIFY(NULL != m_wndToolTip[2].Create(m_hWnd, 0, NULL, uCToolTipCtrlStyle)); toolInfo.Init(uToolFlags, btnAddFolder.m_hWnd, 0, 0, _T("Add Folder")); m_wndToolTip[2].AddTool(&toolInfo); m_wndToolTip[2].Activate(TRUE); // Create the listview columns playListView.Attach(GetDlgItem(IDC_LSV1)); playListView.SetView(LV_VIEW_DETAILS); // FIXME doesnt work //playListView.SetExtendedListViewStyle(LVS_SHOWSELALWAYS); playListView.AddColumn(_T("Filename"), LV_FIELD_FILENAME); playListView.SetColumnWidth(LV_FIELD_FILENAME, 150); // playListView.AddColumn(_T("Title"), LV_FIELD_TITLE); playListView.SetColumnWidth(LV_FIELD_TITLE, 120); // playListView.AddColumn(_T("Author"), LV_FIELD_AUTHOR); playListView.SetColumnWidth(LV_FIELD_TITLE, 250); // playListView.AddColumn(_T("Released"), LV_FIELD_RELEASED); playListView.SetColumnWidth(LV_FIELD_TITLE, 200); // playListView.AddColumn(_T("Path"), LV_FIELD_PATH); playListView.SetColumnWidth(LV_FIELD_PATH, 300); // playListView.AddColumn(_T("Status"), LV_FIELD_STATUS); playListView.SetColumnWidth(LV_FIELD_STATUS, 50); // playListView.AddColumn(_T("Type"), LV_FIELD_TYPE); playListView.SetColumnWidth(LV_FIELD_TYPE, 50); // playListView.AddColumn(_T("Load address"), LV_FIELD_LOAD_ADDRESS); playListView.SetColumnWidth(LV_FIELD_LOAD_ADDRESS, 32); // playListView.AddColumn(_T("#"), LV_FIELD_INDEX); playListView.SetColumnWidth(LV_FIELD_INDEX, 32); // register hotkeys for the playlist ::RegisterHotKey(m_hWnd, 1, MOD_ALT | MOD_CONTROL, VK_RIGHT); ::RegisterHotKey(m_hWnd, 2, MOD_ALT | MOD_CONTROL, VK_LEFT); // // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); return TRUE; }
LRESULT CHistoryWindow::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { CenterWindow(); DlgResize_Init(); m_treeView.SubclassWindow(GetDlgItem(IDC_HISTORYTREE)); m_treeView.onThreadsFinished.bind(this, &CHistoryWindow::threadsFinished); m_treeView.onThreadsStarted.bind(this, &CHistoryWindow::threadsStarted); TRC(IDCANCEL, "Закрыть"); TRC(IDC_SESSIONSCOUNTDESCR, "Всего сессий:"); TRC(IDC_FILESCOUNTDESCR, "Всего файлов:"); TRC(IDC_UPLOADTRAFFICDESCR, "Общий объем:"); SetWindowText(TR("История загрузок")); TRC(IDC_TIMEPERIODLABEL, "Период времени:"); TRC(IDC_DOWNLOADTHUMBS, "Загружать миниатюры из Интернета"); HWND hWnd = GetDlgItem(IDC_ANIMATIONSTATIC); if (hWnd) { m_wndAnimation.SubclassWindow(hWnd); if (m_wndAnimation.Load(MAKEINTRESOURCE(IDR_PROGRESSGIF),_T("GIF"))) m_wndAnimation.Draw(); m_wndAnimation.ShowWindow(SW_HIDE); } std::string fName = ZBase::get()->historyManager()->makeFileName(); std::vector<CString> files; historyFolder = IuCoreUtils::Utf8ToWstring(Settings.SettingsFolder).c_str()+CString(_T("\\History\\")); WinUtils::GetFolderFileList(files, historyFolder , _T("history*.xml")); pcrepp::Pcre regExp("history_(\\d+)_(\\d+)", "imcu"); for(size_t i=0; i<files.size(); i++) { m_HistoryFiles.push_back(files[i]); CString monthLabel = Utf8ToWCstring( IuCoreUtils::ExtractFileNameNoExt(WCstringToUtf8 (files[i]))); size_t pos = 0; if ( regExp.search(WCstringToUtf8(monthLabel), pos) ) { std::string yearStr = regExp[0]; std::string monthStr = regExp[1]; int year = atoi(yearStr.c_str()); int month = atoi(monthStr.c_str()); monthLabel.Format(_T("%d/%02d"), year, month); } else { monthLabel.Replace(_T("history_"), _T("")); monthLabel.Replace(_T("_"), _T("/")); } int newItemIndex = SendDlgItemMessage(IDC_MONTHCOMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)monthLabel); if ( newItemIndex >=0 ) { SendDlgItemMessage(IDC_MONTHCOMBO, CB_SETITEMDATA, newItemIndex, (LPARAM)i); } } int selectedIndex = files.size()-1; SendDlgItemMessage(IDC_MONTHCOMBO, CB_SETCURSEL, selectedIndex, 0); SendDlgItemMessage(IDC_DOWNLOADTHUMBS, BM_SETCHECK, (WPARAM)Settings.HistorySettings.EnableDownloading); BOOL bDummy; OnMonthChanged(0,0, 0,bDummy); m_treeView.SetFocus(); return 1; // Let the system set the focus }
LRESULT CServerParamsDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { CenterWindow(GetParent()); TRC(IDCANCEL, "Отмена"); TRC(IDOK, "OK"); TRC(IDC_LOGINLABEL, "Логин:"); TRC(IDC_PASSWORDLABEL, "Пароль:"); TRC(IDC_DOAUTH, "Выполнять авторизацию"); TRC(IDC_FOLDERLABEL, "Папка/альбом:"); TRC(IDC_BROWSESERVERFOLDERS, "Выбрать..."); TRC(IDC_PARAMETERSLABEL, "Параметры:"); DlgResize_Init(); CString WindowTitle; CString serverName = Utf8ToWCstring(m_ue->Name); WindowTitle.Format(TR("Параметры сервера %s"),(LPCTSTR)serverName); SetWindowText(WindowTitle); GuiTools::ShowDialogItem(m_hWnd, IDC_BROWSESERVERFOLDERS, m_ue->SupportsFolders); GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERLABEL, m_ue->SupportsFolders); GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERNAMELABEL, m_ue->SupportsFolders); ::EnableWindow(GetDlgItem(IDC_BROWSESERVERFOLDERS), m_ue->SupportsFolders); GuiTools::ShowDialogItem(m_hWnd, IDC_DOAUTH, m_ue->NeedAuthorization == CUploadEngineData::naAvailable ); GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERLABEL, m_ue->SupportsFolders ); GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERNAMELABEL, m_ue->SupportsFolders ); GuiTools::ShowDialogItem(m_hWnd, IDC_BROWSESERVERFOLDERS, m_ue->SupportsFolders ); GuiTools::ShowDialogItem(m_hWnd, IDC_FOLDERICON, m_ue->SupportsFolders ); ServerSettingsStruct &serverSettings = serverProfile_.serverSettings(); LoginInfo li = serverSettings.authData; SetDlgItemText(IDC_LOGINEDIT, Utf8ToWCstring(li.Login)); oldLogin_ = Utf8ToWCstring(li.Login); SetDlgItemText(IDC_PASSWORDEDIT, Utf8ToWCstring(li.Password)); SendDlgItemMessage(IDC_DOAUTH, BM_SETCHECK, (li.DoAuth ? BST_CHECKED : BST_UNCHECKED)); doAuthChanged(); int result = 1; if ( focusOnLoginControl_ && m_ue->NeedAuthorization ) { GuiTools::SetCheck(m_hWnd, IDC_DOAUTH, true); doAuthChanged(); ::SetFocus(GetDlgItem(IDC_LOGINEDIT) ); SendDlgItemMessage(IDC_LOGINEDIT, EM_SETSEL, 0, -1); result = 0; } GuiTools::EnableDialogItem(m_hWnd, IDC_BROWSESERVERFOLDERS, !oldLogin_.IsEmpty()); m_wndParamList.SubclassWindow(GetDlgItem(IDC_PARAMLIST)); m_wndParamList.SetExtendedListStyle(PLS_EX_SHOWSELALWAYS | PLS_EX_SINGLECLICKEDIT); m_pluginLoader = iuPluginManager.getPlugin(m_ue->Name, m_ue->PluginName,serverSettings); if(!m_pluginLoader) { return 0; } m_pluginLoader->getServerParamList(m_paramNameList); std::map<std::string,std::string>::iterator it; for( it = m_paramNameList.begin(); it!= m_paramNameList.end(); ++it) { CString name = it->first.c_str(); CString humanName = it->second.c_str(); m_wndParamList.AddItem( PropCreateSimple(humanName, Utf8ToWCstring(serverSettings.params[WCstringToUtf8(name)])) ); } CString folderTitle = Utf8ToWCstring( serverProfile_.folderTitle()) ; SetDlgItemText(IDC_FOLDERNAMELABEL, folderTitle.IsEmpty() ? (CString("<") + TR("не выбран") + CString(">")) : folderTitle); return 1; // Let the system set the focus }