I have an application written in C# and running on Windows Mobile 5. It currently takes several seconds to load all of the assemblies. During that time the wait cursor spins on top of the screen. I would like to show a splash screen with a progress bar instead. How can I prevent the cursor from being displayed?
You can't. The CF execution engine (i.e. mscoree) itself makes the call to set the wait cursor, and this happens before it even starts JITting code. There's no way to hook into that and no registry entry (known or undocumented) that can turn the behavior off.
Related
I have a winforms app that is capable of showing forms, and even upon closing the last visible form will continue to run in the background - and I make use of a notify tray (system tray) icon to show that it is running.
I have code in place to prevent right click\Exit on this icon if any forms are visible. I check that
System.Windows.Forms.Application.OpenForms > 0
and while this seems to work for the most part, it may not be reliably (testing this application on other machines seems to yield unexpected results). Is there a way to check if a winforms app is running as a background process (as opposed to counting the number of open forms)?
I developed a desktop program (C#) with the purpose to notice me every 30 minutes a message (a message box appear on topMost and the program icon on taskbar blinks), then the OK_klick event remove the property topMost and the counter restart from zero.
But sometimes:
my form doesn't appear topMost, but other applications (generally Web pages) cover it (I bypassed this with flashing the icon on task bar)
my application semms hasn't pryority on other process (for example a web page is loading) with the result the form appear at later time.
Is it possible to give to my app an higer priority in order to, whatever the system is doing, the form appear in time?
My app runs on Vista, DotNet4.0, language C#
Thanks in advance for any suggestion.
When I run my application, do some work on it and then change the keyboard input language (via alt+shift or task bar), my C#, .net-4 application became completely unresponsive. meaning mouse click does not effects the window and the window itself cannot be moved. That been said, no hour glass is been displayed and the process does not go into the "Application do not respond" state, i.e it will not be shutdown by the operation system (windows 7).
I have encountered a problem like this once when I had (in a different application) a deadlock between the UI thread and another thread. I can assure you this is not the case here, I have been debugging this phenomenon from different angles and no thread in the system is at a join whit or sleep state. not only that but the UI main thread is at the UI (normal exsepting messages from the operation system).
to summerise:
My application is a C# 4 application running on the .net 4 framework.
The application runs on windows 7 (we have no xp computers to try it on).
When the input languge changes the application became unresponsive for the user, but windows does not treat it as such and does not make an attempt to force close it.
Did anybody encountered a problem like this before? I could realy use a starting direction on this one...
we would like to build a screensaver that shows the desktop and the running applications but prevents user input by showing the login screen. The idea was to build a windows app with no window or a transparent window. However, as soon as the screensaver gets activated the desktop and all applications are hidden from the screen.
Is it possible to start the screensaver without hiding the desktop?
Thx,
bja
Is it possible for you to implement this as something other than a screensaver? I'm assuming that the Windows API does have a method that allows you to tell how long the computer has been idle (otherwise, how does the stuff that manages screensavers do it?), so if you use that you could just set up your application such that it's continuously running as a background process, and will pop up a modal dialog box (or your idea of a transparent window) or something that prompts for the user's login info when the computer has been idle for a certain amount of time.
Why can't you just grab an image of the screen when the SS kicks off. Then use that as the backdrop of your SS.
Vista has a bubbles screen saver that just starts putting bubbles on the screen. Not sure how they do it.
You are better off just creating a full-screen application with a transparent window that starts up on a timer like a screensaver. The screensaver functionality while similar to what you are doing, functions much differently.
As an alternative suggestion, you could always use a service (or background app) to gather the information you want these monitoring tools to display, or even just to grab periodic screenshots of the (hidden) desktop, and then have your screensaver query that app to get the data it needs to display.
That way, you get the benefit (the secure desktop, the usual Windows login sequence, etc.) of a screensaver, but still get to display what you need to.
When starting my app I at first have to read in some data, have to init some forms and so on.
For that time the user sees just grey getting-ready to show something forms.
This lasts for a few seconds...
I thought of a Splash Screen that loads the data in a seperate Thread and also shows how long it will take. Or just a status bar?
How would you do something like this?
I'm using C# .NET 3.5 + Winforms
See this CodeProject article: A Pretty Good Splash Screen in C#
It implements a splash screen that:
Runs on a separate thread
Fades in as it appears, and fade out as it disappears
Displays a running status message that is updated using a static method
Displays and update a predictive self-calibrating owner-drawn smooth-gradient progress bar
Displays the number of seconds remaining before load is complete
Here's an example of what it looks like - maybe yours will be prettier. 8-)
With WindowsForm, the easier is to use Backgroundworker.
You can disables controls during loading and display a progress bar on startus bar with label as "loading data...".
MSDN link : http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
If it only lasts a few seconds then displaying the wait
cursor should be fine. Perhaps it can be arranged that the
main window is shown as quickly as possible and the rest is
started after the first screen update (e.g. using a timer).
This will reduce the perceived start-up time.
In order to reduce the startup time you may also consider
postponing some of startup actions if they are not strictly
necessary. It can be done later in the background using a
timer or on-demand.
I recently wrote a similar splash screen using Tom Clements as a basis. Take a look at My Splash Screen to see if it fits your needs.