Showing posts with label Personal computer. Show all posts
Showing posts with label Personal computer. Show all posts

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!

12 April, 2015

The passing away of my old desktop PC

Screenshot of the Welcome screen of Ubuntu Des...
Screenshot of the Welcome screen of Ubuntu Desktop 11.04 CD (Photo credit: Wikipedia)

12-April-2015



My old desktop PC died, officially. It was originally installed with Windows XP, but I tried to run in in Vista when the OS was released, then finally to Windows 7. Well, they all run okay, but to say the least, it was slow. And why not? It was an old PC that can only accommodate a maximum of 2GB RAM. 2 slots, that's all.

The longest time possible it was running Windows 7 OS, but when 14.04 Ubuntu was released, I thought, “Why not try and see if Ubuntu Linux will be better?”

I did just that. And it was on dual-boot mode. Windows 7 alongside Ubuntu Linux 14.04.

For some time, I run it that way, and one very stark difference is the speed. Windows 7 was slow, Ubuntu Linux was speedier. And they use the same hardware and all.

About 2 months back, I decided, I am not doing anything in Windows 7, or to say it more specifically, I cannot do anything in Windows 7 because I am simply waiting for a button click to get through, or complete.

Came the decision: Wipe out drive C:, and install Ubuntu Linux – only!

I did just that, and Ubuntu Linux installation started nicely. That was just about the time we were going to have dinner, so I left the old desktop PC alone while the installation was going on.

Afterwards, when I checked on the installation progress, I noticed that the lights on the PC were off. The power switch was still turned on, so I was wondering how it was turned off. I tried to press the power button, but no response. I had to open up the casing to check on what the problem could be.

No power. I did the standard troubleshooting steps, but there isn't anymore a response, like simply leaving the PC unpluged for a while and letting the stored charge be discharged, and upon plugging back in and turning the switch on would immediately turn the blower fan momentarily on, then off – well, none – nada!

A few more rounds of doing this, and with the night getting late, I had to retire, and to 'officially' retire the old desktop PC as well.

Good thing was that the secondary hard disk is still intact, and it is still in the PC today, but before the supposedly installation of Ubuntu Linux, I made it sure that all data was moved out of the primary disk, and all stored in the slave disk.

It has served me a long time, and it had its time. Computers don't live forever. And it picked a fine time to die, just when I thought of giving it a 'new life' with Ubuntu Linux...

Till then!


-----



23 November, 2014

Printing problem in Crystal Reports for VS2005 - SOLVED!

Crystal Reports
Crystal Reports (Photo credit: Wikipedia)
23-Nov-2014


A week or so ago, I had my old work desktop PC formatted and installed with Windows 7. I opted for that because I don't want any leftovers from previous users cluttering up my work. Say I'm fussy, but that is me. At least I can safely say, if ever the time comes that I leave the company, that they can format the hard disk drive, without ever worrying about 'others' having leftover files in the HDD of the PC that I used for X number of years.

Now, that new Windows 7 OS is sure better than XP Professional SP3, and while I am able to make use of the better hardware and better OS, in that the very reason why I had the Windows 7 installed after a format is that the hardware is better, even when it was running Windows XP. Yap, there was another desktop PC involved. I had a swap. I had the faster PC for a swap, and requested for a total clean sweep of the hard disk, which mandated the installation of Windows 7. I didn't know that, but it was a pleasant surprise - when I was told that due to the formatting of the hard disk, I will now be getting Windows 7 instead of Windows XP. I said, "Err... okay!"

When all applications have been reinstalled back, I discovered that the main software I use in my daily work is getting a problem: it wasn't able to run Crystal Reports, or to be precise, all sections work, except the Crystal Reports form.

When that problem was fixed, a new one came about: printing function. All else, like exporting, viewing pages, etc., work. I was stuck, as again, printing the generated report was a mandatory part of the process flow that I call work.

I asked for help, which didn't easily come. I figure, I had to do it on my own. And that was even harder because I don't have internet access at work. I should say it is hard, but I feel safer and more comfortable, with much ado about wasting time browsing while working, etc., etc. So I do my web seraching at home, then attempt all solutions and resolutions when I come back to the office.

To cut to the chase, here's what I did, and unfortunately, I am not quite sure on the exact item that fixed the problem. And yes, I am using Windows 7 64-bit OS. Sadly, some of the articles that I checked insisted that it has nothing to do with the bit-ness of the OS of the client, or the local PC, but the bit-ness of the server. That is contrary to my experience.

  1. I turned on .NET Framework 3.5 through the Control Panel, Turning Windows features on or off.
  2. I installed ReportViewer.exe
  3. I installed cr_net_2005_x86.msi
  4. I installed CRRedist2005_x86.msi
  5. I installed CRRedist2005_X64.msi

Five items, and I didn't know which one did the fix. So I suggest that if you are following my method, help me out by doing one-by-one, and noting which one does the fix, so I can update my post.

Hope this helps somebody, as it did me.

Till then!