I am working on a WinForms application and have to show the Application Icon(Notification Icon) in the System tray. Things working fine. But when I go to a sub page from the main page and come back and check the system tray It has 2 notification Items in the system tray. Again When I go to another page and see, another duplicate Icon appears in the system tray. Like that the number of notification icons gets increase when i go to another page and come back.
If someone can Guide me where I have gone wrong, really appreciate. Thanks in advance...
Since you're not giving any code, I'm gonna go on hunches and lucky guesses:
The logic you implemented to generate a notification icon gets executed on an event that occurs when you change page in your app. (Likely)
There is a chipmunk that lives inside your computer, and he felt like monday is messing-with-da-master day. (Not so likely)
Related
I'm trying to implement unity ads for the first time in an android game. Everything seems to be working properly except for one thing. When the ShowAd method is called
it takes 2 seconds for the advertisement to be actually displayed, during which time if you turn off and open the phone screen, the game stops, superimposing a black screen on the screen. I think what really happens is that the ad starts in the background until the application loses its focus, and when I reopen the phone the ad closes automatically leaving only the black screen. I thought that to avoid this, I should reload the application based on a check in onapplicationfocus function, such as: if the user pressed the lock button on the phone, if the screen is closed, or simply a check if the application is lost focus due to the ad or another event. Another solution would be to configure the application to run in the background somehow, but I did not manage to apply any of the above. Does anyone know how to apply one of the above? Thanks in advance!
I read a lot about application states, tombstoning and recommended practises but I am still confused
Here is my scenario
User launches app through application icon.
User then moves to next page.
User Click on Windows button.
User launches app again using application icon
What should happen here?
My second page should be displayed? because user didn't quit the app through back button
Main page should be displayed? because user launched it through app list which means new instance
MSDN says
Ensure that when your application is launched by the user from Start
or the installed applications list, the user is taken to a consistent
launch experience. It should be evident to the user that they are
experiencing a new application instance.
Does this mean that I should launch the main page again not second page?
If yes, should my app state only be restored(to second page) when user comes to my app through back button and Application_Activated event is fired?
You should start new instance of application.
I believe this is also part of certification process.
And the whole thing would get quite complicated, because only way to ensure, that application is onpened on same page, with same data, is to save whole state into isolated storage.
Unless you're doing some crazy custom stuff, this should be handled for you as page navigation is supported by the deactivation process.
If the user backs into your application, the last page they were on will be restored and PhoneApplicationService.Activated will be raised (ActivatedEventArgs.IsApplicationInstancePreserved will be true if you don't need to unpersist your state).
If the user accesses your application from start, the application's default page will be loaded and PhoneApplicationService.Launching will be raised.
The only thing I would show first one time only is the help or options screen so a new user can get to know the app.
From that time on, when the app is started it should start with the key/main page that the user wants to use.
I'm working on a rather big project with my team and after a while, we struck into a big problem.
Infact when we minimize the main window of the application, clicking on the taskbar to restore it results in a "bing" sound (the one that windows uses when you are trying to interact with a background window when a modal dialog is opened on it). I can't restore the window except if I press ENTER button (after obviusly clicking on it).
We are using XNA to render something inside a WindowsFormsHost component in our WPF application and the problem comes out when we change something that is not connected directly with wpf (something inside the rendering engine, so it works only with XNA).
I can't post any code because I don't own any rights of it and would be meaningless because the project is enough big.
So my question is: what are the things that can produce a problem like this one (unable to restore window sound) when you click on the taskbar?
At least I can understand where to search for this bug, because I don't even understand where I shall dirt my hands in.
Important notes: I'm using a splash screen and the problems come up when I do something on a second window (so not directly the main one) which is not modal
Thanks for any suggestion
We solved the problem by finding out that there is a bug with an external component that we used inside our application. Still I don't understand how this bug has been created, if someone has a better answer I'll mark it.
I have an application where the taskbar flashes if an event has occurred. This is working perfectly, and was relatively easy to implement using a Win32 API described below:
http://blogs.x2line.com/al/archive/2008/04/19/3392.aspx
However, when I stop the flashing, sometimes the application is stuck in the "highlighted" state in the taskbar. This only gets reset by clicking on the application in the taskbar, minimizing it, then re-maximizing it. Is there a way to clear this from being highlighted without any user interaction?
Maybe instead of flashing it you could put an overlay icon on it - one line of code from C# with the Code Pack. Then when you want to clear it you could take the overlay icon away - again one line of code. Windows 7 only, however.
Can you post the code that you are using to "Stop" the flashing?
Have you also considered using a different flag such as:
// flash until the window comes to the foreground
FLASHW_TIMERNOFG = 12;
You will still need to click on the applicaiton to get the flash to stop, but you should not have to minimize then re-maximize the app to get the flash to stop.
You can include the FlashTaskbar snippet and use the following code
FlashWindow(Form.Handle, FlashMode.FLASHW_STOP)
I want to create an alarm app for myself. On certain conditions (i need to poll websites) i want my app to inform me and make it HARD TO MISS. So i can take appropriate action or ignore it if i need to do something else.
I wrote a test app and using a BalloonTip (ShowBalloonTip with notifyIcon) isnt great. One of my previous apps brings the window in front of you and does a MessageBox however that doesnt always work or work well (if i somehow miss it or accidentally forget to click ok no futher messages will occur).
What are your suggestions?
You could also make it a system tray application and change the icon out if there is something which requires attention, a la a messenger application. That may not be "hard to miss" but I am trained (for better or worse) to look down at the icon tray when I see something blinking.
Where I work, we have a TimeTracker application (built in house) with which developers are supposed to log what we worked on and when. I am notorious for not using it. So, I wrote my own (Windows Forms) version for my own use which, every hour opens up and takes over my screen:
It is a frameless dialog which consumes the entire screen.
TopMost = True.
On resize, it sets WindowsState = Normal and resizes to fill the screen.
While it is open, it polls for taskmgr.exe and procexp.exe and kills them if found.
It disables the start menu to prevent cmd.exe commands from the menu in Windows 7.
The only way to close it is to enter a log, only then is the OK button shown!
So far, it's working out well - no one has been able to break it!
My less drastic suggestion would be to have a notification which pops up momentarily above the system tray. After a second or two, fade it out. Keep showing the notification every 30 seconds or so until it is dismissed.
Always-on-top window in the corner of the screen?
You could always set your window to be a top most window, make it full screen, and activate it. It would be very, very hard to miss...
Granted, it would also be very annoying, and not something I'd do to other users...
My "real" suggestion would be to use sound along with standard notification methods if this is going to be used by other people, as that's an easy way to grab attention without necessarily killing their workflow. A modeless window that appears in a corner of the screen, especially if combined with sound and color, can be very effective to grab attention.
The industry has been adopting these ambient orb devices and variations of it when such a hard-to-miss notification is required. It is used for tracking the stock-market and for broken-daily-builds.
http://www.ambientdevices.com/cat/orb/MAN_Ambient%20Orb_3-23-03.pdf
Regards