+ Reply to Thread
Results 1 to 2 of 2

Thread: How to make a window transpranet using a WIN32 API?

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    38

    How to make a window transpranet using a WIN32 API?

    I have WIn32 application.

    I want to make the window transparent and using following WIN32 API:

    SetLayeredWindowAttributes(0, (255 * 20) / 100, LWA_ALPHA) ;

    This does not make the window transparent.

    Am I missing something? Please help...

  2. #2
    Junior Member
    Join Date
    Apr 2012
    Posts
    43
    Your window should have "WS_EX_LAYERED" style defined.

    Code:
    void CMyDlg::MakeWindowTransparent()
    {
        LONG dwStyle = GetWindowLong(m_hWnd, GWL_EXSTYLE) ;
        dwStyle |= WS_EX_LAYERED ;
        SetWindowLong(m_hWnd, GWL_EXSTYLE, dwStyle) ;
        
        SetLayeredWindowAttributes(0, (255 * 20) / 100, LWA_ALPHA) ;
    }
    Did you do that?

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts