WPF Application freezes on Windows 10 with no display monitor - c#

I have a problem with WPF applications built with MS VS2013 and VS2015 on windows 10. When I turn off the display monitor (connected to computer by HDMI), the application layout freezes but the process continue working fine. When I turn on the display monitor back again, the application layout comes back rendering. It's possible to me see this problem through a TeamViewer session.
Additionally, when I runs the WPF application with display monitor turned off, only the layout hangs with a white screen (the application process keeps working)
I have already create a very simple WPF application (with only one button) and happens the same problem.
My computer have only a Intel HD integrated graphics.
Is it a general problem with the current build of windows 10? Is there any solution to the issue or should I wait for a windows update?
Thanks in advance.

Related

How to fix c# desktop application form resizing or scaling issue for Windows 11

I have a C# desktop application which is developed in dot net framework 4.6.2. This application is working finr in Win 10. But when same application is run in Win 11, all form controls are disturbed. Like few buttons are totally hidden. Is there any global fix? I don't want to reposition and resize the forms and controlls again for the whole application.
The issue you have is because the Windows 11 computer has a different screen DPI setting. Winforms is notoriously bad at scaling with any setting other than 100%. If you cannot run 100% all the time, then you will have to do some coding magic to detect DPI setting and adjust margins and padding... Or you could redo your UI in WPF, which scales properly at any setting.
Some possible avenues to explore if you rebuild to .NET 4.7+:
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8

How to maximise a Windows 10 Universal Application's window to full screen when running on a desktop?

When building a universal application using Windows 10 (or Windows 8.1 WinRT), is it possible to force the application's main window to maximise on launch? This is obviously natural behaviour for the application when running on a mobile device but not when running on the desktop.
This is certainly possible using WinForms:
How do I make a WinForms app go Full Screen
How to display a Windows Form in full screen on top of the taskbar?
But I haven't so far managed to find anything in the Microsoft Documentation about this for Windows 10.
An app can request to start as full screen by setting the ApplicationView.PreferredLaunchWindowingMode to ApplicationViewWindowingMode.FullScreen
Roberth discussed this along with other view and window size issues in his Build session Navigation and Windowing in Universal Windows Apps

How to modifying already designed metro style app to support all screen resolutions?

I'm new to app developed and in my first attempt i tried to design a win8 metro style app. During whole design process i took default screen resolution of 1336X768 and never tested my app in other resolutions.After completing whole development process, now when i change resolution of the simulator and run the app the results are shocking!!!, few buttons are going out of screen, characters in the text box are missing, completely the UI of the app is getting messed up. Is there a way now to modify so that the app supports all the screen resolutions?

App hangs my Windows Phone 7 phone

I am currently developing an app that seems to hang my Windows Phone 7 phone. If I start the application and then press the home button or use the back arrow and then repeat this several times then the phone actually hangs in the middle of the app start animation and I need to restart the phone.
To troubleshoot this issue I created a new project and removed all my code and put there my xaml and animations only. My xaml with the animations inside are about 2800 lines long. When used under debugger no exceptions are thrown nor any other error messages are shown.
I created a project for demonstrating my issue. Here are the steps to reproduce the problem
Open the project in Visual Studio
Select Windows Phone 7 Device
Run the application.
Start using the home or the back button to quit the app and then relaunch it again and again.
Repro_Crash - This is the project that I am using to reproduce my issue.
Image of the Crash - from this point I am forced to restart the phone.
I am looking for hints or tips regarding how to figure out what is happening!
I've tried your project and it runs perfectly fine on my HTC HD7 NoDo. It displays only a large wall of letters without any animations and does not crash the phone. I'm using the latest Mango Beta 2 Refresh SDK.

WIndows Mobile full screen problem

I have a windows mobile professional 6.1 application and I want it to be full screen in all pages so I put the code below into my every pages constructor;
this.WindowState = FormWindowState.Maximized;
this works OK but "sometimes" for example when I use
MessageBox.Show("alert");
or when I try to connect internet within application and there is a problem and Windows shows me some messages popping up from the top of the screen..in this cases I lose my full screen and the top menu bar of windows becomes visible again..
any ideas?
You can use SHFullScreen to hide the start icon and other system areas of the screen. There is an undocumented function named AllKeys which will allow you to block some of the hardware keys (notes, recorder, green + red phone keys) from running. It will require a lot of work because there are many ways to run programs and the taskbar has a habit of reappearing after a program is run. Simply calling SHFullScreen once is not enough. You'll have to handle WM_ACTIVATE messages and call SHFullScreen again and force your program to the top again. It's a struggle against the operating system to have a true kiosk application on Windows Mobile.
Getting an app to "kiosk mode" in Windows Mobile is challenging becasue the platform simply isn't designed for it. This page has a lot of links to resources of getting it working. Using your favorite search engine to look for "compact framework kiosk mode" is likely to bring up more as well.

Categories