博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
类结构定义
阅读量:4047 次
发布时间:2019-05-25

本文共 2880 字,大约阅读时间需要 9 分钟。

BOOL CStandardDialog::OnInitDialog()

{
CDialog::OnInitDialog();
DWORD dwStyle = ::GetWindowLong(m_hWnd, GWL_STYLE);
VERIFY((dwStyle & WS_POPUP) != 0);
VERIFY((dwStyle & WS_BORDER) == 0);
VERIFY((dwStyle & WS_SIZEBOX) == 0);
VERIFY((dwStyle & WS_DLGFRAME) == 0);
m_brush.CreateSolidBrush(m_clrTransparent);
DWORD dwExStyle = ::GetWindowLong(m_hWnd, GWL_EXSTYLE);
VERIFY((dwExStyle & WS_EX_APPWINDOW) == 0);
::SetWindowLong(m_hWnd, GWL_EXSTYLE, dwExStyle | 0x80000);
HMODULE hInst = LoadLibrary(_T("User32.DLL")); 
typedef BOOL (WINAPI *MYFUNC)(HWND, COLORREF, BYTE, DWORD); 
MYFUNC SetLayeredWindowAttributes = NULL; 
SetLayeredWindowAttributes = (MYFUNC)::GetProcAddress(hInst, "SetLayeredWindowAttributes"); 
SetLayeredWindowAttributes(GetSafeHwnd(), m_clrTransparent, 0, 1); 
::FreeLibrary(hInst);
m_ctrlProgress.SetRange(0,100);
m_nMilliSecond=10;
//UpdateData(FALSE);
//UpdateData(TRUE);
//GetDlgItem(IDOK)->SetWindowText(_T("正在更新"));
m_btn2.SubclassDlgItem(IDOK,this);
m_btn2.SetIcon(IDI_STAD);
isWndDisable = GetDlgItem(IDOK)->EnableWindow(0);
// GetDlgItem(IDCANCEL)->EnableWindow(0);//DISABLE CANCEL
//m_btn.EnableWindow(0);
//m_bmpBtn.LoadBitmaps(0,0,0,IDB_BIT_DSA);//,IDB_BMP_FOCUS,IDB_BMP_DISABLE
//m_bmpBtn.SubclassDlgItem(IDOK , this);
//m_bmpBtn.SizeToContent();
//m_bmpBtn2.LoadBitmaps(IDB_BMP_UP,IDB_BMP_DOWN,0,IDB_BMP_DSA);//,IDB_BMP_FOCUS,IDB_BMP_DISABLE
//m_bmpBtn2.SubclassDlgItem(IDCANCEL , this);
//m_bmpBtn2.SizeToContent();
//======================================================
Info.nMilliSecond=m_nMilliSecond;
Info.pctrlProgress=&m_ctrlProgress;
Info.pDlg = this;
Info2.nMilliSecond=m_nMilliSecond;
Info2.pctrlProgress=&m_ctrlProgress;
Info2.pDlg = this;
hThread2=CreateThread( //启动线程下载服务器版本到本地
NULL,
0,
(LPTHREAD_START_ROUTINE)ThreadFunc2,
&Info2,
0,
&ThreadID2);
return TRUE;
}

class kwFilePath : public CString

{
public:
kwFilePath()
{
drive[0] = 0;
dir[0] = 0;
fname[0] = 0;
ext[0] = 0;
}
BOOL Split( const char* pszPathName ){
_splitpath( pszPathName, drive, dir, fname, ext );
return TRUE;
}
BOOL MakeDirectoryForFile( const char* pszPathName ){
Split( pszPathName );
return TRUE;
}
const char* GetDrive(){ 
if( drive[0] )
return drive; 
return "";
}
const char* GetDirectory(){ 
if( dir[0] )
return dir; 
return "";
}
const char* GetFileName(){ 
if( fname[0] )
return fname; 
return "";
}
const char* GetExt()
if( ext[0] )
return ext; 
return "";
}
protected:
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
};

struct threadInfo

{
UINT nMilliSecond;
CProgressCtrl* pctrlProgress;
CStandardDialog* pDlg;
volatile bool bFinish;
volatile unsigned _int64 dwCurSize;
unsigned _int64 dwFileSize;
//CHttpFile* pHttpFile;
CString strFilePath;
//CString strUrlFilePath;
std::vector<CString> vecUrlFile;
std::vector<CString> vecFile;
};
UINT ThreadFunc(LPVOID lpParam);
UINT ThreadFunc2(LPVOID lpParam);
void DownList(void);

转载地址:http://uvfci.baihongyu.com/

你可能感兴趣的文章
【leetcode】Linked List Cycle (python)
查看>>
【leetcode】Linked List Cycle (python)
查看>>
【leetcode】Candy(python)
查看>>
【leetcode】Clone Graph(python)
查看>>
【leetcode】Sum Root to leaf Numbers
查看>>
【leetcode】Pascal's Triangle II (python)
查看>>
java自定义容器排序的两种方法
查看>>
如何成为编程高手
查看>>
本科生的编程水平到底有多高
查看>>
AngularJS2中最基本的文件说明
查看>>
从头开始学习jsp(2)——jsp的基本语法
查看>>
使用与或运算完成两个整数的相加
查看>>
备忘:java中的递归
查看>>
DIV/CSS:一个贴在左上角的标签
查看>>
Solr及Spring-Data-Solr入门学习
查看>>
Vue组件
查看>>
python_time模块
查看>>
python_configparser(解析ini)
查看>>
selenium学习资料
查看>>
<转>文档视图指针互获
查看>>