V
Vitincy
Unregistered / Unconfirmed
GUEST, unregistred user!
为什么我在Winme下,只能设置程序本身的窗口的区域,对其他程序的窗口进行SetWindowRgn会失败,但是在Win2000下却都可以?
代码:
HWND hWnd = FindWindow(NULL,"Test");
if(hWnd!=NULL)
{
HRGN hRgn = CreateEllipticRgn(0,0,200,100);
if(hRgn==NULL)
MessageBox(HWND_DESKTOP,"CreateEllipticRgn failed","Error",MB_ICONSTOP);
else
{
if(!SetWindowRgn(hWnd,hRgn,TRUE))
MessageBox(HWND_DESKTOP,"SetWindowRgn failed","Error",MB_ICONSTOP);
DeleteObject(hRgn);
}
}
else
MessageBox(HWND_DESKTOP,"找不到窗口:Test","Error",MB_ICONWARNING);
代码:
HWND hWnd = FindWindow(NULL,"Test");
if(hWnd!=NULL)
{
HRGN hRgn = CreateEllipticRgn(0,0,200,100);
if(hRgn==NULL)
MessageBox(HWND_DESKTOP,"CreateEllipticRgn failed","Error",MB_ICONSTOP);
else
{
if(!SetWindowRgn(hWnd,hRgn,TRUE))
MessageBox(HWND_DESKTOP,"SetWindowRgn failed","Error",MB_ICONSTOP);
DeleteObject(hRgn);
}
}
else
MessageBox(HWND_DESKTOP,"找不到窗口:Test","Error",MB_ICONWARNING);