- 0
[VB.NET 2005] Best way to exit the application with a NotifyIcon
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By George P · Posted
GPUs selling higher than their MSRP is the new norm it seems. This shouldn't surprise anyone. Dumb duopoly, if Intel could just stop shooting itself in the foot and release some more cards and undercut the other two that'd be great. -
By Bern@rd · Posted
I saw that recently, and the thing that would be useful also would be to have the PC model in that spec card as well. I know that it's on the main portal page of System, but repeating it in this "Device specs" module, especially if it's meant for the main specs of the computer, would certainly be useful. -
By tmorris1 · Posted
Do you want a little in the ground or a lot in the air? -
By LoneWolfSL · Posted
Bethesda readying two updates for Oblivion Remastered targeting bugs and performance by Pulasthi Ariyasinghe The surprise release of The Elder Scrolls IV: Oblivion Remastered was a massive success for Bethesda and Microsoft, with the title going on to gain over four million players in just three days at launch while also breaking franchise records for concurrent players. While reactions to the game have been positive from both critics and players, plenty of complaints have since been pouring in about the state of the remaster. Now, Bethesda is aiming to push out updates to resolve these concerns. Today, the company revealed that two updates are currently planned for the RPG, both with different scopes. The first of these is already available in beta form to Steam players. It seems Bethesda is using the same beta update format it uses for Starfield for this Elder Scrolls entry as well. "Thanks for all your excitement and feedback since the launch of The Elder Scrolls IV: Oblivion Remastered," said the development team today. "We are actively working on two separate updates to be launched in the coming weeks, both of which will come to our Steam Beta first, before being released to all other platforms." According to the studio, the first update is focused on "quests, major bugs and blockers, and quality of life fixes. " Following the June 5 launch on the Steam beta platform, all other PC players, as well as those on Xbox Series X|S, PlayStation 5, and Game Pass subscribers, will receive the update on June 11. The beta changelog for Update 1.1 can be seen here, with bug fixes coming for the UI, gameplay, quests, and more. Multiple crashes have been resolved here, with many being related to loading saves and exploring specific locations. Instances of infinite loading, alt-tab freezing, resetting settings, and more are being targeted with fixes, too. To opt into the Elder Scrolls IV: Oblivion Remastered beta update, Steam players can head into the game's properties, select Betas, and choose the [beta] branch to receive the new build. While Bethesda hasn't revealed any release dates for the second update, it did say that improving performance will be its main focus. This is a major point of criticism for the title at the moment, so the update can't come soon enough. -
By Geezy · Posted
I wouldn't consider it harsh, but companies want as many loopholes and exceptions as possible. I agree on wanting everything to be above board. Hopefully they find a way to do this.
-
-
Recent Achievements
-
jbatch earned a badge
Week One Done
-
Yianis earned a badge
First Post
-
GTRoberts went up a rank
Rookie
-
James courage Tabla earned a badge
First Post
-
James courage Tabla earned a badge
Reacting Well
-
-
Popular Contributors
-
Tell a friend
Question
ProclaimDragon
Most of my applications, always add a NotifyIcon control where it would be visible all the time the application was running but I've always confused a lot when coding specific operations when using a NotifyIcon. In this topic I was having a little problem with an icon appearing twice in the notification area and so, after finding a way to fix it, here's how I start my applications with a notification area icon:
I have a main form called FormMain and a main module called ModuleMain. The application starting point, will be Sub Main() in ModuleMain and goes like this:
Normally, this applications where I use a NotifyIcon, always have a context menu associated where Exit is always an option, this Exit will terminate the application. On this application example, I have some settings that are configurable by the user, which are: StartHidden, AskConfirmation and MinimizeOnClose; All of them are booleans and if they are True they will, start the application with the main form window hidden, ask confirmation before closing the main form window (exiting from the notification area does not ask for confirmation) and clicking the top-right X button on the main form window or pressing ALT+F4 will hide the main form window, respectively.
For both AskConfirmation and MinimizeOnClose (StartHidden is already explained in the Sub Main()), I have the following code:
What I want to know: Is this the best way to achieve all I have explained earlier? Can I optimize this code in any way? To make it more readable or better in someway? Do you spot any problems in this code? I'm asking all this cause I've always tested the application through but I've always thought that I'm missing something or something will not exactly work as I expected. Just a feeling I have, that this code, can be improved... If someone could take a look at it and suggest me improvements, I would really appreciate it.
Link to comment
https://www.neowin.net/forum/topic/533700-vbnet-2005-best-way-to-exit-the-application-with-a-notifyicon/Share on other sites
5 answers to this question
Recommended Posts