[常用的界面对象操作]

1. 获取指定大小字体

HFONT AppUtil::GetFont(int pixel,bool bold,const wchar_t* font_name){LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); // zero out structure lf.lfHeight = pixel; // request a 8-pixel-height fontif(bold){lf.lfWeight = FW_BOLD; }lstrcpy(lf.lfFaceName, font_name); // request a face name "Arial"HFONT font = ::CreateFontIndirect(&lf);return font;}2. 使用默认浏览器打开超链接

void AppUtil::OpenUrl(std::string url){::ShellExecuteA(NULL, "open", url.c_str(),NULL, NULL, SW_SHOWNORMAL);}3. 打开文件夹

void AppUtil::OpenFolder(std::wstring output_dir_){::ShellExecute(NULL, L"explore",output_dir_.c_str(), NULL, NULL, SW_SHOWNORMAL);}4. 获取DC的作用Bitmap大小

BITMAP GetDCBitmapSize(HDC hdc){BITMAP structBitmapHeader;memset( &structBitmapHeader, 0, sizeof(BITMAP) );HGDIOBJ hBitmap = GetCurrentObject(hdc, OBJ_BITMAP);GetObject(hBitmap, sizeof(BITMAP), &structBitmapHeader);return structBitmapHeader;}

,不能接受失败,也意味太想去成功了,从心理学上解释,

[常用的界面对象操作]

相关文章:

你感兴趣的文章:

标签云: