首页 > Windows开发 > 详细

DrawWindowFrame

时间:2014-07-22 00:13:05      阅读:419      评论:0      收藏:0      [点我收藏+]
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;
}

DrawWindowFrame,布布扣,bubuko.com

DrawWindowFrame

原文:http://www.cnblogs.com/cause/p/3858594.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!