Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

11 October, 2025

Visual Studio 2026. Finally!

11-Oct-2025


Visual Studio 2026 is finally here!

I began using Visual Studio since installation disks were using a floppy. So much has evolved since then. And then, Microsoft would always release a new version like every two years.

From Visual Studio 2019, it took a while for Visual Studio 2022 to be released. That was the initial veersion where the IDE was using 64 bit.

But then, it took much longer for the next version after VS 2022 to be released.

But then again, the wait is over!

Visual Studio 2026 is here.

The article that I read which led me to the download site says that you have to be a Visual Studio Insider to be able to download the installer. For sure, I am a Windows Insider, but Visual Studio Insider?

Nonetheless, out of curiosity and having waited for sooooo looooong, I clicked the link.

And lo and behold, I was able to download the Visual Studio 2026 installer. Finally!

I run the installer, tried the IDE, and yes, I like it!

Try it!

Visual Studio 2026 Insider

Enjoy!

Till then.


25 April, 2018

Forcing A Windows Application To Quit On Exit

English: Graphic which hints to Microsoft Windows
English: Graphic which hints to Microsoft Windows (Photo credit: Wikipedia)
25-April-2018

Forcing A Windows Application To Quit On Exit. That was my recent problem with a Windows Forms Application I was finalizing for deployment. It is not a big program. And it is not even one that is complicated. Straightforward and simple. That's what it is. But somehow, it carried a bug.

The .exe isn't terminated by Windows. It remains in the system. I can see it using Task Manager. And how did I find out about it? I am not able to execute a Ctrl-F5 properly. I always get an error.

That is when I started checking here and there, and I found out, the program's .exe remained in the system even after I close the program. Why is that? Beats me!

I opened one of my Windows Forms program, compared the code side-by-side, and no, there is nothing different. It is the same lines of code for the 2 programs, but the former closes and system disposes of everything. The latter, no. the Form closes, but the .exe remains in the system. So I can't start a new program since to the system, it is 'still running'!

Why it behaves that way, I do not know.

Now, I said this is a piece of cake. It is easy. I know how to terminate a program so that it is removed from the Taskbar. I was thinking that the same trick should work on this new program. I mean, why shouldn't it?

But I was wrong. It did not work! How can Visual Studio codes be so quirky?

Anyway, I did some direct codes, testing a few lines a couple of times. And guess what? Here's what worked:

Application.DoEvents();
if (Application.MessageLoop) {
    // WinForms app
    Application.DoEvents();
    Application.Exit();
}
else {
    // Console app
    Environment.Exit(0);
}

That 'if' section, it is meant to be for Windows Forms applications, and the 'else' clause, that is meant to be for non-Windows forms programs, like a Console application. That's the 'normal' way of things. Supposedly the 'right' logic.

But wait.

After trying it the normal way, it didn't work. So I tried it the extra-normal way: use Environment.Exit(0) in my Windows Forms application. And you'll guess it already. It worked!

I guess that is an experienced programmer's edge over the newbie. Not all the time, things work normally. And when it happens, the veteran knows how it is done rightfully, or maverick.

So I hope that you have learned a new thing today: Forcing A Windows Application To Quit On Exit.

Till then!


[Drafted on 26-March-2018]


11 April, 2018

Prevent Leaving An Icon In System Tray On Program Exit

The Windows 7 taskbar shows a preview of the w...
The Windows 7 taskbar shows a preview of the window. (Photo credit: Wikipedia)
11-April-2018


Prevent Leaving An Icon In System Tray On Program Exit. I had a problem with one of my applications about this. I was able to minimize it to System Tray. The App Icon was removed from the Taskbar, alright. But when the application was restored and closed, the icon remains in the System Tray. What's worse, I didn't notice it!

This was complicated by the fact that I did a routine cycle of closing and opening the program using scripts and some free apps downloadable from the internet, so that for a period of time, System Tray was filled up with icons of the same program, all N-1 of which are invalid handles!

I got a good scolding from my boss about this. Why? When I researched this problem, I found out that it is a prevalent issue. There are a number of forums that discusses the same exact problem, as obviously, I am not the only one having it. No, I am not the first one, and I will not be the last.

What did I find? That it was, and it remains, an issue by MS. Yep. The software giant company MS. They have it as a bug, and it still isn't fixed. The full details, I cannot tell here. But if you are interested, and if it happens to you in the future, you will know and understand what I mean.

Of course, there were suggestions presented in the forums to remedy the situation, and some of them I actually followed. Unfortunately, they didn't work perfectly for me. That is why so many icons still get left behind. And worse, this was implemented in one of our customers. Customer complain, that is what I got. That is how I got a good scolding. What's the point? I followed and applied in my code something that is 'wrong'. Yeah, I kinda missed that.

Anyway, how was that problem remedied?

This is the surprising this. It really is very simple, and it isn't something hidden.

In the FormClosed event, put (or add) these lines:

myNotifyIcon.Icon = null;
myNotifyIcon.Dispose();
Application.DoEvents();
if (Application.MessageLoop) {
    // WinForms app
    Application.DoEvents();
    Application.Exit();
}
else {
    // Console app
    Environment.Exit(0);
}

