Esempio n. 1
0
/**
 * @brief WM_INITDIALOG handler of Send Mail dialog.
 * @param hwnd - window handle.
 * @param hwndFocus - system-defined focus window.
 * @param lParam - user-defined parameter.
 * @return true to setup focus to system-defined control.
 */
static BOOL SendMailDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	lParam; hwndFocus;
	HWND hwndCtl;
	_ASSERTE(g_pResManager != NULL);
	if (g_pResManager->m_hBigAppIcon)
		SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)g_pResManager->m_hBigAppIcon);
	if (g_pResManager->m_hSmallAppIcon)
		SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)g_pResManager->m_hSmallAppIcon);
	CenterWindow(hwnd, GetParent(hwnd));
	g_LayoutMgr.InitLayout(hwnd, g_arrSendMailLayout, countof(g_arrSendMailLayout));

	if (g_dwFlags & BTF_ATTACHREPORT)
	{
		TCHAR szFileName[MAX_PATH];
		g_pSymEngine->GetReportFileName(szFileName, countof(szFileName));
		hwndCtl = GetDlgItem(hwnd, IDC_ATTACHMENT);
		SetWindowText(hwndCtl, szFileName);
	}

	hwndCtl = GetDlgItem(hwnd, IDC_RECIPIENT);
	SetWindowText(hwndCtl, g_szSupportEMail);

	TCHAR szSubject[MAX_PATH];
	GetDefaultMailSubject(szSubject, countof(szSubject));
	hwndCtl = GetDlgItem(hwnd, IDC_SUBJECT);
	SetWindowText(hwndCtl, szSubject);

	hwndCtl = GetDlgItem(hwnd, IDC_BODY);
	SetFocus(hwndCtl);
	return FALSE;
}
Esempio n. 2
0
/**
 * @brief WM_SIZE handler of Machine State dialog.
 * @param hwnd - window handle.
 * @param state - window state.
 * @param cx - window width.
 * @param cy - window height.
 */
static void MachineStateDlg_OnSize(HWND hwnd, UINT state, int cx, int cy)
{
    hwnd;
    cx;
    cy;
    state;
    g_LayoutMgr.ApplyLayout();
}
Esempio n. 3
0
/**
 * @brief WM_INITDIALOG handler of Send Mail dialog.
 * @param hwnd - window handle.
 * @param hwndFocus - system-defined focus window.
 * @param lParam - user-defined parameter.
 * @return true to setup focus to system-defined control.
 */
static BOOL DescribeErrorDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	lParam; hwndFocus;
	HWND hwndCtl;
	if (g_pResManager->m_hBigAppIcon)
		SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)g_pResManager->m_hBigAppIcon);
	if (g_pResManager->m_hSmallAppIcon)
		SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)g_pResManager->m_hSmallAppIcon);
	CenterWindow(hwnd, GetParent(hwnd));
	g_LayoutMgr.InitLayout(hwnd, g_arrDescribeErrorLayout, countof(g_arrDescribeErrorLayout));

	hwndCtl = GetDlgItem(hwnd, IDC_DETAILS);
	SetFocus(hwndCtl);
	return FALSE;
}
Esempio n. 4
0
/**
 * @brief WM_INITDIALOG handler of Preview dialog.
 * @param hwnd - window handle.
 * @param hwndFocus - system-defined focus window.
 * @param lParam - user-defined parameter.
 * @return true to setup focus to system-defined control.
 */
