重载 BOOL CMineDlg::OnInitDialog() 函数 里面的一个函数指针比较有趣
SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000);
//加载动态库
HINSTANCE hInst = LoadLibrary("User32.DLL");
if ( !hInst )
{
FreeLibrary(hInst);
return FALSE;
}
//定义一个函数指针的类型
typedef BOOL (WINAPI * MYFUNC)(HWND,COLORREF,BYTE,DWORD);
MYFUNC fun = NULL;
//获取函数 SetLayeredWindowAttributes
fun = (MYFUNC)GetProcAddress(hInst,"SetLayeredWindowAttributes");
if (!fun)
{
FreeLibrary(hInst);
return FALSE;
}
fun(this->GetSafeHwnd(),0,120,2);
FreeLibrary(hInst);