首页 > 代码库 > DrawWindowFrame
DrawWindowFrame
extern void DrawWindowFrame(HWND hWnd)//画窗口边框{ RECT rc; HWND DeskHwnd = ::GetDesktopWindow(); //取得桌面句柄 HDC DeskDC = ::GetWindowDC(DeskHwnd); //取得桌面设备场景 int oldRop2 = SetROP2(DeskDC, R2_NOTXORPEN); ::GetWindowRect(hWnd, &rc); //获得窗口矩形 if( rc.left < 0 ) rc.left = 0; if (rc.top < 0 ) rc.top = 0; HPEN newPen = ::CreatePen(0, 3, RGB(125,0,125)); //建立新画笔,载入DeskDC HGDIOBJ oldPen = ::SelectObject(DeskDC, newPen); ::Rectangle(DeskDC, rc.left, rc.top, rc.right, rc.bottom); //在指示窗口周围显示闪烁矩形 //::Beep(100,100); Sleep(400); //设置闪烁时间间隔 ::Rectangle( DeskDC, rc.left, rc.top, rc.right, rc.bottom); ::SetROP2(DeskDC, oldRop2); ::SelectObject( DeskDC, oldPen); ::DeleteObject(newPen); ::ReleaseDC( DeskHwnd, DeskDC); DeskDC = NULL;}
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。