Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 617179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:24:24+00:00 2026-05-13T18:24:24+00:00

I know how to make my own application transparent using Layered Windows but I

  • 0

I know how to make my own application transparent using Layered Windows but I want to make a different application transparent (for example notepad).
I wrote code like this but it doesn’t work with other windows except my app main window:

SetWindowLongPtr(WindowFromPoint(p), GWL_EXSTYLE, 
                 GetWindowLongPtr(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(WindowFromPoint(p), 0, (255 * 50) / 100, LWA_ALPHA);

where p is a point on screen ( for example the window I select with my mouse )

I am also interested if there is a way to do this directly from Windows 7 (not necessarily programmatic). I figure there must be a way to do it since every application is rendered in it’s own surface and DWM composites them into the final image.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:24:24+00:00Added an answer on May 13, 2026 at 6:24 pm

    You are using a different window handle for SetWindowLongPtr than the one you use for GetWindowLongPtr is that a bug in your code or just a typo in your question?

    The following code works for me on Windows Server 2003 and on Windows 7

       POINT ptScreen = pt;
       ClientToScreen(pwnd->hdr.hwnd, &ptScreen);
       HWND hctl = WindowFromPoint(ptScreen);
       if (IsWindow(hctl))
          {
          LONG lExStyle = GetWindowLong(hctl, GWL_EXSTYLE);
          lExStyle ^= WS_EX_LAYERED;
          SetWindowLong(hctl, GWL_EXSTYLE, lExStyle);
          SetLayeredWindowAttributes(hctl, 0, 
              (lExStyle & WS_EX_LAYERED) ? (255 * 50) / 100 : 255, 
              LWA_ALPHA);
          }
       }
    

    However, it only works if WindowFromPoint returns the top level window for the application, if it returns a child window, then the code doesn’t work. So it works when the mouse is over the caption of the window I want to make transparent, but usually not anywhere else.
    (tested with notepad)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know if it's possible to make my own chat application with
I was using a UITabBar for my application but (for my own reasons) I
I am using jqGrid in an application, and I want to use my own
I don't know how make my application as auto start application.That is my expectation
I'm thinking about frameworks. I know they make life a lot easier, but as
I know how to make the intellisense work in a .js file using this
I know how to make the list of the Fibonacci numbers, but i don't
I want to make an application with plugins that also can have plugins (which
I want to know if it's possible to customize the default contact application because
I want to make an iPhone application through which users can post on their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.