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 8031201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:00:55+00:00 2026-06-05T01:00:55+00:00

I have a program which is not written by me. I dont have its

  • 0

I have a program which is not written by me. I dont have its source and the developer of that program is developing independently. He gives me the HWND and HINSTANCE handles of that program.

I have created a child window ON his window, using win32 api.

First thing I need is to make this child window have transparency on some area and opaque on other area(like a Heads up display(HUD) for a game), so that the user may see things in both windows.

The second thing that I need is to direct all the input to the parent window. My child window needs no input.

I know that WS_EX_TRANSPARENT only makes the child draw at the end like in painters algorithm.

I cant use WS_EX_LAYERED because its a child window.

p.s.

I have looked everywhere but didn’t find any solution though there were similar questions around the internet.

Actually this is a HUD like thing for that game. I can’t draw directly on parent window because of the complexity with multi-threads any many other reasons.

— EDIT —————————

I am still working on it. I am trying different ways with what you all suggested. Is there a way to combine directX and SetWindowRgn() function or directx with BitBlt() function? I think that will do the trick. Currently I am testing all the stuff as a child window and a Layered window.

  • 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-06-05T01:00:57+00:00Added an answer on June 5, 2026 at 1:00 am

    OK friends, finally I did some crazy things to make it happen. but its not very efficient, like using DirectX directly for drawing.

    What I dis:

    • Used (WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_ TOOLWINDOW) and () on CreateWindowEx
    • After creating the window, removed (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE) from window styles, and also removed (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | WS_EX_APPWINDOW) from extended window styles.
    • This gives me a window with no borders and its also now shown in the taskbar. also the hittest is passed to whatever that is behind my window.
    • Subclassed the window procedure of the other window and got the
      • WM_CLOSE,WM_DESTROY, to send the WM_CLOSE or WM_DESTROY respectively to my window
      • WM_SIZE,WM_MOVE, to resize and move my window according to the other window
      • WM_LBUTTONUP,WM_RBUTTONUP,WM_MBUTTONUP, to make my window brought to the top, and still keep focus on the other window, so that my window doesn’t get hidden behind the other window
    • Made the DirectX device have two passes:
      • In the first pass it draws all the elements in black on top of a white background and copy the backbuffer data to an another surface (so it give a binary image of black & white).
      • In the second pass it draws the things normally.
    • Another thread is created to keep making the window transparency by reading that black & white surface, using the SetWindowRgn() function.

    This is working perfectly, the only thing is it’s not very good at making things transparent.

    And the other issue is giving alpha blending to the drawn objects.

    But you can easily set the total alpha (transparency) using the SetLayeredWindowAttributes() function.

    Thanks for all the help you guys gave, all the things you guys told me was used and they guided me, as you can see. 🙂

    The sad thing is we decided not to use this method because of efficiency problems 🙁

    But I learned a lot of things, and it was an awesome experience. And that’s all that matters to me 🙂

    Thank You 🙂

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

Sidebar

Related Questions

I have a program which creates certain save files during its use. Technically they
I have a program which runs on a console and its Umlauts and other
I have a main program written in C# which creates and uses objects written
I have a program written in foxpro (~shudder~) that I've inherited. The issue is,
If I want to compile a program that is written in Ada, I have
I have a program written in C++ which uses dlopen to load a dynamic
I have written a little program that parses log files of anywhere between a
I have a program written in C, which includes 2 functions, one function is
i'm trying to debug a program, that i don't have the source code for:
Assume that i have written a program in C++ without using RTTI and run-time

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.