奇怪。。。 同一段代码, 在不同地方有不同较果!!!

Promise91 2004-08-30 11:07:19
我在CDialog 中使用如下代码:
SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,
GetWindowLong(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!=NULL)
fun(GetSafeHwnd(),0,128,0x00000002);

FreeLibrary(hInst);
}

cdialog 窗口 可以变为透明.

但在CRichEditCtrl中使用同样代码,却不能变为 透明。。。  
请大家来帮着分析一下, 
怎么样将CRichEditCtrl设为透明窗口...

谢谢,谢谢,谢谢!!!
...全文
146 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Promise91 2004-08-31
  • 打赏
  • 举报
回复
help !! help !!
Promise91 2004-08-30
  • 打赏
  • 举报
回复
我只要RichCtrl 部分是透明的。。。
zhaogaojian 2004-08-30
  • 打赏
  • 举报
回复
你将RichCtrl放到Dialog上就是透明的呀。
Kudeet 2004-08-30
  • 打赏
  • 举报
回复
Rich edit 2.0 (and higher) can be made transparent with WS_EX_TRANSPARENT style, and any kind of background can be put under it with minimal flickering, as long as parent window redraws only the modified rectangle.

http://www.codeguru.com/richedit/richtrans.shtml
Transparent RichEdit control

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