• 您的位置我爱Aspx >> VC.Net >> <b>一段使窗口透明的代码(仅适用于2000)</b>
  • <b>一段使窗口透明的代码(仅适用于2000)</b>

  • 作者:aspxer  来源:internet  日期:2007-5-21 23:14:05  关键字:
  • 一段使窗口透明的代码(仅适用于2000)

    BOOL SetTransparent(HWND hWnd)

    {

    HMODULE hModule =GetModuleHandle("User32.DLL");

    if(hModule == NULL)

    {

    return FALSE;

    }

    typedef BOOL (WINAPI* SETLAYEREDWND)( HWND, COLORREF, BYTE, DWORD);

    SETLAYEREDWND SetLayeredWindowPtr = NULL;

    SetLayeredWindowPtr = (SETLAYEREDWND)GetProcAddress(hModule, "SetLayeredWindowAttributes");

    if(SetLayeredWindowPtr)

    {

    LONG lStyle = GetWindowLong(hWnd, GWL_EXSTYLE) | 0x00080000;

    SetWindowLong( hWnd, GWL_EXSTYLE, lStyle);

    SetLayeredWindowPtr( hWnd,

    RGB(0, 0, 0),

    BYTE((255 * 70) / 100),

    2);

    }

    }

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:<b>.NET架构的核心开发技术</b>
    下一篇:<b>在Windows95/98中实现苹果窗口界面</b>
  • 相关文章