欢迎访问:常州市武进区嘉泽中心小学网站 !今天是:
栏目列表
您现在的位置是:首页>>教师>>计算机技术>>程序设计>>杂项>>文章内容
让你的窗口透明起来
发布时间:2008-11-20   点击:   来源:本站原创   录入者:佚名
 


#define WS_EX_LAYERED           0x00080000
#define LWA_COLORKEY            0x00000001
#define LWA_ALPHA               0x00000002

typedef BOOL (*_SetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
_SetLayeredWindowAttributes SetLayeredWindowAttributes;

void SetLayered(HWND hWnd,int Pos)
{
 SetLayeredWindowAttributes = (_SetLayeredWindowAttributes)GetProcAddress(GetModuleHandle("user32.dll"),"SetLayeredWindowAttributes");
 if ( SetLayeredWindowAttributes == NULL )
  return ;
 else{
   __try{
    SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE)|WS_EX_LAYERED);
    SetLayeredWindowAttributes(hWnd,RGB(0,0,0),Pos,LWA_ALPHA);
   }
   __except(EXCEPTION_EXECUTE_HANDLER){
    AfxMessageBox("SYSTEM FALSE");
   }
 }
}


附件:
    关闭窗口
    打印文档
    账号登录
    保持登录 忘记密码?
    账号与武进教师培训平台同步