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

28 February, 2025

Winhance - Debloat and Enhance Windows!

 Ever thought of ways to debloat and enhance Windows 11?


I have. 


Since I tried Windows 11 and found that it runs faster and better than Windows 10. I like the functions being put into icons where I can just click the task away. That is at least 1 mouse click less, compared to the old way of right mouse way of doing things.


Right out of the box, Windows 11 already rocks. That's at least how I find this latest Windows OS. But...


There's always room for improvement.


There is the File Explorer that remains the same in its performance - slow, clumsy way of copying files. That is why I have never let go of NiceCopier since Windows 7. Yes, since Windows 7. I got fed up with a very bad file management UI, and have tried many external file manager applications, where some actually are sold at a price. From here, you can understand that there is really something lacking about Windows' own set of applications, not to mention Windows itself. It's not perfect, we know, just like other OSes, but at least make it decently super even though imperfect (yet).


Then there is the issue with slowness when doing file search, or, even when it is fast, returns limited result, and more often not finding what you wanted to find. I used Everything for this. It's a free application that I find super-efficient, and very flexible in the options that you can apply when doing file search. It can even search file content.


And so on, and so forth.


Lately, I read about debloating Windows 11 so it runs even faster -- and better.


Winhance!


And of course, as in all new things, there's a caveat emptor attached to it. But don't lose heart. Exercise caution, and you still get a better Windows 11, or at least, less bloatware to deal with.


From BetaNews, this article about Winhance gave me some info that I understand could make Windows 11 lighter and faster, better.


I have a number of laptops. Different brands. Acer. HP. Lenovo. Asus. There is the eMachines, which was an old brand under Acer. And also, Compaq.


Why am I listing down my PC brands? Because part of what Winhance do is to uninstall applications, including Bing, Microsoft Edge and some of its variants, OneDrive, etc.


And if you do choose to remove Edge, then Lenovo PCs will be impacted. I found that Lenovo Vantage is using Edge (API), so it will try to install Edge before it is able to work. And since part of Winhance's logic is to prevent the re-installation of an uninstalled program, that's good as always having to install Edge, then Vantage, every time you boot up. So when that did happen to me, I reinstalled Edge. Yes, Winhance include the option of installing some applications, which, of course, include Edge.


Then there is the 'clean up' part. This is where you really must be very careful, or all of your icons, thumbnails, Taskbar, etc. - will be gone! I'd say it like that, gone. But not really. If you include clean up of Taskbar, it will be wiped clean. Well, this is just unpinning those icons, which is similar to wiping your Taskbar clean. Yes, it happened to me. I reverted that change and put back all those icons into the Taskbar one by one.


Okay, Nuff said. I leave some room for you to try Winhance and see how it works for you. Hope you like it. Really!


Let us know, will ya?


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]


24 August, 2017

Minimize An App to System Tray

24-Aug-2017


I am writing a small WinForms program, and I thought of including minimize an app to system tray feature. Since this is the first time I will do this, I just did a search in Google. I am very sure many have done it as it already is a common feature.

Well, common for everybody else, but at this point, not me. Not yet.

Thus, I searched for ‘minimize an app to system tray’, and I did find valuable articles, many in Q&A forums, like StackOverflow.com.

I’ll go directly to the point now. What is required to make it happen?

1. Handle the form’s resize event.
2. Make a NotifyIcon click event restore the form back.

Here’s how it’s done.


Handle the Form’s Resize Event

Select the form and on its Events, declare this:

private void MyForm_Resize(object sender, EventArgs e) {
    if (FormWindowState.Minimized == this.WindowState) {
       myNotifyIcon.Visible = true;
       myNotifyIcon.ShowBalloonTip(500);
       this.Hide();
    }
    else if (FormWindowState.Normal == this.WindowState) {
       myNotifyIcon.Visible = false;
    }
}


Make a NotifyIcon Click Event Restore the Form Back

Add a NotifyIcon tool, and on its click event, declare this:

private void myNotifyIcon_Click(object sender, EventArgs e) {
    this.Show();
    this.WindowState = FormWindowState.Normal;
}


This is all that is required, really. But sometimes it doesn’t work. One small trick is needed.

Add an Icon to the NotifyIcon tool.

myNotifyIcon.Icon = SystemIcons.Application;

Also, you can add in the Text and Tip properties:

myNotifyIcon.BalloonTipText = "App is minimized to System Tray.";

myNotifyIcon.BalloonTipTitle = "My App Name";


Sometimes, you will see articles that suggest using the Form’s Visible property. But this is also known to still make the app appear or selectable (although not visible) when you do Alt + Tab. So stick to Hide() and Show() events. Still your choice, though.

Okay. I’ll stop here, cause that’s all that is really needed to minimize an app to system tray. Easy, right?

Happy coding!

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!