高分求教:如何创建一个完全透明的窗口? 我想创建一个完全透明的窗口。即可以透过此窗口实时看到此窗口下面所发生的一切,如光标闪烁、动画等。不知如何做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以构造一个区域,中间是空的,自然就可以看到窗口下的一切(和他没关系:)然后使用SDI函数SetWindowRgn去设置。 我知道怎么做,要代码留下邮箱地址.我的邮箱是:[email protected] http://www.vckbase.com/code/winview/advui/alphaw.ziphttp://www.vckbase.com/code/graphics/bitmap/TransparentWindow_demo.zip SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE, GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000); HINSTANCE hInst = LoadLibrary("User32.DLL"); if(hInst) { typedef BOOL (WINAPI *MYFUNC)(HWND,COLORREF,BYTE,DWORD); MYFUNC fun = NULL; //取得SetLayeredWindowAttributes函数指针 fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes"); if(fun)fun(this->GetSafeHwnd(),0,230,2); FreeLibrary(hInst); } http://www.codeproject.com/bitmap/gditutorial.asp 谢谢大家,尤其是howtotell。我试过了,这个方法确实可以。但是这只在win2k/xp上有用。但我想让我的程序可在各个版本的windows上运行。有谁知道SetLayeredWindowAttributes这个API的实现原理,或有其它办法? SetLayeredWindowAttributes这个API只有win2000以上的操作系统才支持 TransWindow MyTransWindow;if( MyTransWindow.Create()) MyTransWindow.Destroy();注意由于是完全透明的窗口,所以你将看不到任何窗口.best regards 关于浏览器插入代码的问题 如何改变生成exe的图标 为何ATL 工程是用DEBUG方式编译可以,但RELEASE MINISIZE却提示错误? 数据类型的错误 各位帮忙,有没有得到某个硬盘容量的控件 在ASP中调用VC的COM报错?急!急!急! 请问在InstallShield中如何把MFC库打包进去,很急,谢谢!!! 如何在rc文件中使用条件编译预处理符? OpenProcess疑问 新手宏问题请教 急需InstallShield Professional6.1的中文语言包(100) 求救CArray
我的邮箱是:[email protected]
http://www.vckbase.com/code/graphics/bitmap/TransparentWindow_demo.zip
GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000);
HINSTANCE hInst = LoadLibrary("User32.DLL");
if(hInst)
{
typedef BOOL (WINAPI *MYFUNC)(HWND,COLORREF,BYTE,DWORD);
MYFUNC fun = NULL;
//取得SetLayeredWindowAttributes函数指针
fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
if(fun)fun(this->GetSafeHwnd(),0,230,2);
FreeLibrary(hInst);
}
但是这只在win2k/xp上有用。但我想让我的程序可在各个版本的windows上运行。
有谁知道SetLayeredWindowAttributes这个API的实现原理,或有其它办法?
MyTransWindow.Destroy();注意由于是完全透明的窗口,所以你将看不到任何窗口.best regards