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

  • Home
  • SEARCH
  • 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 1084529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:34:22+00:00 2026-05-16T22:34:22+00:00

Here’s the scenario: 1: Our WPF application starts 2: The WPF application loads various

  • 0

Here’s the scenario:

1: Our WPF application starts

2: The WPF application loads various user controls, including some that use the new BitmapCache feature in WPF 4

3: Hit ctrl-alt-delete or win+l or load another application which requires UAC

4: Cancel that stuff

The WPF application is now unresponsive, however it’s WPF itself which is the problem. All the application logic on all the background threads is fine, and you can interact with it by pressing alt+f4, etc, but the screen never redraws

Points of note:

  • If you break into the debugger at this point there is no user code running, it’s all WPF
  • Killing DWM.exe brings the application back to life
  • If we take out the BitmapCached elements, it doesn’t lock up
  • I made another simple sample application which used BitmapCache, and it didn’t exhibit the problem.

Help!!

  • 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-16T22:34:22+00:00Added an answer on May 16, 2026 at 10:34 pm

    After much hard work, a co-worker finally managed to track this down.

    Our application initially shows a logon window, then closes it, and shows a main window. We discovered a long time ago that if you do this, WPF assumes that the first window (the logon window) is the application’s main window, and so it shuts down when it closes.

    To mitigate this, we created a fake offscreen window (which is never shown) before any other windows. WPF then assumes this fake window is the main one – it never closes, so our app can work as desired.

    For reference, the fake window looks like this:

    m_mainWindow = new Window { Left = int.MaxValue, Top = int.MaxValue, Width = 1, Height = 1 };
    m_mainWindow.ShowInTaskbar = false;
    

    This was all fine. Some time later, another developer added some code to Show and Hide this fake window.

    Showing the main window was what caused it.


    Here’s a full repro:

    A: Make a new WPF app in visual studio

    B: Put the following code in your App class in App.xaml.cs

    public partial class App : Application
    {
        Window m_mainWindow;
    
        public App()
        {
            m_mainWindow = new Window { Left = int.MaxValue, Top = int.MaxValue, Width = 1, Height = 1 };
            m_mainWindow.ShowInTaskbar = false;
            
            // Comment this line out and the problem goes away
            m_mainWindow.Show();
        }
    }
    

    C: Put at least one BitmapCached element in your MainWindow.xaml. Here’s mine

    <Window x:Class="LockupRepro.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525">
        <Grid CacheMode="BitmapCache">
            <Button Content="Look a button" />
        </Grid>
    </Window>
    
    1. Run this program (I’m on windows 7), and then press ctrl+alt+del, or bring up a UAC prompt.

    You’ll see the app appear to lock up as described in the question – commenting out the m_mainWindow.Show fixes it.

    Update:

    Upon some further investigation it’s not just showing the window, it’s the fact that ShowInTaskBar is set to false. If we don’t set that, then showing the window no longer causes the issue.

    Bizarre!

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

Sidebar

Related Questions

Here's my scenario - I have an SSIS job that depends on another prior
Here is the scenario: I'm writing an app that will watch for any changes
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here is the issue I am having: I have a large query that needs
Here's a coding problem for those that like this kind of thing. Let's see
Here's a problem I ran into recently. I have attributes strings of the form
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here is my code, which takes two version identifiers in the form 1, 5,
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE
Here we go again, the old argument still arises... Would we better have a

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.