Archive for category Windows 7

Testing It Out: Taskbar Progressbar

This new feature is adds a great value for users, because now one does not need to keep the program visible to see the progress of any process (Report, web service call, download etc…) This feature is implemented already at least in the Internet Explorer 8 (Windows 7 version) and the file explorer (copying/moving).

Using the Windows7APICodepack to implement this feature is very easy and fast task. Here’s an example:

?View Code CSHARP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
using Microsoft.WindowsAPICodePack.Taskbar;
 
namespace TestingStuffOut
{
    public partial class Form1 : Form
    {
        Timer timer;
        int value;
 
        public Form1()
        {
            InitializeComponent();
 
            timer = new Timer();
 
            timer.Enabled = true;
            timer.Interval = 250;
            timer.Tick += new EventHandler(timer_Tick);
            timer.Start();
 
            progressBar1.Style = ProgressBarStyle.Blocks;
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 100;
            progressBar1.Step = 1;
 
            value = 0;
        }
 
        void timer_Tick(object sender, EventArgs e)
        {
            // Reset the counter when it reaches maximum
            if (value == progressBar1.Maximum) value = 0;
            else value += 10;
 
            progressBar1.Value = value;
 
            // Here's the Taskbar Progressbar part
            TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Normal);
            TaskbarManager.Instance.SetProgressValue(progressBar1.Value, progressBar1.Maximum);            
        }
    }
}

And the example looks like this:

Normal mode

Normal mode

Error mode

Error mode

Paused mode

Paused mode

There was also a indeterminate mode (continuous), but I did not have time to test it also (means, I did not get it to work after one try and it’s very late :) )

Be sure to check out other parts of the “Testing It Out” series from the series starting page!

Testing It Out: Developing for Windows 7 with C#

I don’t do much pure Windows development. I’m more of a sharepoint guy myself, but these new Windows 7 features got me to boot up my visual studio and start testing these features out. When I started searching information about these features and using them in my programs, I found out that there is an API code pack for .NET Framework, because these features are not yet implemented directly to it.

Things to do before you can use these new features through API code pack:

  1. Download the API code pack from codeplex
  2. Unzip the WindowsAPICodePack-archive
  3. open the solution WindowsAPICodePack with Visual Studio and Build it
  4. Get the DLL-files from from each project folder and copy them somewhere safe
  5. Add reference to the DLL you need in your Visual Studio project

I’ll update a list of “Testing It Out” series here:

Windows 7 and Live Messenger Icon

If you have used WLM with earlier MS operating systems, you may have gotten used to the small WLM icon at the notification area (lower right corner). After installing Windows 7, the icon does not go to the notification area, but instead goes to the task bar :( The icon does not go away until you completely close messenger (and we all know how it does not like to do that). Here’s a picture:

Picture of WLM in Windows 7

Picture of WLM in Windows 7

 If you want it to work like it used to work in Vista or XP, all you have to do is this:

  1. Browse to the WLM installation folder (ex. C:\Program Files (x86)\Windows Live\Messenger)
  2. Right click on msnmsgr.exe and select properties
  3. Select tab Compatibility and choose XP or Vista from the drop down ”Run this program in compatibility mode for:”
  4. Accept the changes and startup Messenger.
  5. Write a comment to my blog and thank me :) Just kidding…

Here’s how it should look after the changes:

Picture of WLM in Windows 7 in XP compatibility mode

Picture of WLM in Windows 7 in XP compatibility mode

I tried using WLM with the “Windows 7 way”, but I really did not like it. If you have some opinions about this or have understood the idea why is it like this, please let me know!

Wohoo! Windows 7 RTM published to the MSDN

For the last few days I have constantly refreshed and checked my MSDN Subscription RSS feed (and double checked the web page, just to be sure) to know when the Windows 7 and 2008 server R2 is published… And now my long wait has been answered!

Windows 7 can be downloaded from MSDN today, but some of us still need to wait. Rest of the release schedule can be found from Windows Team Blog. Windows 2008 server R2 is still nowhere to be seen :(