本文整理汇总了C++中GetResString函数的典型用法代码示例。如果您正苦于以下问题:C++ GetResString函数的具体用法?C++ GetResString怎么用?C++ GetResString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetResString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetResString
void CPPgScheduler::OnNMRclickActionlist(NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
POINT point;
::GetCursorPos(&point);
CTitleMenu m_ActionMenu;
CMenu m_ActionSel;
CMenu m_CatActionSel;
bool isCatAction=false;
if (m_actions.GetSelectionMark()!=-1) {
int ac=m_actions.GetItemData(m_actions.GetSelectionMark());
if (ac==6 || ac==7) isCatAction=true;
}
m_ActionMenu.CreatePopupMenu();
m_ActionSel.CreatePopupMenu();
m_CatActionSel.CreatePopupMenu();
UINT nFlag=MF_STRING;
if (m_actions.GetSelectionMark()==-1) nFlag=MF_STRING | MF_GRAYED;
m_ActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+ACTION_SETUPL,GetResString(IDS_PW_UPL));
m_ActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+ACTION_SETDOWNL,GetResString(IDS_PW_DOWNL));
m_ActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+ACTION_SOURCESL,GetResString(IDS_LIMITSOURCES));
m_ActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+ACTION_CON5SEC,GetResString(IDS_LIMITCONS5SEC));
m_ActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+ACTION_CONS,GetResString(IDS_PW_MAXC));
m_ActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+ACTION_CATSTOP,GetResString(IDS_SCHED_CATSTOP));
m_ActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+ACTION_CATRESUME,GetResString(IDS_SCHED_CATRESUME));
m_ActionMenu.AddMenuTitle(GetResString(IDS_ACTION));
m_ActionMenu.AppendMenu(MF_POPUP,(UINT_PTR)m_ActionSel.m_hMenu, GetResString(IDS_ADD));
if (isCatAction) {
if (thePrefs.GetCatCount()>1) m_CatActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+20,GetResString(IDS_ALLUNASSIGNED));
m_CatActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+21,GetResString(IDS_ALL));
for (int i=1;i<thePrefs.GetCatCount();i++)
m_CatActionSel.AppendMenu(MF_STRING,MP_SCHACTIONS+22+i,thePrefs.GetCategory(i)->strTitle );
m_ActionMenu.AppendMenu(MF_POPUP,(UINT_PTR)m_CatActionSel.m_hMenu, GetResString(IDS_SELECTCAT));
} else
m_ActionMenu.AppendMenu(nFlag,MP_CAT_EDIT, GetResString(IDS_EDIT));
m_ActionMenu.AppendMenu(nFlag,MP_CAT_REMOVE,GetResString(IDS_REMOVE));
m_ActionMenu.TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x, point.y, this);
VERIFY( m_ActionSel.DestroyMenu() );
VERIFY( m_CatActionSel.DestroyMenu() );
VERIFY( m_ActionMenu.DestroyMenu() );
*pResult = 0;
}
示例2: dc
//.........这里部分代码省略.........
#else //Modversion
image = 1;
#endif //Modversion
//<==Modversion [shadow2004]
}
else {
if (client->credits->GetScoreRatio(client/*->GetIP()*/) > 1)
//==> Xman CreditSystem [shadow2004]
image = 2;
else
image = 0;
}
POINT point = {cur_rec.left, cur_rec.top+1};
imagelist.Draw(dc,image, point, ILD_NORMAL | ((client->Credits() && client->Credits()->GetCurrentIdentState(client->GetIP()) == IS_IDENTIFIED) ? INDEXTOOVERLAYMASK(1) : 0));
Sbuffer = client->GetUserName();
cur_rec.left +=20;
dc.DrawText(Sbuffer,Sbuffer.GetLength(),&cur_rec,DLC_DT_TEXT);
cur_rec.left -=20;
break;
}
case 1:
if(file)
Sbuffer = file->GetFileName();
else
Sbuffer = _T("?");
break;
case 2:
if(file) {
switch (file->GetUpPriority()) {
case PR_VERYLOW : {
Sbuffer = GetResString(IDS_PRIOVERYLOW);
break;
}
case PR_LOW : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOLOW);
else
Sbuffer = GetResString(IDS_PRIOLOW);
break;
}
case PR_NORMAL : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTONORMAL);
else
Sbuffer = GetResString(IDS_PRIONORMAL);
break;
}
case PR_HIGH : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOHIGH);
else
Sbuffer = GetResString(IDS_PRIOHIGH);
break;
}
case PR_VERYHIGH : {
Sbuffer = GetResString(IDS_PRIORELEASE);
break;
}
default:
Sbuffer.Empty();
}
}
else
示例3: dc
void CClientListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if( !theApp.emuledlg->IsRunning() )
return;
if (!lpDrawItemStruct->itemData)
return;
CDC* odc = CDC::FromHandle(lpDrawItemStruct->hDC);
BOOL bCtrlFocused = ((GetFocus() == this ) || (GetStyle() & LVS_SHOWSELALWAYS));
if (lpDrawItemStruct->itemState & ODS_SELECTED) {
if(bCtrlFocused)
odc->SetBkColor(m_crHighlight);
else
odc->SetBkColor(m_crNoHighlight);
}
else
odc->SetBkColor(GetBkColor());
const CUpDownClient* client = (CUpDownClient*)lpDrawItemStruct->itemData;
CMemDC dc(odc, &lpDrawItemStruct->rcItem);
CFont* pOldFont = dc.SelectObject(GetFont());
CRect cur_rec(lpDrawItemStruct->rcItem);
COLORREF crOldTextColor = dc.SetTextColor((lpDrawItemStruct->itemState & ODS_SELECTED) ? m_crHighlightText : m_crWindowText);
int iOldBkMode;
if (m_crWindowTextBk == CLR_NONE){
DefWindowProc(WM_ERASEBKGND, (WPARAM)(HDC)dc, 0);
iOldBkMode = dc.SetBkMode(TRANSPARENT);
}
else
iOldBkMode = OPAQUE;
CHeaderCtrl *pHeaderCtrl = GetHeaderCtrl();
int iCount = pHeaderCtrl->GetItemCount();
cur_rec.right = cur_rec.left - 8;
cur_rec.left += 4;
CString Sbuffer;
for(int iCurrent = 0; iCurrent < iCount; iCurrent++){
int iColumn = pHeaderCtrl->OrderToIndex(iCurrent);
if( !IsColumnHidden(iColumn) ){
cur_rec.right += GetColumnWidth(iColumn);
switch(iColumn){
case 0:{
uint8 image;
if (client->IsFriend())
image = 2;
else if (client->GetClientSoft() == SO_EDONKEYHYBRID)
image = 4;
else if (client->GetClientSoft() == SO_MLDONKEY)
image = 3;
else if (client->GetClientSoft() == SO_SHAREAZA)
image = 5;
else if (client->GetClientSoft() == SO_URL)
image = 6;
else if (client->GetClientSoft() == SO_AMULE)
image = 7;
else if (client->GetClientSoft() == SO_LPHANT)
image = 8;
else if (client->ExtProtocolAvailable())
//==>Modversion [shadow2004]
#ifdef MODVERSION
image = (client->IsNextEMF())?10:1;
#else //Modversion
image = 1;
#endif //Modversion
//<==Modversion [shadow2004]
else
image = 0;
POINT point = {cur_rec.left, cur_rec.top+1};
imagelist.Draw(dc,image, point, ILD_NORMAL | ((client->Credits() && client->Credits()->GetCurrentIdentState(client->GetIP()) == IS_IDENTIFIED) ? INDEXTOOVERLAYMASK(1) : 0));
if (client->GetUserName()==NULL)
Sbuffer.Format(_T("(%s)"), GetResString(IDS_UNKNOWN));
else
Sbuffer = client->GetUserName();
cur_rec.left +=20;
dc.DrawText(Sbuffer,Sbuffer.GetLength(),&cur_rec,DLC_DT_TEXT);
cur_rec.left -=20;
break;
}
case 1:{
Sbuffer = client->GetUploadStateDisplayString();
break;
}
case 2:{
if(client->credits)
Sbuffer = CastItoXBytes(client->credits->GetUploadedTotal(), false, false);
else
Sbuffer.Empty();
break;
}
case 3:{
Sbuffer = client->GetDownloadStateDisplayString();
break;
}
case 4:{
if(client->credits)
Sbuffer = CastItoXBytes(client->credits->GetDownloadedTotal(), false, false);
else
Sbuffer.Empty();
break;
}
//.........这里部分代码省略.........
示例4: ASSERT
void CQueueListCtrl::GetItemDisplayText(const CUpDownClient *client, int iSubItem, LPTSTR pszText, int cchTextMax)
{
if (pszText == NULL || cchTextMax <= 0) {
ASSERT(0);
return;
}
pszText[0] = _T('\0');
switch (iSubItem)
{
case 0:
if (client->GetUserName() == NULL)
_sntprintf(pszText, cchTextMax, _T("(%s)"), GetResString(IDS_UNKNOWN));
else
_tcsncpy(pszText, client->GetUserName(), cchTextMax);
break;
case 1: {
const CKnownFile *file = theApp.sharedfiles->GetFileByID(client->GetUploadFileID());
_tcsncpy(pszText, file != NULL ? file->GetFileName() : _T(""), cchTextMax);
break;
}
case 2: {
const CKnownFile *file = theApp.sharedfiles->GetFileByID(client->GetUploadFileID());
if (file)
{
// ==> PowerShare [ZZ/MorphXT] - Stulle
/*
switch (file->GetUpPriority())
{
case PR_VERYLOW:
_tcsncpy(pszText, GetResString(IDS_PRIOVERYLOW), cchTextMax);
break;
case PR_LOW:
if (file->IsAutoUpPriority())
_tcsncpy(pszText, GetResString(IDS_PRIOAUTOLOW), cchTextMax);
else
_tcsncpy(pszText, GetResString(IDS_PRIOLOW), cchTextMax);
break;
case PR_NORMAL:
if (file->IsAutoUpPriority())
_tcsncpy(pszText, GetResString(IDS_PRIOAUTONORMAL), cchTextMax);
else
_tcsncpy(pszText, GetResString(IDS_PRIONORMAL), cchTextMax);
break;
case PR_HIGH:
if (file->IsAutoUpPriority())
_tcsncpy(pszText, GetResString(IDS_PRIOAUTOHIGH), cchTextMax);
else
_tcsncpy(pszText, GetResString(IDS_PRIOHIGH), cchTextMax);
break;
case PR_VERYHIGH:
_tcsncpy(pszText, GetResString(IDS_PRIORELEASE), cchTextMax);
break;
//Xman PowerRelease
case PR_POWER:
_tcsncpy(pszText, GetResString(IDS_POWERRELEASE), cchTextMax);
break;
//Xman end
}
*/
CString Sbuffer;
switch (file->GetUpPriority()) {
case PR_VERYLOW : {
Sbuffer = GetResString(IDS_PRIOVERYLOW);
break; }
case PR_LOW : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOLOW);
else
Sbuffer = GetResString(IDS_PRIOLOW);
break; }
case PR_NORMAL : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTONORMAL);
else
Sbuffer = GetResString(IDS_PRIONORMAL);
break; }
case PR_HIGH : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOHIGH);
else
Sbuffer = GetResString(IDS_PRIOHIGH);
break; }
case PR_VERYHIGH : {
Sbuffer = GetResString(IDS_PRIORELEASE);
break; }
//Xman PowerRelease
case PR_POWER: {
Sbuffer = GetResString(IDS_POWERRELEASE);
break; }
//Xman end
default:
Sbuffer.Empty();
}
if(client->GetPowerShared(file)) {
//.........这里部分代码省略.........
示例5: SetElementHtml
void CMiniMule::Localize()
{
SetElementHtml(_T("connectedLabel"), CComBSTR(GetResString(IDS_CONNECTED)));
SetElementHtml(_T("upRateLabel"), CComBSTR(GetResString(IDS_PW_CON_UPLBL)));
SetElementHtml(_T("downRateLabel"), CComBSTR(GetResString(IDS_PW_CON_DOWNLBL)));
SetElementHtml(_T("completedLabel"), CComBSTR(GetResString(IDS_DL_TRANSFCOMPL)));
SetElementHtml(_T("freeSpaceLabel"), CComBSTR(GetResString(IDS_STATS_FREESPACE)));
CComPtr<IHTMLElement> a;
GetElementInterface(_T("openIncomingLink"), &a);
if (a)
{
a->put_title(CComBSTR(RemoveAmbersand(GetResString(IDS_OPENINC))));
a.Release();
}
GetElementInterface(_T("optionsLink"), &a);
if (a)
{
a->put_title(CComBSTR(RemoveAmbersand(GetResString(IDS_EM_PREFS))));
a.Release();
}
GetElementInterface(_T("restoreWndLink"), &a);
if (a)
{
a->put_title(CComBSTR(RemoveAmbersand(GetResString(IDS_MAIN_POPUP_RESTORE))));
a.Release();
}
CComPtr<IHTMLImgElement> img;
GetElementInterface(_T("openIncomingImg"), &img);
if (img)
{
img->put_alt(CComBSTR(RemoveAmbersand(GetResString(IDS_OPENINC))));
img.Release();
}
GetElementInterface(_T("optionsImg"), &img);
if (img)
{
img->put_alt(CComBSTR(RemoveAmbersand(GetResString(IDS_EM_PREFS))));
img.Release();
}
GetElementInterface(_T("restoreWndImg"), &img);
if (img)
{
img->put_alt(CComBSTR(RemoveAmbersand(GetResString(IDS_MAIN_POPUP_RESTORE))));
img.Release();
}
}
示例6: GetFormatedUInt
void CPPgNe::Localize(void)
{
CString temp;
if (m_hWnd)
{
// Nicehash from iONiX
temp.Format(GetResString(IDS_NICEHASH_STATIC)+_T(": %s %%"), GetFormatedUInt(m_iNiceHashWeight));
GetDlgItem(IDC_NICEHASH_STATIC)->SetWindowText(temp);
GetDlgItem(IDC_NICEHASH_LEFT)->SetWindowText(GetResString(IDS_NICEHASH_LEFT));
GetDlgItem(IDC_NICEHASH_RIGHT)->SetWindowText(GetResString(IDS_NICEHASH_RIGHT));
// Nicehash
GetDlgItem(IDC_REASKSRCAFTERIPCHANGE)->SetWindowText(GetResString(IDS_REASKSRCAFTERIPCHANGE));
GetDlgItem(IDC_QUICKSTART_BOX)->SetWindowText(GetResString(IDS_QUICKSTART));
GetDlgItem(IDC_PPG_PHOENIX_QUICKSTART)->SetWindowText(GetResString(IDS_PPG_PHOENIX_QUICKSTART));
GetDlgItem(IDC_PPG_PHOENIX_QUICKSTART_CONN_STATIC)->SetWindowText(GetResString(IDS_PPG_PHOENIX_QUICKSTART_CONN_STATIC));
GetDlgItem(IDC_PPG_PHOENIX_QUICKSTART_CONN_PER_FIVE_STATIC)->SetWindowText(GetResString(IDS_PPG_PHOENIX_QUICKSTART_CONN_PER_FIVE_STATIC));
GetDlgItem(IDC_QUICKSTARTAFTERIPCHANGE)->SetWindowText(GetResString(IDS_QUICKSTARTAFTERIPCHANGE));
GetDlgItem(IDC_QUICK_START_MINUTES_STATIC)->SetWindowText(GetResString(IDS_QUICK_START_MINUTES_STATIC));
GetDlgItem(IDC_AutoHL_Groupbox)->SetWindowText(GetResString(IDS_AutoHL_Groupbox));
GetDlgItem(IDC_AutoHL)->SetWindowText(GetResString(IDS_AutoHL));
GetDlgItem(IDC_MinAutoHL_static)->SetWindowText(GetResString(IDS_MinAutoHL_static));
GetDlgItem(IDC_MaxAutoHL_static)->SetWindowText(GetResString(IDS_MaxAutoHL_static));
GetDlgItem(IDC_MaxSourcesHL_static)->SetWindowText(GetResString(IDS_MaxSourcesHL_static));
GetDlgItem(IDC_AutoHLUpdate_static)->SetWindowText(GetResString(IDS_AutoHLUpdate_static));
GetDlgItem(IDC_AutoHLUpdate_static2)->SetWindowText(GetResString(IDS_AutoHLUpdate_static2));
GetDlgItem(IDC_EnableDownloadInColor)->SetWindowText(GetResString(IDS_EnableDownloadInColor)); //Spe64
GetDlgItem(IDC_EnableDownloadInBold)->SetWindowText(GetResString(IDS_EnableDownloadInBold)); //Spe64
GetDlgItem(IDC_UploadColor)->SetWindowText(GetResString(IDS_UploadColor));//lama
GetDlgItem(IDC_CHECK_SIVKABAN)->SetWindowText(GetResString(IDS_CHECK_SIVKABAN));//lama
GetDlgItem(IDC_CHECK_SIVKA_BANLOG)->SetWindowText(GetResString(IDS_CHECK_SIVKA_BANLOG));//lama
GetDlgItem(IDC_IsClientBanTime_static)->SetWindowText(GetResString(IDS_ISCLIENTBANTIME_STATIC));//lama
}
}
示例7: InitWindowStyles
BOOL CCollectionViewDialog::OnInitDialog(void)
{
CDialog::OnInitDialog();
InitWindowStyles(this);
if (!m_pCollection) {
ASSERT(0);
return TRUE;
}
m_CollectionViewList.Init(_T("CollectionView"));
SetIcon(m_icoWnd = theApp.LoadIcon(_T("Collection_View")), FALSE);
m_AddNewCatagory.SetCheck(false);
SetWindowText(GetResString(IDS_VIEWCOLLECTION) + _T(": ") + m_pCollection->m_sCollectionName);
m_CollectionViewListIcon.SetIcon(m_icoColl = theApp.LoadIcon(_T("AABCollectionFileType")));
m_CollectionDownload.SetWindowText(GetResString(IDS_DOWNLOAD));
m_CollectionExit.SetWindowText(GetResString(IDS_CW_CLOSE));
SetDlgItemText(IDC_COLLECTIONVIEWAUTHORLABEL, GetResString(IDS_AUTHOR) + _T(":"));
SetDlgItemText(IDC_COLLECTIONVIEWAUTHORKEYLABEL, GetResString(IDS_AUTHORKEY) + _T(":"));
SetDlgItemText(IDC_COLLECTIONVIEWCATEGORYCHECK, GetResString(IDS_COLL_ADDINCAT));
SetDlgItemText(IDC_VCOLL_DETAILS, GetResString(IDS_DETAILS));
SetDlgItemText(IDC_VCOLL_OPTIONS, GetResString(IDS_OPTIONS));
m_CollectionViewAuthor.SetWindowText(m_pCollection->m_sCollectionAuthorName);
m_CollectionViewAuthorKey.SetWindowText(m_pCollection->GetAuthorKeyHashString());
AddAnchor(IDC_COLLECTIONVEWLIST, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_VCOLL_DETAILS, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_VCOLL_OPTIONS, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_COLLECTIONVIEWAUTHORLABEL, BOTTOM_LEFT);
AddAnchor(IDC_COLLECTIONVIEWAUTHORKEYLABEL, BOTTOM_LEFT);
AddAnchor(IDC_COLLECTIONVIEWCATEGORYCHECK, BOTTOM_LEFT);
AddAnchor(IDC_COLLECTIONVIEWAUTHOR, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_COLLECTIONVIEWAUTHORKEY, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_VCOLL_CLOSE, BOTTOM_RIGHT);
AddAnchor(IDC_VIEWCOLLECTIONDL, BOTTOM_RIGHT);
EnableSaveRestore(PREF_INI_SECTION);
POSITION pos = m_pCollection->m_CollectionFilesMap.GetStartPosition();
while (pos != NULL)
{
CCollectionFile* pCollectionFile;
CSKey key;
m_pCollection->m_CollectionFilesMap.GetNextAssoc(pos, key, pCollectionFile);
int iImage = theApp.GetFileTypeSystemImageIdx(pCollectionFile->GetFileName());
int iItem = m_CollectionViewList.InsertItem(LVIF_TEXT | LVIF_PARAM | (iImage > 0 ? LVIF_IMAGE : 0), m_CollectionViewList.GetItemCount(), NULL, 0, 0, iImage, (LPARAM)pCollectionFile);
if (iItem != -1)
{
m_CollectionViewList.SetItemText(iItem, colName, pCollectionFile->GetFileName());
m_CollectionViewList.SetItemText(iItem, colSize, CastItoXBytes(pCollectionFile->GetFileSize()));
m_CollectionViewList.SetItemText(iItem, colHash, md4str(pCollectionFile->GetFileHash()));
}
}
int iItem = m_CollectionViewList.GetItemCount();
while (iItem)
m_CollectionViewList.SetItemState(--iItem, LVIS_SELECTED, LVIS_SELECTED);
CString strTitle;
strTitle.Format(GetResString(IDS_COLLECTIONLIST) + _T(" (%u)"), m_CollectionViewList.GetItemCount());
m_CollectionViewListLabel.SetWindowText(strTitle);
return TRUE;
}
示例8: InitWindowStyles
BOOL CPPgWebcachesettings::OnInitDialog()
{
CPropertyPage::OnInitDialog();
InitWindowStyles(this);
LoadSettings();
Localize();
// create hyperlinks
// note: there are better classes to create a pure hyperlink, however since it is only needed here
// we rather use an already existing class
// Create email-proxy-submission link. The current settings will be included in the email.
// Superlexx - email proxy submissions are not available anymore, use the web form
// Create website-proxy-submission link
CRect rect2;
GetDlgItem(IDC_WEBCACHELINK2)->GetWindowRect(rect2);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rect2, 2);
m_wndSubmitWebcacheLink2.CreateEx(NULL,0,_T("MsgWnd"),WS_BORDER | WS_VISIBLE | WS_CHILD | HTC_WORDWRAP | HTC_UNDERLINE_HOVER,rect2.left,rect2.top,rect2.Width(),rect2.Height(),m_hWnd,0);
m_wndSubmitWebcacheLink2.SetBkColor(::GetSysColor(COLOR_3DFACE)); // still not the right color, will fix this later (need to merge the .rc file before it changes ;) )
m_wndSubmitWebcacheLink2.SetFont(GetFont());
if (!bCreated2){
bCreated2 = true;
CString URL = _T("http://ispcachingforemule.de.vu/index.php?show=submitProxy");
CString proxyName, proxyPort, hostName;
proxyName.Format(_T("%s"), thePrefs.webcacheName);
proxyPort.Format(_T("%i"), thePrefs.webcachePort);
hostName.Format(_T("%s"), thePrefs.GetLastResolvedName());
URL += _T("&hostName=") + hostName + _T("&proxyName=") + proxyName + _T("&proxyPort=") + proxyPort;
m_wndSubmitWebcacheLink2.AppendText(GetResString(IDS_WC_LINK));
m_wndSubmitWebcacheLink2.AppendHyperLink(GetResString(IDS_WC_SUBMIT_WEB),0,URL,0,0);
}
//JP hide advanced settings
if (showadvanced)
{
GetDlgItem(IDC_ADVANCEDCONTROLS)->SetWindowText(GetResString(IDS_WC_HIDE_ADV));
GetDlgItem(IDC_EXTRATIMEOUT)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_LOCALTRAFFIC)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_BLOCKS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_STATIC_NRBLOCKS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_STATIC_BLOCKS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_PERSISTENT_PROXY_CONNS)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_UPDATE_WCSETTINGS)->ShowWindow(SW_SHOW);
}
else
{
GetDlgItem(IDC_ADVANCEDCONTROLS)->SetWindowText(GetResString(IDS_WC_ADVANCED));
GetDlgItem(IDC_EXTRATIMEOUT)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_LOCALTRAFFIC)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_BLOCKS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_NRBLOCKS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_BLOCKS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_PERSISTENT_PROXY_CONNS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_UPDATE_WCSETTINGS)->ShowWindow(SW_HIDE);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例9: GetDlgItem
void CPPgStats::Localize(void)
{
if(m_hWnd)
{
GetDlgItem(IDC_GRAPHS)->SetWindowText(GetResString(IDS_GRAPHS));
GetDlgItem(IDC_STREE)->SetWindowText(GetResString(IDS_STREE));
GetDlgItem(IDC_STATIC_CGRAPHSCALE)->SetWindowText(GetResString(IDS_PPGSTATS_YSCALE));
GetDlgItem(IDC_STATIC_CGRAPHRATIO)->SetWindowText(GetResString(IDS_PPGSTATS_ACRATIO));
SetWindowText(GetResString(IDS_STATSSETUPINFO));
GetDlgItem(IDC_PREFCOLORS)->SetWindowText(GetResString(IDS_COLORS));
SetDlgItemText(IDC_FILL_GRAPHS, GetResString(IDS_FILLGRAPHS) );
m_colors.ResetContent();
int iItem;
iItem = m_colors.AddString(GetResString(IDS_SP_BACKGROUND)); m_colors.SetItemData(iItem, 0);
iItem = m_colors.AddString(GetResString(IDS_SP_GRID)); m_colors.SetItemData(iItem, 1);
iItem = m_colors.AddString(GetResString(IDS_SP_DL3)); m_colors.SetItemData(iItem, 4);
iItem = m_colors.AddString(GetResString(IDS_SP_DL2)); m_colors.SetItemData(iItem, 3);
iItem = m_colors.AddString(GetResString(IDS_SP_DL1)); m_colors.SetItemData(iItem, 2);
iItem = m_colors.AddString(GetResString(IDS_SP_UL3)); m_colors.SetItemData(iItem, 7);
iItem = m_colors.AddString(GetResString(IDS_SP_UL2)); m_colors.SetItemData(iItem, 6);
iItem = m_colors.AddString(GetResString(IDS_SP_UL1)); m_colors.SetItemData(iItem, 5);
iItem = m_colors.AddString(GetResString(IDS_SP_ULSLOTSNOOVERHEAD)); m_colors.SetItemData(iItem, 14);
iItem = m_colors.AddString(GetResString(IDS_SP_ULFRIENDS)); m_colors.SetItemData(iItem, 13);
iItem = m_colors.AddString(GetResString(IDS_SP_ULPOWERSHARE)); m_colors.SetItemData(iItem, 15); //MORPH - Added by SiRoB, Powershare Display
iItem = m_colors.AddString(GetResString(IDS_SP_ACTCON)); m_colors.SetItemData(iItem, 8);
iItem = m_colors.AddString(GetResString(IDS_SP_ACTUL)); m_colors.SetItemData(iItem, 10);
iItem = m_colors.AddString(GetResString(IDS_SP_TOTALUL)); m_colors.SetItemData(iItem, 9);
iItem = m_colors.AddString(GetResString(IDS_SP_ACTDL)); m_colors.SetItemData(iItem, 12);
iItem = m_colors.AddString(GetResString(IDS_SP_ICONBAR)); m_colors.SetItemData(iItem, 11);
m_ctlColor.CustomText = GetResString(IDS_COL_MORECOLORS);
m_ctlColor.DefaultText = NULL;
m_colors.SetCurSel(0);
OnCbnSelChangeColorSelector();
ShowInterval();
}
}
示例10: GetDlgItem
BOOL CPPgWebcachesettings::OnApply()
{
bool bRestartApp = false;
CString buffer;
// set thePrefs.webcacheName
if(GetDlgItem(IDC_webcacheName)->GetWindowTextLength())
{
CString nNewwebcache;
GetDlgItem(IDC_webcacheName)->GetWindowText(nNewwebcache);
if (thePrefs.webcacheName != nNewwebcache){
thePrefs.webcacheName = nNewwebcache;
bRestartApp = true;
}
}
// set thePrefs.webcachePort
if(GetDlgItem(IDC_webcachePort)->GetWindowTextLength())
{
GetDlgItem(IDC_webcachePort)->GetWindowText(buffer);
uint16 nNewPort = (uint16)_tstol(buffer);
if (!nNewPort) nNewPort=0;
if (nNewPort != thePrefs.webcachePort){
thePrefs.webcachePort = nNewPort;
}
}
// set thePrefs.webcacheEnabled
thePrefs.webcacheEnabled = IsDlgButtonChecked(IDC_Activatewebcachedownloads)!=0;
// set thePrefs.webcacheBlockLimit
if(GetDlgItem(IDC_BLOCKS)->GetWindowTextLength())
{
GetDlgItem(IDC_BLOCKS)->GetWindowText(buffer);
uint16 nNewBlocks = (uint16)_tstol(buffer);
if ((!nNewBlocks) || (nNewBlocks > 50000) || (nNewBlocks < 0)) nNewBlocks=0;
if (nNewBlocks != thePrefs.GetWebCacheBlockLimit()){
thePrefs.SetWebCacheBlockLimit(nNewBlocks);
}
}
// set thePrefs.WebCacheExtraTimeout
thePrefs.SetWebCacheExtraTimeout(IsDlgButtonChecked(IDC_EXTRATIMEOUT) != 0);
// set thePrefs.WebCacheCachesLocalTraffic
uint8 cachestraffic;
cachestraffic = (uint8)IsDlgButtonChecked(IDC_LOCALTRAFFIC);
if (cachestraffic == 1) thePrefs.SetWebCacheCachesLocalTraffic(0);
else thePrefs.SetWebCacheCachesLocalTraffic(1);
// set thePrefs.PersistentConnectionsForProxyDownloads
thePrefs.PersistentConnectionsForProxyDownloads = IsDlgButtonChecked(IDC_PERSISTENT_PROXY_CONNS)!=0;
// set thePrefs.WCAutoupdate
thePrefs.WCAutoupdate = IsDlgButtonChecked(IDC_UPDATE_WCSETTINGS)!=0;
SetModified(FALSE);
LoadSettings();
if (bRestartApp)
{
AfxMessageBox(GetResString(IDS_SETTINGCHANGED_RESTART));
thePrefs.WebCacheDisabledThisSession = true;
}
return CPropertyPage::OnApply();
}
示例11: SetWindowText
void CPPgWebServer::Localize(void)
{
if(m_hWnd){
SetWindowText(GetResString(IDS_PW_WS));
GetDlgItem(IDC_WSPASS_LBL)->SetWindowText(GetResString(IDS_WS_PASS));
GetDlgItem(IDC_WSPORT_LBL)->SetWindowText(GetResString(IDS_PORT));
GetDlgItem(IDC_WSENABLED)->SetWindowText(GetResString(IDS_ENABLED));
GetDlgItem(IDC_WSRELOADTMPL)->SetWindowText(GetResString(IDS_SF_RELOAD));
GetDlgItem(IDC_WSENABLED)->SetWindowText(GetResString(IDS_ENABLED));
SetDlgItemText(IDC_WS_GZIP,GetResString(IDS_WEB_GZIP_COMPRESSION));
GetDlgItem(IDC_WSPASS_LBL2)->SetWindowText(GetResString(IDS_WS_PASS));
GetDlgItem(IDC_WSENABLEDLOW)->SetWindowText(GetResString(IDS_ENABLED));
GetDlgItem(IDC_STATIC_GENERAL)->SetWindowText(GetResString(IDS_PW_GENERAL));
GetDlgItem(IDC_STATIC_ADMIN)->SetWindowText(GetResString(IDS_ADMIN));
GetDlgItem(IDC_STATIC_LOWUSER)->SetWindowText(GetResString(IDS_WEB_LOWUSER));
GetDlgItem(IDC_WSENABLEDLOW)->SetWindowText(GetResString(IDS_ENABLED));
GetDlgItem(IDC_TEMPLATE)->SetWindowText(GetResString(IDS_WS_RELOAD_TMPL));
//==> remove MobileMule [shadow2004]
#if defined(MM)
GetDlgItem(IDC_MMENABLED)->SetWindowText(GetResString(IDS_ENABLEMM));
GetDlgItem(IDC_STATIC_MOBILEMULE)->SetWindowText(GetResString(IDS_MOBILEMULE));
GetDlgItem(IDC_MMPASSWORD)->SetWindowText(GetResString(IDS_WS_PASS));
GetDlgItem(IDC_MMPORT_LBL)->SetWindowText(GetResString(IDS_PORT));
#endif //MM
//<== remove MobileMule [shadow2004]
}
}
示例12: SetWindowText
void CPPgScheduler::Localize(void)
{
if(m_hWnd)
{
SetWindowText(GetResString(IDS_SCHEDULER));
GetDlgItem(IDC_ENABLE)->SetWindowText(GetResString(IDS_ENABLED));
GetDlgItem(IDC_S_ENABLE)->SetWindowText(GetResString(IDS_ENABLED));
GetDlgItem(IDC_STATIC_S_TITLE)->SetWindowText(GetResString(IDS_TITLE));
GetDlgItem(IDC_STATIC_DETAILS)->SetWindowText(GetResString(IDS_DETAILS));
GetDlgItem(IDC_STATIC_S_TIME)->SetWindowText(GetResString(IDS_TIME));
GetDlgItem(IDC_STATIC_S_ACTION)->SetWindowText(GetResString(IDS_ACTION));
GetDlgItem(IDC_APPLY)->SetWindowText(GetResString(IDS_PW_APPLY));
GetDlgItem(IDC_REMOVE)->SetWindowText(GetResString(IDS_REMOVE));
GetDlgItem(IDC_NEW)->SetWindowText(GetResString(IDS_NEW));
GetDlgItem(IDC_CHECKNOENDTIME)->SetWindowText(GetResString(IDS_CHECKNOENDTIME));
while (m_timesel.GetCount()>0) m_timesel.DeleteString(0);
for (int i=0;i<11;i++)
m_timesel.AddString(GetDayLabel(i));
m_timesel.SetCurSel(0);
if (m_list.GetSelectionMark()!=-1) m_timesel.SetCurSel(theApp.scheduler->GetSchedule(m_timesel.GetCurSel())->day);
}
}
示例13: OnCommand
BOOL CPPgScheduler::OnCommand(WPARAM wParam, LPARAM lParam)
{
int item= m_actions.GetSelectionMark();
// add
if (wParam>=MP_SCHACTIONS && wParam<MP_SCHACTIONS+20 && m_actions.GetItemCount()<16)
{
int action=wParam-MP_SCHACTIONS;
int i=m_actions.GetItemCount();
m_actions.InsertItem(i,GetActionLabel(action));
m_actions.SetItemData(i,action);
m_actions.SetSelectionMark(i);
if (action<6)
OnCommand(MP_CAT_EDIT,0);
}
else if (wParam>=MP_SCHACTIONS+20 && wParam<=MP_SCHACTIONS+80)
{
CString newval;
newval.Format(_T("%i"),wParam-MP_SCHACTIONS-22);
m_actions.SetItemText(item,1,newval);
}
else if (wParam == ID_HELP)
{
OnHelp();
return TRUE;
}
switch (wParam){
case MP_CAT_EDIT:
{
if (item!=-1) {
InputBox inputbox;
// todo: differen prompts
CString prompt;
switch (m_actions.GetItemData(item)) {
case 1:
case 2:
prompt=GetResString(IDS_SCHED_ENTERDATARATELIMIT)+_T(" (")+GetResString(IDS_KBYTESPERSEC)+_T(")");
break;
default: prompt=GetResString(IDS_SCHED_ENTERVAL);
}
inputbox.SetLabels(GetResString(IDS_SCHED_ACTCONFIG),prompt,m_actions.GetItemText(item,1));
inputbox.DoModal();
CString res=inputbox.GetInput();
if (!inputbox.WasCancelled()) m_actions.SetItemText(item,1,res);
}
break;
}
case MP_CAT_REMOVE:
{
// remove
if (item!=-1) {
int ix=m_actions.GetSelectionMark();
if (ix!=-1) {
m_actions.DeleteItem(ix);
}
}
break;
}
}
return CPropertyPage::OnCommand(wParam, lParam);
}
示例14: GetResString
BOOL CHttpDownloadDlg::OnInitDialog()
{
CString cap;
cap = GetResString(IDS_CANCEL);
GetDlgItem(IDCANCEL)->SetWindowText(cap);
if (!m_strTitle.IsEmpty())
SetWindowText(m_strTitle);
//Let the parent class do its thing
CDialog::OnInitDialog();
InitWindowStyles(this);
//Setup the animation control
m_ctrlAnimate.Open(IDR_HTTPDOWNLOAD_ANI);
//Validate the URL
ASSERT(m_sURLToDownload.GetLength()); //Did you forget to specify the file to download
if (!AfxParseURL(m_sURLToDownload, m_dwServiceType, m_sServer, m_sObject, m_nPort))
{
//Try sticking "http://" before it
m_sURLToDownload = _T("http://") + m_sURLToDownload;
if (!AfxParseURL(m_sURLToDownload, m_dwServiceType, m_sServer, m_sObject, m_nPort))
{
TRACE(_T("Failed to parse the URL: %s\n"), m_sURLToDownload);
EndDialog(IDCANCEL);
return TRUE;
}
}
//Check to see if the file we are downloading to exists and if
//it does, then ask the user if they were it overwritten
// edited: we always want to overwrite old language dlls and server.mets
/*CFileStatus fs;
ASSERT(m_sFileToDownloadInto.GetLength());
if (CFile::GetStatus(m_sFileToDownloadInto, fs))
{
CString sMsg;
sMsg.Format(GetResString(IDS_HTTPDOWNLOAD_OK_TO_OVERWRITE), m_sFileToDownloadInto);
if (AfxMessageBox(sMsg, MB_YESNO) != IDYES)
{
TRACE(_T("Failed to confirm file overwrite, download aborted\n"));
EndDialog(IDCANCEL);
return TRUE;
}
}*/
//Try and open the file we will download into
if (!m_FileToWrite.Open(m_sFileToDownloadInto, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite))
{
TRACE(_T("Failed to open the file to download into, Error:%d\n"), GetLastError());
CString sError;
sError.Format(_T("%d"), ::GetLastError());
CString sMsg;
sMsg.Format(GetResString(IDS_HTTPDOWNLOAD_FAIL_FILE_OPEN), sError);
AfxMessageBox(sMsg);
EndDialog(IDCANCEL);
return TRUE;
}
//Pull out just the filename component
int nSlash = m_sObject.ReverseFind(_T('/'));
if (nSlash == -1)
nSlash = m_sObject.ReverseFind(_T('\\'));
if (nSlash != -1 && m_sObject.GetLength() > 1)
m_sFilename = m_sObject.Right(m_sObject.GetLength() - nSlash - 1);
else
m_sFilename = m_sObject;
//Set the file status text
CString sFileStatus;
ASSERT(m_sObject.GetLength());
ASSERT(m_sServer.GetLength());
sFileStatus.Format(GetResString(IDS_HTTPDOWNLOAD_FILESTATUS), m_sFilename, m_sServer);
m_ctrlFileStatus.SetWindowText(sFileStatus);
// set labels
SetDlgItemText(IDC_TIMELEFTTEXT,GetResString(IDS_ESTTIMELEFT));
SetDlgItemText(IDC_TRANSFER_RATE_LABEL,GetResString(IDS_TRANSFER_RATE_LABEL));
//Spin off the background thread which will do the actual downloading
m_pThread = AfxBeginThread(_DownloadThread, this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
if (m_pThread == NULL)
{
TRACE(_T("Failed to create download thread, dialog is aborting\n"));
EndDialog(IDCANCEL);
return TRUE;
}
m_pThread->m_bAutoDelete = FALSE;
m_pThread->ResumeThread();
return TRUE;
}
示例15: dc
//.........这里部分代码省略.........
}
else if (client->GetClientSoft() == SO_AMULE){
if(client->credits->GetScoreRatio(client->GetIP()) > 1)
image = 12;
else
image = 11;
}
else if (client->GetClientSoft() == SO_LPHANT){
if(client->credits->GetScoreRatio(client->GetIP()) > 1)
image = 14;
else
image = 13;
}
else if (client->ExtProtocolAvailable()){
if(client->credits->GetScoreRatio(client->GetIP()) > 1)
image = 3;
else
image = 1;
}
else{
if (client->credits->GetScoreRatio(client->GetIP()) > 1)
image = 2;
else
image = 0;
}
POINT point = {cur_rec.left, cur_rec.top+1};
imagelist.Draw(dc,image, point, ILD_NORMAL | ((client->Credits() && client->Credits()->GetCurrentIdentState(client->GetIP()) == IS_IDENTIFIED) ? INDEXTOOVERLAYMASK(1) : 0));
Sbuffer = client->GetUserName();
cur_rec.left += 20;
dc.DrawText(Sbuffer, Sbuffer.GetLength(), &cur_rec, DLC_DT_TEXT);
cur_rec.left -= 20;
break;
}
case 1:
if (file)
Sbuffer = file->GetFileName();
else
Sbuffer = _T("?");
break;
case 2:
Sbuffer = CastItoXBytes(client->GetDatarate(), false, true);
break;
case 3:
// NOTE: If you change (add/remove) anything which is displayed here, update also the sorting part..
if (thePrefs.m_bExtControls)
Sbuffer.Format( _T("%s (%s)"), CastItoXBytes(client->GetSessionUp(), false, false), CastItoXBytes(client->GetQueueSessionPayloadUp(), false, false));
else
Sbuffer = CastItoXBytes(client->GetSessionUp(), false, false);
break;
case 4:
if (client->HasLowID())
Sbuffer.Format(_T("%s (%s)"), CastSecondsToHM(client->GetWaitTime()/1000), GetResString(IDS_IDLOW));
else
Sbuffer = CastSecondsToHM(client->GetWaitTime()/1000);
break;
case 5:
Sbuffer = CastSecondsToHM(client->GetUpStartTimeDelay()/1000);
break;
case 6:
Sbuffer = client->GetUploadStateDisplayString();
break;
case 7:
cur_rec.bottom--;
cur_rec.top++;
client->DrawUpStatusBar(dc, &cur_rec, false, thePrefs.UseFlatBar());
cur_rec.bottom++;
cur_rec.top--;
break;
}
if (iColumn != 7 && iColumn != 0)
dc.DrawText(Sbuffer, Sbuffer.GetLength(), &cur_rec, DLC_DT_TEXT);
cur_rec.left += GetColumnWidth(iColumn);
}
}
//draw rectangle around selected item(s)
if (lpDrawItemStruct->itemState & ODS_SELECTED)
{
RECT outline_rec = lpDrawItemStruct->rcItem;
outline_rec.top--;
outline_rec.bottom++;
dc.FrameRect(&outline_rec, &CBrush(GetBkColor()));
outline_rec.top++;
outline_rec.bottom--;
outline_rec.left++;
outline_rec.right--;
if (bCtrlFocused)
dc.FrameRect(&outline_rec, &CBrush(m_crFocusLine));
else
dc.FrameRect(&outline_rec, &CBrush(m_crNoFocusLine));
}
if (m_crWindowTextBk == CLR_NONE)
dc.SetBkMode(iOldBkMode);
dc.SelectObject(pOldFont);
dc.SetTextColor(crOldTextColor);
}