Пример #1
0
BOOL CHbgPatchDialog::OnInitDialog()
{
	CDialog::OnInitDialog();

	// 1) title
	CString title;
	GetWindowText(title);
	CString tmpAddr;
	CString templateStr(L" [");
	templateStr.Append(HBGDEFFMT_ADDRSTR);
	templateStr.Append(L"]");
	tmpAddr.Format(templateStr, m_address);
	title.Append(tmpAddr);	
	SetWindowText(title);

	// 2) Static
	if (m_bCode)
		GetDlgItem(IDC_PATCH_STATIC2)->SetWindowText(L"Disassemble:");
	else
		GetDlgItem(IDC_PATCH_STATIC2)->SetWindowText(L"ASCII:");

	// 3) font
	m_fontPatchEdit.CreatePointFont(80, L"Verdana Bold");
	m_editPatch.SetFont(&m_fontPatchEdit);
	m_editPatch.SetLimitText(HBGDASM_BUFLEN);
	m_editInfo.SetFont(&m_fontPatchEdit);

	return TRUE;  // return TRUE unless you set the focus to a control
	// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
}
Пример #2
0
QString CToolbox::generateUUID(const char* radix, unsigned char len){
    QString guidstr;
    QString templateStr(radix);
    qsrand(QTime::currentTime().msec());
    for (int i = 0; i < len; i++){ //Generate random guid
        unsigned int tempVal = qrand()%templateStr.size();
        guidstr += templateStr[tempVal];
    }
    return guidstr;
}
Пример #3
0
void CHbgModuleList::OnLvnGetdispinfo(NMHDR *pNMHDR, LRESULT *pResult)
{
	NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
	
	LVITEM& item = pDispInfo->item;
	if (item.mask & LVIF_TEXT) {
		if (item.iItem < (int)m_modules.size()) {

			CHbgModuleInfo& curItem = m_modules.at(item.iItem);

			static CString tmpStrAddr;

			switch (item.iSubItem) {
				case 0:
					{
						tmpStrAddr.Format(L"%d", curItem.idx);
						item.pszText = (LPWSTR)(LPCWSTR)tmpStrAddr;
					}
					break;
				case 1:
					{
						item.pszText = (LPWSTR)curItem.name.c_str();
					}
					break;
				case 2:
					{
						CString templateStr(HBGDEFFMT_ADDRSTR);
						templateStr.Append(L" - ");
						templateStr.Append(HBGDEFFMT_ADDRSTR);
						tmpStrAddr.Format(templateStr, curItem.addressStart, curItem.addressEnd);
						item.pszText = (LPWSTR)(LPCWSTR)tmpStrAddr;
					}
					break;
				case 3:
					{
						item.pszText = (LPWSTR)curItem.path.c_str();
					}
					break;
			}
		}
	}

	*pResult = 0;
}