void MirandaSkinnedDialog::getSettingName(char *setting, const char * name, bool global) { if (global) mir_snprintf(setting, SETTING_NAME_SIZE, "%s%s", getName(), name); else mir_snprintf(setting, SETTING_NAME_SIZE, "%s%s%s", TcharToChar(getSkinName()), getName(), name); }
DWORD CUpdateThread::GetFastServerBak( char *Serv,char *Use,char *psd,int &port ) { TCHAR UserName[100] = {0}; TCHAR PassWord[50] = {0}; TCHAR Temp[100] = {0}; int ServerPort; DWORD Pin = 9999; CDES des; int count = 0; g_Config->ReadInt(_T("MC"), _T("UPDATEBAK"), _T("count"), count); printf("获取服务器列表\n"); TCHAR con[10] = {0}; char ctemp[100] = {0}; char Server[30] = {0}; char User[100] = {0}; char pwd[50] = {0}; for(int i = 1;i <= count;i++) { ZeroMemory(Temp, sizeof(Temp)); ZeroMemory(con, sizeof(con)); wsprintf(con,_T("Code%d"),i); CString strTmp = _T(""); CString strValue = _T(""); g_Config->ReadString(_T("MC"),_T("UPDATEBAK"),con,strValue); //strValue = _T("118.194.133.119:21:pengxiao:123456"); des.Decrypt(strTmp,strValue); _stprintf(Temp,_T("%s"),strTmp.GetBuffer()); memset(ctemp,0,100); TcharToChar(ctemp,Temp); memset(Server,0,30); memset(User,0,100); memset(pwd,0,50); GetDesCode(ctemp,Server,User,pwd,ServerPort); if(i == 1) { memset(Serv,0,30); memset(Use,0,100); memset(psd,0,50); strcpy(Serv,Server); strcpy(Use,User); strcpy(psd,pwd); port = ServerPort; } printf("IP = [%s] \n",Server); } return 1; }
int APIENTRY WinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd ) { if (-1 == Init()) { return 0; } CPaintManagerUI::SetInstance(hInstance); TCHAR strCurPath[256]; memset(strCurPath, 0, 256); GetCurrentDirectory(256, strCurPath); char strPath[300]; memset(strPath, 0, 300); TcharToChar(strCurPath, strPath); strcat_s(strPath, "\\UIFile"); CAppConfig::UI_FILE_PATH = strPath; TCHAR tstrPath[300]; CharToTchar(strPath, tstrPath); CPaintManagerUI::SetResourcePath( tstrPath); CDuiString p = CPaintManagerUI::GetResourcePath(); HICON hIcon = ::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON2)); HRESULT hr = ::CoInitialize(NULL); if (FAILED(hr)) return 0; CLoginWnd* pLoginWnd = new CLoginWnd; if (pLoginWnd == NULL) return 0; pLoginWnd->Create(NULL, _T("Login Window"), UI_WNDSTYLE_DIALOG/*UI_WNDSTYLE_FRAME*/, WS_EX_WINDOWEDGE); ::SendMessage(pLoginWnd->GetHWND(),STM_SETICON,IMAGE_ICON,(LPARAM)(UINT)hIcon); pLoginWnd->CenterWindow(); //pLoginWnd->ShowWindow(); pLoginWnd->ShowModal(); CPaintManagerUI::MessageLoop(); delete pLoginWnd; pLoginWnd = NULL; ::CoUninitialize(); return 0; }
void MirandaFont::registerFont(FontState *font) { if (fid.cbSize != 0) return; MirandaSkinnedDialog * dlg = (MirandaSkinnedDialog *) field->getDialog(); HDC hdc = GetDC(NULL); fid.cbSize = sizeof(fid); lstrcpyn(fid.group, CharToTchar(dlg->getDescription()), sizeof(fid.group)); strncpy(fid.dbSettingsGroup, dlg->getModule(), sizeof(fid.dbSettingsGroup)); char tmp[sizeof(fid.prefix)]; mir_snprintf(tmp, sizeof(tmp), "%s%s%sFont", TcharToChar(dlg->getSkinName()), dlg->getName(), field->getName()); strncpy(fid.prefix, tmp, sizeof(fid.prefix)); fid.deffontsettings.colour = font->getColor(); fid.deffontsettings.size = -MulDiv(font->getSize(), GetDeviceCaps(hdc, LOGPIXELSY), 72); fid.deffontsettings.style = (font->isBold() ? DBFONTF_BOLD : 0) | (font->isItalic() ? DBFONTF_ITALIC : 0) | (font->isUnderline() ? DBFONTF_UNDERLINE : 0) | (font->isStrikeOut() ? DBFONTF_STRIKEOUT : 0); fid.deffontsettings.charset = DEFAULT_CHARSET; lstrcpyn(fid.deffontsettings.szFace, font->getFace(), sizeof(fid.deffontsettings.szFace)); fid.order = dlg->getIndexOf(field); fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS; CallService(MS_FONT_REGISTERT, (WPARAM)&fid, 0); ReleaseDC(NULL, hdc); HookEventObj(ME_FONT_RELOAD, staticReloadFont, this); reloadFont(); }