static BOOL PreviewDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	lParam; hwndFocus;

	if (g_pResManager->m_hBigAppIcon)
		SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)g_pResManager->m_hBigAppIcon);
	if (g_pResManager->m_hSmallAppIcon)
		SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)g_pResManager->m_hSmallAppIcon);
	CenterWindow(hwnd, GetParent(hwnd));

	g_hImageList = ImageList_LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_IMAGETOOLBAR), 16, 0, RGB(0xC0, 0xC0, 0xC0));
	HWND hwndImgToolbar = GetDlgItem(hwnd, IDC_IMAGE_COMMANDS);
	LONG lStyle = GetWindowLong(hwndImgToolbar, GWL_STYLE);
	SetWindowLong(hwndImgToolbar, GWL_STYLE, lStyle | CCS_NODIVIDER | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS);
	SendMessage(hwndImgToolbar, TB_SETIMAGELIST, 0, (LPARAM)g_hImageList);
	SendMessage(hwndImgToolbar, TB_ADDBUTTONS, countof(g_arrButtons), (LPARAM)g_arrButtons);

	HWND hwndFileList = GetDlgItem(hwnd, IDC_FILESLIST);
	ListView_SetExtendedListViewStyle(hwndFileList, LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);

	RECT rcList;
	GetClientRect(hwndFileList, &rcList);
	rcList.right -= GetSystemMetrics(SM_CXHSCROLL);

	TCHAR szColumnTitle[64];
	LVCOLUMN lvc;
	ZeroMemory(&lvc, sizeof(lvc));
	lvc.mask = LVCF_TEXT | LVCF_WIDTH;
	lvc.pszText = szColumnTitle;

	lvc.cx = rcList.right / 2;
	LoadString(g_hInstance, IDS_COLUMN_FILE, szColumnTitle, countof(szColumnTitle));
	ListView_InsertColumn(hwndFileList, CID_FILE_NAME, &lvc);

	lvc.cx = rcList.right / 4;
	LoadString(g_hInstance, IDS_COLUMN_TYPE, szColumnTitle, countof(szColumnTitle));
	ListView_InsertColumn(hwndFileList, CID_FILE_TYPE, &lvc);

	lvc.cx = rcList.right / 4;
	LoadString(g_hInstance, IDS_COLUMN_SIZE, szColumnTitle, countof(szColumnTitle));
	ListView_InsertColumn(hwndFileList, CID_FILE_SIZE, &lvc);

	g_hFile = INVALID_HANDLE_VALUE;
	g_hBitmap = NULL;
	g_eFileViewType = FVT_NONE;

	if (g_dwFlags & BTF_DETAILEDMODE)
	{
		TCHAR szFindFileTemplate[MAX_PATH];
		PathCombine(szFindFileTemplate, g_szInternalReportFolder, _T("*"));
		WIN32_FIND_DATA FindData;
		HANDLE hFindFile = FindFirstFile(szFindFileTemplate, &FindData);
		if (hFindFile != INVALID_HANDLE_VALUE)
		{
			BOOL bMore = TRUE;
			while (bMore)
			{
				if ((FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
				{
					TCHAR szFilePath[MAX_PATH];
					PathCombine(szFilePath, g_szInternalReportFolder, FindData.cFileName);
					AddFileItem(hwndFileList, szFilePath);
				}
				bMore = FindNextFile(hFindFile, &FindData);
			}
			FindClose(hFindFile);
		}
	}
	else
		AddFileItem(hwndFileList, g_szInternalReportFilePath);

	size_t nFileCount = g_arrLogLinks.GetCount();
	for (size_t nFilePos = 0; nFilePos < nFileCount; ++nFilePos)
	{
		CLogLink* pLogLink = g_arrLogLinks[nFilePos];
		_ASSERTE(pLogLink != NULL);
		PCTSTR pszFilePath = pLogLink->GetLogFileName();
		AddFileItem(hwndFileList, pszFilePath);
	}

	HWND hwndSplitter = GetDlgItem(hwnd, IDC_SPLITTER);
	g_Splitter.Attach(hwndSplitter);
	RECT rect;
	GetClientRect(hwndFileList, &rect);
	// Set splitter position according to initial dialog layout.
	g_Splitter.SetSplitterPos(rect.bottom);
	g_Splitter.SetPanel(0, hwndFileList);
	HWND hwndFileView = GetDlgItem(hwnd, IDC_FILEVIEW);
	g_Splitter.SetPanel(1, hwndFileView);

	g_LayoutMgr.InitLayout(hwnd, g_arrPreviewLayout, countof(g_arrPreviewLayout));

	// LVM_SETIMAGELIST resets header control image list
	g_FilesListOrder.InitList(hwndFileList);
	return TRUE;
}
Esempio n. 5
0
/**
 * @brief WM_GETMINMAXINFO handler of Preview dialog.
 * @param hwnd - window handle.
 * @param pMinMaxInfo - window min-max info.
 */
static void PreviewDlg_OnGetMinMaxInfo(HWND hwnd, PMINMAXINFO pMinMaxInfo)
{
	hwnd;
	pMinMaxInfo->ptMinTrackSize = g_LayoutMgr.GetMinTrackSize();
}
Esempio n. 6
0
/**
 * @brief WM_SIZE handler of Preview dialog.
 * @param hwnd - window handle.
 * @param state - window state.
 * @param cx - window width.
 * @param cy - window height.
 */
static void PreviewDlg_OnSize(HWND hwnd, UINT state, int cx, int cy)
{
	hwnd; cx; cy; state;
	g_LayoutMgr.ApplyLayout();
}
Esempio n. 7
0
/**
 * @brief WM_INITDIALOG handler of Machine State dialog.
 * @param hwnd - window handle.
 * @param hwndFocus - system-defined focus window.
 * @param lParam - user-defined parameter.
 * @return true to setup focus to system-defined control.
 */
static BOOL MachineStateDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
    lParam;
    hwndFocus;

    if (g_pResManager->m_hBigAppIcon)
        SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)g_pResManager->m_hBigAppIcon);
    if (g_pResManager->m_hSmallAppIcon)
        SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)g_pResManager->m_hSmallAppIcon);
    CenterWindow(hwnd, GetParent(hwnd));
    g_LayoutMgr.InitLayout(hwnd, g_arrMachineStateLayout, countof(g_arrMachineStateLayout));

    HWND hwndProcessList = GetDlgItem(hwnd, IDC_PROCESS_LIST);
    ListView_SetExtendedListViewStyle(hwndProcessList, LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);

    HWND hwndModuleList = GetDlgItem(hwnd, IDC_PROCESS_MODULES_LIST);
    ListView_SetExtendedListViewStyle(hwndModuleList, LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);

    RECT rcList;
    GetClientRect(hwndProcessList, &rcList);
    rcList.right -= GetSystemMetrics(SM_CXHSCROLL);

    TCHAR szColumnTitle[64];
    LVCOLUMN lvc;
    ZeroMemory(&lvc, sizeof(lvc));
    lvc.mask = LVCF_TEXT | LVCF_WIDTH;
    lvc.pszText = szColumnTitle;

    lvc.cx = rcList.right / 5;
    LoadString(g_hInstance, IDS_COLUMN_PID, szColumnTitle, countof(szColumnTitle));
    ListView_InsertColumn(hwndProcessList, CID_PROCESS_ID, &lvc);

    lvc.cx = rcList.right * 4 / 5;
    LoadString(g_hInstance, IDS_COLUMN_PROCESS, szColumnTitle, countof(szColumnTitle));
    ListView_InsertColumn(hwndProcessList, CID_PROCESS_NAME, &lvc);

    lvc.cx = rcList.right / 2;
    LoadString(g_hInstance, IDS_COLUMN_MODULE, szColumnTitle, countof(szColumnTitle));
    ListView_InsertColumn(hwndModuleList, CID_MODULE_NAME, &lvc);

    lvc.cx = rcList.right / 4;
    LoadString(g_hInstance, IDS_COLUMN_VERSION, szColumnTitle, countof(szColumnTitle));
    ListView_InsertColumn(hwndModuleList, CID_MODULE_VERSION, &lvc);

    lvc.cx = rcList.right / 4;
    LoadString(g_hInstance, IDS_COLUMN_BASE, szColumnTitle, countof(szColumnTitle));
    ListView_InsertColumn(hwndModuleList, CID_MODULE_BASE, &lvc);

    CEnumProcess::CProcessEntry ProcEntry;
    if (g_pEnumProc->GetProcessFirst(ProcEntry))
    {
        LVITEM lvi;
        ZeroMemory(&lvi, sizeof(lvi));
        lvi.mask = LVIF_TEXT | LVIF_PARAM;
        TCHAR szProcessID[64];
        int iItemPos = 0;
        do
        {
            _ultot_s(ProcEntry.m_dwProcessID, szProcessID, countof(szProcessID), 10);
            lvi.iItem = iItemPos;
            lvi.pszText = szProcessID;
            lvi.lParam = ProcEntry.m_dwProcessID;
            ListView_InsertItem(hwndProcessList, &lvi);
            ListView_SetItemText(hwndProcessList, iItemPos, CID_PROCESS_NAME, ProcEntry.m_szProcessName);
            ++iItemPos;
        }
        while (g_pEnumProc->GetProcessNext(ProcEntry));
    }

    // LVM_SETIMAGELIST resets header control image list
    g_ProcessListOrder.InitList(hwndProcessList);
    g_ModulesListOrder.InitList(hwndModuleList);
    return TRUE;
}
Esempio n. 8
0
/**
 * @brief WM_GETMINMAXINFO handler of Send Mail State dialog.
 * @param hwnd - window handle.
 * @param pMinMaxInfo - window min-max info.
 */
static void DescribeErrorDlg_OnGetMinMaxInfo(HWND hwnd, PMINMAXINFO pMinMaxInfo)
{
	hwnd;
	pMinMaxInfo->ptMinTrackSize = g_LayoutMgr.GetMinTrackSize();
}
Esempio n. 9
0
/**
 * @brief WM_SIZE handler of Send Mail dialog.
 * @param hwnd - window handle.
 * @param state - window state.
 * @param cx - window width.
 * @param cy - window height.
 */
static void DescribeErrorDlg_OnSize(HWND hwnd, UINT state, int cx, int cy)
{
	hwnd; cx; cy; state;
	g_LayoutMgr.ApplyLayout();
}