类似于flashGet悬浮窗的东西怎么实现? 是从CWnd继承来的吗? CWnd wnd;wnd.Attach(::GetDesktopWindow());m_MyWnd.Create(IDD_DESKTOPBARDLG_DIALOG,&wnd);//.....wnd.Detach(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的窗口类的实例。就是: CFloatDlg m_MyWnd;understand? bool cdrawtestapp::initinstance(){ crect rect(0, 0, 320, 150); ctransparentwnd* ptwnd = new ctransparentwnd; m_pmainwnd = ptwnd; pframe->createtransparent("transparent test", rect, idb_mask, idb_back); pframe->showwindow(sw_show); pframe->updatewindow(); return true;}void ctransparentwnd::setupregion(cdc *pdc, unsigned short maskid){ cdc memdc; cbitmap cbitmap; cbitmap* poldmembmp = null; colorref col; crect crect; int x, y; crgn m_rgn, rgntemp; getwindowrect(&crect); cbitmap.loadbitmap(maskid); memdc.createcompatibledc(pdc); poldmembmp = memdc.selectobject(&cbitmap); m_rgn.createrectrgn(0, 0, crect.width(), crect.height()); for(x=0; x<=crect.width(); x++) { for(y=0; y<=crect.height(); y++) { col = memdc.getpixel(x, y); if(col == 0) { rgntemp.createrectrgn(x, y, x+1, y+1); m_rgn.combinergn(&m_rgn, &rgntemp, rgn_xor); rgntemp.deleteobject(); } } } if (poldmembmp) memdc.selectobject(poldmembmp); setwindowrgn((hrgn)m_rgn, true);}void ctransparentwnd::onlbuttondown(uint nflags, cpoint point) { cwnd::onlbuttondown(nflags, point); postmessage(wm_nclbuttondown, htcaption, makelparam(point.x,point.y));} typedef BOOL (FAR PASCAL*LAYERFUNC)(HWND,COLORREF,BYTE,DWORD);void SetTransparent(HWND hwnd,UINT alpha){ LAYERFUNC SetLayer; HMODULE hmod=LoadLibrary("user32.dll"); SetWindowLong(hwnd,GWL_EXSTYLE,GetWindowLong(hwnd,GWL_EXSTYLE)|0x80000L); SetLayer=(LAYERFUNC)GetProcAddress(hmod,"SetLayeredWindowAttributes"); SetLayer(hwnd,0,(255*alpha)/100,0x2); FreeLibrary(hmod);}只能在WinNT下执行,要9x下自己写算法。 串口接收代码找错 关于MFC程序中一些问题 基于对话框的程序,配置写到哪里去了? 如何使用GetTopWindow? 为什么循环跳不出去啊! vc中最基本的问题,希望得到解答! ado sql 数据库 为什么在msdn里找不到某些类的成员函数? 用MFC写的ACTIVEX,如何调整控件的尺寸呢? 求助关于SCSI硬盘安装win2000找不到硬盘驱动器的问题 大侠帮忙,about Oracle's trigger or My grammar's error? 从网上下载的movie是.dem格式的,请问用什么播放工具可以播放?
CFloatDlg m_MyWnd;understand?
{
crect rect(0, 0, 320, 150);
ctransparentwnd* ptwnd = new ctransparentwnd;
m_pmainwnd = ptwnd;
pframe->createtransparent("transparent test", rect, idb_mask, idb_back);
pframe->showwindow(sw_show);
pframe->updatewindow();
return true;
}
void ctransparentwnd::setupregion(cdc *pdc, unsigned short maskid)
{
cdc memdc;
cbitmap cbitmap;
cbitmap* poldmembmp = null;
colorref col;
crect crect;
int x, y;
crgn m_rgn, rgntemp; getwindowrect(&crect); cbitmap.loadbitmap(maskid);
memdc.createcompatibledc(pdc);
poldmembmp = memdc.selectobject(&cbitmap); m_rgn.createrectrgn(0, 0, crect.width(), crect.height());
for(x=0; x<=crect.width(); x++)
{
for(y=0; y<=crect.height(); y++)
{
col = memdc.getpixel(x, y);
if(col == 0)
{
rgntemp.createrectrgn(x, y, x+1, y+1);
m_rgn.combinergn(&m_rgn, &rgntemp, rgn_xor);
rgntemp.deleteobject();
}
}
}
if (poldmembmp) memdc.selectobject(poldmembmp);
setwindowrgn((hrgn)m_rgn, true);
}void ctransparentwnd::onlbuttondown(uint nflags, cpoint point)
{
cwnd::onlbuttondown(nflags, point);
postmessage(wm_nclbuttondown, htcaption, makelparam(point.x,point.y));
}
void SetTransparent(HWND hwnd,UINT alpha)
{
LAYERFUNC SetLayer;
HMODULE hmod=LoadLibrary("user32.dll");
SetWindowLong(hwnd,GWL_EXSTYLE,GetWindowLong(hwnd,GWL_EXSTYLE)|0x80000L);
SetLayer=(LAYERFUNC)GetProcAddress(hmod,"SetLayeredWindowAttributes");
SetLayer(hwnd,0,(255*alpha)/100,0x2); FreeLibrary(hmod);
}只能在WinNT下执行,要9x下自己写算法。