Surprising, isn't it? You gotta try it to know it! And with that, You should be all set. Prevent Leaving An Icon In System Tray On Program Exit.

Till then!

[Late posting; drafted on 18-October-2017]


28 March, 2018

Make App Disappear From Taskbar On Minimize

Screenshot showing Windows 8's ability to pin ...
Screenshot showing Windows 8's ability to pin apps and show different wallpapers on different monitors, as well as displaying the new Explorer file browser interface, Task Manager, and multi-monitor taskbar (in "Duplicated on all taskbars" mode). (Photo credit: Wikipedia)
28-March-2018

I wanted to completely hide an application after it is minimized. Hide() is not enough. [ShowInTaskbar = false] did the trick.

Well, I could say that I struggled a bit finding out what would really make the application disappear from the taskbar.

I used Hide(). Didn't work. I also tried Visible = false. Also did not work. I combined both, but still, it did not work. I combined both Hide() and Visible = false, and even then, I still did not see the job done. App icon still shows in the taskbar when it was minimized.

I should mention that I already have the application creating an icon in the System Tray as I have previously created a NotifyIcon to handle that. And what I am adding now is to minimize the window via code, which also requires the app icon to be not shown in the Taskbar.

I couldn't find many articles that provided help. What came up usually just mentioned Hide() or Visible, and some of the old stuff about adding a NotifyIcon function. I found one that did mention about making use of the property ShowInTaskbar. So I grabbed that one-liner code, tried it, and it worked!

So now my program is complete! Now I can hide an application after it is minimized. Thanks to ShowInTaskbar, I could declare it a holiday!

Till then!

[Late posting; drafted on 04-October-2017]


09 August, 2017

Is ScanGuard Safe? Suggested After Windows 10 Creators Update?

Microsoft Security Essentials
Microsoft Security Essentials (Photo credit: Wikipedia)
09-Aug-2017


Today I run Windows 10 Creators Update. One of the first articles that are listed in Microsoft Edge is the supposedly 'a must' ScanGuard installation - to protect your PC.

I am not sure if this is the first time I hear or read about ScanGuard antivirus, so I did a quick search.

Surprise, surprise!

About a year ago, many people threw all kinds of negative comments on this product, many veered away without even touching it, and many to tried it anyway, ended up uninstalling it. Reason? Creates thousands of false positive alarms!

It was not a good antivirus product and the company who made it, well, is new. Not yet established in the playing field.

What's the suggestion then? Use Microsoft Security Essentials, or Windows Defender. Or Malwarebytes. Even the free version of MBAM will do. Personally, I use Malwarebytes, and I'm sticking with it. And long years before, I did use Windows Defender and was contented with it.

So why would Windows endorse such a kind of product? I wouldn't know.

But for now, I will be waiting and on the lookout for fresh developments. One year and there should be much progress, who knows?

I guess those who have anything to say, well, all are welcome to leave their comments here, thank you!

Till then!

16 July, 2017

Remote data not accessible: Excel 2016

English: Illustration of subroutine in Microso...
English: Illustration of subroutine in Microsoft Excel that reads the x-column, squares it, and writes the squares into the y-column. All proprietary Microsoft art work has been cropped to leave a generic spreadsheet (Photo credit: Wikipedia)
English: Use of user-defined function in Micro...
English: Use of user-defined function in Microsoft Excel. All proprietary Microsoft art work has been cropped to leave a generic spreadsheet (Photo credit: Wikipedia)
16 July 2017, 10:20 PM


Remote data not accessible:
To access this data Excel needs to start another application. Some legitimate applications on your computer could be used maliciously to spread viruses or damage your computer. Only click Yes if you trust the source of theis workbook and you want to let the workbook start the application. Start application 'SV.EXE'?  YES NO

I am working on PcVue data extraction using Excel 2016. That was the response thrown by Excel after I typed "=SV|DB!DATE" and pressed [Enter].

Of course, I clicked on YES, but then again, this is the result:

“Cannot run ‘SV.EXE’.  The program or one of its components is damaged or missing.”

Beats me!

This is another one of those DDE nightmares, where the support for a legacy system is required even when already using Windows 10 64 bit and Excel 2016.

I searched for more articles using the string "remote data not accessible" and well, I got some from Technet, and some from Microsft forums, and some scattered Q&A here and there, even in StackOverflow. And I think the solution was derived from one of the Microsoft forums Q&A.

The advice is to make Excel run as Admin. So I did that. I modified the shortcut of Excel 2016 to make it execute, 'Run as administrator'.

And yes, it worked! I was able to extract data from PcVue iNexus 10/11.2 into Excel using DDE!

Then the C# program wouldn't still work, though.

But getting the idea from what I did to Excel, I looked for the compiled program, set it also to execute and 'Run as administrator', well, what do you know?

It also worked!

So while I cannot make use of DDE through Visual Studio's Ctrl+F5. I just do a build, set the compiled exe file's property to 'Run ad administrator', and voila! It would be working like a charm!

I hope this helps somebody working on the same legacy system, DDE, and still make it work.

Till then!