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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:33:38+00:00 2026-06-08T12:33:38+00:00

I’m creating a Qt/C++ application using QML for some parts. Under windows I would

  • 0

I’m creating a Qt/C++ application using QML for some parts. Under windows I would like to make use of the translucent windowing using ExtendFrameIntoClientArea as seen in this snippet from my window class.

#ifdef Q_WS_WIN
    if ( QSysInfo::windowsVersion() == QSysInfo::WV_VISTA ||
         QSysInfo::windowsVersion() == QSysInfo::WV_WINDOWS7 )
    {
        EnableBlurBehindWidget(this, true);
        ExtendFrameIntoClientArea(this);
    }
#else

The code is working nicely with one exception. If the transparent window system is turned off the background becomes black, and as part of my UI is transparent it becomes dark as well. The same thing happens when logging in to a remote computer running the application, even if the transparent windowing system is re-initialized immediately the background stays black until the above code is executed again. This is demonstrated in this image: Comparison of failed rendering (in background) and correct (in front).

The problem is to find a signal to connect to re-initializing the transparent window, or better yet to detect when windows are drawn transparently and draw the UI accordingly. Any alternative solutions are also welcome.

  • 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-08T12:33:39+00:00Added an answer on June 8, 2026 at 12:33 pm

    After digging around in both Qt and MSDN Aero documentation I came up with a two step solution. By overriding the winEvent method of my main window, I was able to receive the signal which is triggered every time the translucent window system is enabled or disabled.

    #define WM_DWMCOMPOSITIONCHANGED        0x031E
    
    bool MainWindow::winEvent(MSG *message, long *result) {
        if ( message->message == WM_DWMCOMPOSITIONCHANGED ) {
            // window manager signaled change in composition
            return true;
        }
        return false;
    }
    

    That took me quite close, but it didn’t tell me whether DWM was currently drawing transparent windows or not. By using dwmapi.dll I was able to find a method which does exactly that, and it can be accessed like below:

    // QtDwmApi.cpp
    extern "C"
    {
        typedef HRESULT (WINAPI *t_DwmIsCompositionEnabled)(BOOL *pfEnabled);
    }
    
    bool DwmIsCompositionEnabled() {
        HMODULE shell;
    
        shell = LoadLibrary(L"dwmapi.dll");
        if (shell) {
            BOOL enabled;
            t_DwmIsCompositionEnabled is_composition_enabled = \
                  reinterpret_cast<t_DwmIsCompositionEnabled>(
                      GetProcAddress (shell, "DwmIsCompositionEnabled")
                      );
            is_composition_enabled(&enabled);
    
            FreeLibrary (shell);
    
            if ( enabled ) {
                return true;
            } else {
                return false;
            }
        }
        return false;
    }
    

    My implementation is now able to react to changes in Aero and draw the GUI accordingly. When logging in over remote desktop the window is drawn using transparency as well where available.

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

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace

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.