CWnd wnd;
wnd.Attach(::GetDesktopWindow());
m_MyWnd.Create(IDD_DESKTOPBARDLG_DIALOG,&wnd);
//.....
wnd.Detach();
wnd.Attach(::GetDesktopWindow());
m_MyWnd.Create(IDD_DESKTOPBARDLG_DIALOG,&wnd);
//.....
wnd.Detach();
解决方案 »
- 杯具~。~
- 恩,用VARCHAR时,是不是都设为VARCHAR(8000)?
- 我想把bmp图像放在dll中,然后再用程序调用,如何做呢?请高手指点
- VC中怎么永久的增加对象库?
- ============为什么纯函虚不能在构函数和析构函数中调用?============
- 为什么我看不到DLL文件呢(补充)?
- find()函数的写法?
- 关于CString的应用??
- 关于结束线程的问题,各位老大请帮忙指点,多谢了
- 问题一解决,要专家分的过来,20个结账
- 大侠帮忙,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下自己写算法。