码迷,mamicode.com
首页 > Windows程序 > 详细

DrawWindowFrame

时间:2014-07-22 00:14:36      阅读:284      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   io   re   

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

标签:des   style   blog   color   io   re   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!