Community night in August

Important Notice for August 2011

Community night is normally the second Tuesday of the month, however since that is a public holiday it has been moved to Monday the 15th of August!

What is community night?

For those who do not know this is a FREE event that happens monthly where a variety of user groups get together at Microsoft's offices. User groups are not influenced by Microsoft, they just use the facilities. User groups that are there on a regular basis:

  • Information Worker: Technical focused SharePoint & Office
  • Business User Workshops: User group that looks at the issues that face power users in enterprises. This month the understanding where a portal ends and CRM begins.
  • Game Dev: One of the biggest with plenty of game developers & artists getting together.
  • JavaScript: For all you JS fixes
  • Mobi: My good friend Rudi Grobler hosts this group focused on mobile (iPhone, Android, Symbian and Windows Phone)
  • UX: For those who understand there is more than 16 colours
  • Architecture: For architects of any IT systems!
  • Languages: For developers who are interested in learning the pros & cons of other languages.
  • SQL: The fantastic Gail Shaw runs the best SQL user group anywhere!

There is also FREE beer, cool drinks & pizza!

Where is Microsoft’s offices?

Microsoft Bryanston Office
3012 William Nicol Drive
2191 Johannesburg
South Africa

Click here for map and more details.


Various user groups starts at different times. I think the first UG kicks off at 16:00 and it can run to 21:00.
However depends if you attend multiple UG, stay for passage conversation, etc…

So up to you, I have nights where I arrived after 17:30 and other times left at 18:00, no pressure!

Robert MacLean Tue, 07/26/2011 - 15:35

Presentation Dump - Mid 2011: Windows 7 API CodePack, Development for Nokia, Mercurial, VS Tools, AOP, Multitasking, Cloud

Submitted by Robert MacLean on Tue, 07/19/2011 - 14:05

The fact we half way through the year snuck up on me this morning, so it is time again to share some of the presentations I have done in the last 6 months! For those new to the presentation dump, every 6 months or so I share all the slides I can (some I can’t because they contain NDA info, like the one about Microsoft’s Project Double Rainbow) so that you can take these slides and work with them yourself!

So what is included in this dump:

  • Windows 7 API Code Pack: This was a very fun session to do since it was showing off a bunch of cool Windows 7 features.
  • Development for Nokia: This is maybe one of the best looking slides, but one of the worst timed sessions since shortly after it Nokia announced their move to WP7 so not much could be taken away from this Sad smile
  • Mercurial: This is a difficult session, because the demo’s are so boring (how do you make source control sexy?) – however a ridiculous amount of animation about process made this entertaining to create and present.
  • Visual Studio Productivity Tools: This one started off from the idea of answering the question CodeRush vs. Resharper – which is a bit of religious debate more than a this one wins. It includes a bunch of other interesting content about other extensions too. For non-South African’s “Braai Rules” is the same as saying “BBQ Rules” or “Pub/Bar Rules”
  • Aspect Orientated Programming: This is a big one for me as I see general development using more of this and the frameworks, like .NET, moving to it more and more in future. Good to get an early look into it.
  • Multitasking in applications: This session looks at one of the themes of .NET 4 – TASKS. Why should you care, because multi threading is complex, but multi tasking gives the same benefits with less complexity.
  • WebMatrix: Microsoft’s new tool for hobbyist web developers. What is included in that tool? This presentation tells you.
  • Welcome to the cloud: I had a great opportunity to present at Tswane University of Technology with Rudi Grobler on the cloud & mobile. This was a very fun session and allowed me to also talk about why BBD is such an awesome place to work.

Slides available in the post! Click below for more

Windows 7 API Code Pack

Development for Nokia


Visual Studio Productivity Tools

Aspect Orientated Programming

Multitasking in applications


Welcome to the cloud

Security is hard for users, so let us clean up with NEAT & SPRUCE

Submitted by Robert MacLean on Mon, 07/11/2011 - 13:34

Microsoft used to be a horrid company with regards to their security, then they sat down and made security a quality gate – we do not ship if security is wrong. How do they know what is wrong? A 24 page guideline with 68 bullet points?! Perfect holiday reading Smile with tongue out

The security development lifecycle team has recently tried to help us developers improve our applications so we not the next company with a bad security issues with two acronyms which will improve security notices to our users: NEAT & SPRUCE

What is NEAT?

  • N: Necessary – Only show messages that you need. If you can take a safe action automatically or defer the message, do that!
  • E: Explained – If you do interrupt the user, explain in everything to the user. EVERYTHING?! Yes, and the SPRUCE acronym will help explain what everything is.
  • A: Actionable – A message should only be presented to the user if there is steps the user can take to make the right decision.
  • T: Tested – A security message needs to be tested. TDD, Usability Testing, Visual Inspection, every test.

So, we need to show the message now – what do we put in there? SPRUCE:

  • S: Source – Why are we showing this message? Did a website do something or a file or a user action? Tell the user.
  • P: Process – Give the user the steps they need to go through to make sure they make the right decision.
  • R: Risk – Explain what the consequences of getting the decision wrong.
  • U: Unique – If your software knows everything, do the right thing automatically. So if you are showing the message, it means the user has unique information that is needed to make the decision. Explain what information is needed (slightly similar to P).
  • C: Choices – Show the user all the options and recommend the safer one.
  • E: Evidence – Provide any additional information that the user may need to make the decision.

Now that the training is done, let’s look at real implementations:

A web page contains secure & nonsecure content

Here is what the dialog looked like in the bad old days of IE6:


In IE 9 where this logic has been applied:


Let’s look at the differences:

  • N (Necessary) has been applied – previously this was a blocking model UI, which the user was forced to deal with to continue working. Today it shows discreetly with at the bottom and only if the user needs to work with this they have to, otherwise ignoring it.
  • E (Explained) has had been done with the What’s the risk? – which shows the dialog below. It is not perfect as it hasn't followed SPRUCE fully but it is a good improvement.
  • A (Actionable) has been applied – previously you had both a yes & no, now we have one action that can be done. Close or ignore and nothing happens.
  • T (Tested) there is some weird language issues with the old one especially if English isn’t your primary language because of the yes/no not being perfectly clear. The new dialog has a single very clear labelled button!

whats the risk


Now that we have looked at how it can help you and how to do it, attached is a nice simple 3 page document with more details and reminders about this. GO IMPROVE YOUR APPLICATIONS!


You do what at your job?

Submitted by Robert MacLean on Wed, 06/15/2011 - 13:44

imageI tweeted yesterday that my job can be a little weird because I had to sit in the kitchen at the BBD office and watch a TV for a while. This generated some confused discussion, so what was I doing?

Our team is experimenting with the idea of putting screens around the company to share content and information and I had to sit in the kitchen to make sure it worked by watching loop the content for a bit Smile


This is also a great opportunity to share some learning's from this with you:

TightVNC is still the best VNC option

Remote Desktop from Microsoft is THE best way to remote onto another machine but it has one downside, it locks other user out. For out screen we can’t have the login shown, and I don’t even know where it is to login manually – we need to see the content on the machine so we dropped to an older technology: VNC.

There is a lot of options in the VNC space, but ended on TightVNC as it actually runs as a service on a Windows 7 machine where other VNC clients run in the user space.

Auto Login to Windows

The login screen is also an issue with the machine when it boots and I don’t want to remote in every time to login – so we configured Windows to auto login to a specific account. This is thanks to the folks at Channel9 in particular Sarah Perez & Bradley Ward:

  1. Change the following registry key to 1: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon
  2. This enables the feature to be surfaced in Windows.
  3. Then run the following command: control userpasswords2
  4. In this UI you can UNTICK the option Users must enter a user name and password to use this computer and click OK
  5. It will then prompt you for the username & password to use and done! Note this is a bad security and so not recommended, but sometimes it is needed.

Open & Play slideshow

We are using Microsoft PowerPoint for the content and needed to auto run a slideshow at login, so we created a shortcut to run PowerPoint with the /S switch (see this for info on switches) and the filename: PowerPnt.exe /S c:\demo.pptx

That opens PowerPoint and starts the presentation!

Insert web content into PowerPoint

Lastly we wanted include some live web pages in it, which PowerPoint doesn’t support out of the box. MVP’s to the rescue! Some MVP’s created an add-in that allows it:

Really awesome!

It's official: Pepper uses Azure

Submitted by Robert MacLean on Wed, 05/04/2011 - 21:52

Bruce Kyle, a Microsoft evangelist, wrote an article recently about the “Powered By Microsoft Windows Azure” logo and how you can earn the right to display that.

That may sound odd to some people – why can’t you say you use Azure if you do? Of course you can, but if you jump a few hoops with Microsoft you can use the official logo Smile 


But that is not all! Doing this also helps towards an ISV competence with Microsoft which gets you great assistance and free software from Microsoft, the opportunity to get $250 for marketing and also some other pieces of useful tidbits. One of those tidbits is a press release template, which is so odd for me too see as I am not in marketing, press or anyone else who does those – so lower down you can find mine Winking smile

So about those hoops, you maybe wondering how hard or easy this is? I took Pepper through the testing for both SQL Azure & Windows Azure and it took about 30min, reading Bruce’s article & watching a video. It is RIDICULOUSLY easy to do once you have your application built – SO GO. DO IT. BE POWERED BY WINDOWS AZURE!

Enjoy reading my first press release Smile with tongue out

For Release 22:00 SAST

4 May 2011

Robert MacLean Becomes a “Front Runner” With the Release of Its Latest Application, Pepper

Johannesburg, South Africa — 4 May 2011 — Robert MacLean today announced it will launch a new application using the Windows Azure Platform. Pepper in combination with the Windows Azure platform helps enable customers to backup, share and synchronize your Visual Studio 2010 settings between multiple machines from directly inside Visual Studio 2010 without any costs or requirements for you. The Windows Azure platform, Microsoft’s cloud services platform, provides Pepper with the ability to build, manage, and deploy cloud based applications.

“Thru the technical and marketing support provided by the Front Runner program, we are excited to see the innovative solutions built on the Windows Azure platform by the ISV community,” said Doug Hauger, general manager for Windows Azure Microsoft Corp. “The companies who choose to be a part of the Front Runner program show initiative and technological advancement in their respective industries.”

“Windows Azure platform provides greater choice and flexibility in how we develop and deploy applications to all developers, both on-premises or in the cloud” said Robert MacLean, Developer of Pepper

Pepper automates critical processes such as synchronization and backup of settings to the cloud, eliminating the need for local storage and lowering the chances of losing them.


Product or service names mentioned herein are the trademarks of their respective owners.

For more information, press only:

Robert MacLean,

Visual Studio Recent Settings

Submitted by Robert MacLean on Thu, 03/17/2011 - 11:17

When you use the import settings option inside Visual Studio, you may notice a long list of settings Recent Files with no way to clear them out.

If you do want to clear this out, you can do this by going to the following registry key:


Note this is completely unsupported, but I have done it without any issues.


How to get the mouse to stop waking up Windows?

Submitted by Robert MacLean on Wed, 01/26/2011 - 11:23

19678My old Logitech V450 mouse had an odd issue, if Windows was put to sleep and pulled the dongle out, Windows woke up. This never bothered me much since I got into a habit of doing that before I put Windows to bed.

However with my new Performance MX Mouse (aka the mouse Batman would use) it does something similar which a change of habit just can’t fix.

The new mouse has a TINY dongle which is designed to be left in all the time and I do that, however any mouse movement or button pressing will turn a sleeping Windows on. So if when I forget to turn the mouse off and toss it in my laptop bag, it will turn the laptop on and the start the process of converting my laptop bag into an oven.

The solution to both these issues is to disable this wake up feature.


Step 1) Right click on the Computer start menu item (or My Computer icon on your desktop) and select Manage


Step 2) Click on the Device Manager node (under System Tools).

Step 3) Expand Mice and other point devices, right click on the mice and click Properties


Step 4) Head to the Power Management tab, and untick Allow this device to wake the computer and finally click OK


This will prevent both the issue of dongle changes or mouse action from waking up your computer.

Foot note: how porn does that last line sound…

Enabling Flip 3d with Logitech Performance MX Mouse

Submitted by Robert MacLean on Mon, 01/24/2011 - 09:31


I purchased a Logitech Performance MX Mouse (to replace my other Logitech V450 mouse) which has a number of fantastic features:

  • Darkfield optical sensor which works on everything, including glass
  • The awesome and tiny wireless pickup that can remain plugged in all the time.
  • Ability to charge off of USB and still work! 
  • 7 Buttons

imageOne of those 7 buttons defaults to a feature called Application Switcher. For Mac users this is exactly like Expose and for Windows users it is like a full screen task switcher. 

In fact on Mac runs Expose but on Windows this is a custom application and really doesn’t have the feel or the polish that the Flip 3d (the Windows+Tab thing) which ships with Windows Vista and Windows 7.


imageSo how do you change this? There is many posts about using macro’s, assigning specific applications or even hacked drivers but from my own experience this is no longer needed and it appears most people do not know about it because it is so well hidden.


The first step is to download the latest version of SetPoint, the mouse software, from Logitech which at time of writing is 6.2. However the mouse actually ships with 4.7, a version over 3 years old! This is really odd since the mouse was only launched less than 1 year ago!


imageOnce upgrade go to the Button Settings section, select the button and set the task to Other this will bring up a dialog with a massive drop down full of options. If you look in here for Flip 3d or maybe some alternative on application switcher you will not find it. However there is an option called Document Flip, which you guessed correctly is Flip 3d.

Set your mouse to this and viola!

What's in Microsoft.VisualBasic for C# Developers: Part 5 - Hardware

Submitted by Robert MacLean on Mon, 01/17/2011 - 10:31

monolith[This blog is part of a larger series, to find more parts in the series please see the Series Index]

Hardware isn’t just related to the computer information, like OS version and memory, but it also includes a variety of other types of devices such as audio, clocks, keyboards and many more. The VisualBasic library provides us with access to a lot of these pieces of hardware:


Microsoft.VisualBasic.Devices.Audio is a interesting class which allows us to play various sounds it has three functions that are key:

  • Play – This allows us to play a wave file, either by passing in the file name, a stream or byte array. There are a few overloads to allow you to control how the audio is played.
  • Stop – Stop the playing audio.
  • PlaySystemSound – This plays the sound associated with a specified system event.
string waveFile = @"C:\Windows\winsxs\amd64_microsoft-windows-speech-userexperience_31bf3856ad364e35_6.1.7600.16385_none_77fee1b2657da663\Speech Sleep.wav";

Audio audio = new Audio();
// play full file to wnd
audio.Play(waveFile, Microsoft.VisualBasic.AudioPlayMode.WaitToComplete);

// play first 300ms and stop

// play sound associated with a question


Microsoft.VisualBasic.Devices.Clock is rather pointless it has three properties which match to existing properties we know and love.

  • GmtTime equals DateTime.UtcNow
  • LocalTime equals DateTime.Now
  • TickCount equals Environment.TickCount


This provides us with an interesting mixed bag first we have 3 Boolean properties, one for each modifier key (Ctrl, Alt & Shift) which tell us if it is being pressed. Next we have 3 Boolean properties, one for each of the toggle keys (Caps lock, scroll lock & num lock) which tells you if they are enabled.

Keyboard keyboard = new Keyboard();
Console.WriteLine("Alt pressed: {0}", keyboard.AltKeyDown);
Console.WriteLine("Ctrl pressed: {0}", keyboard.CtrlKeyDown);
Console.WriteLine("Shift pressed: {0}", keyboard.ShiftKeyDown);

Console.WriteLine("Caps on: {0}", keyboard.CapsLock);
Console.WriteLine("Numlock on: {0}", keyboard.NumLock);
Console.WriteLine("Scroll lock on: {0}", keyboard.ScrollLock);

However the interesting piece of code is the SendKeys method which actually allows you to send key strokes to the active window, basically to simulate a user typing.

There is one thing to be aware of and that is if you are using something which does not handle window messages for example a console application. In this case you must use the overload which takes a boolean as a second parameter and set this to true.

// winforms
keyboard.SendKeys("Hello world!");
// console
keyboard.SendKeys("Hello world!", true);


mat11Microsoft.VisualBasic.Devices.Mouse does not let you control Mouse from the Matrix, it merely provides status information to you on the hardware mouse you are using via three properties:

  • ButtonsSwapped – Are the left and right mouse buttons swapped?
  • WheelExists – Does the mouse have a mouse wheel?
  • WheelScrollLines – How many lines does a single notch of the mouse wheel to scroll?


Need to work with serial (COM) ports? The Microsoft.VisualBasic.Devices.Ports provides you with a simple way to do that, however nothing it provides you do not already get from System.IO.Ports.SerialPort except saving a few lines of code.
The OpenSerialPort method does the following:

  • Creates a new System.IO.Ports.SerialPort – OpenSerialPort does contain overloads which match to the constructors for SerialPort.
  • It then calls Open on the port.
  • It returns the port.

That three lines of code wrapped into one for you.

The other item provided on Ports is the SerialPortNames property which returns a ReadOnlyCollection<String> of the names of the port. It does this by calling the GetPortNames method from SerialPort, which returns an array and then converts that result to the collection. The only time you should use this is if you really need a ReadOnlyCollection<String> as calling the GetPortNames method directly and working with the array is much faster.

What's in Microsoft.VisualBasic for C# Developers: Part 4 - Computer Info

Submitted by Robert MacLean on Fri, 01/14/2011 - 08:51

monolith[This blog is part of a larger series, to find more parts in the series please see the Series Index]

For today we will be looking at a very useful class ComputerInfo, which provides a small set of information on the computer. It doesn’t provide a lot of info but the information it provides are key:

  • OSFullName: The “nice” name for the OS – like Windows 7 Ultimate
  • OSVersion: The OS version number
  • OSPlatform: The OS platform
  • TotalPhysicalMemory, AvailablePhysicalMemory, TotalVirtualMemory, AvailableVirtualMemory: Memory usage information
  • InstalledUICulture: The culture that was used during the install, this is the exact same as System.Globalization.CultureInfo.InstalledUICulture
ComputerInfo info = new ComputerInfo();
Console.WriteLine("You are running {0} ({1})", info.OSFullName, info.OSVersion);
Console.WriteLine("\t this is built on the {0} platform.", info.OSPlatform);

UInt64 usedPhysical = info.TotalPhysicalMemory - info.AvailablePhysicalMemory;
UInt64 usedVirtual = info.TotalVirtualMemory - info.AvailableVirtualMemory;

Console.WriteLine("Memory Information in Mb (Available | Used | Total)");
Console.WriteLine("\t  Virtual: {0} | {1} | {2}", info.AvailableVirtualMemory / 1048576, usedVirtual / 1048576, info.TotalVirtualMemory / 1048576);
Console.WriteLine("\t Physical: {0} | {1} | {2}", info.AvailablePhysicalMemory / 1048576, usedPhysical / 1048576, info.TotalPhysicalMemory / 1048576);

Console.WriteLine("You are running the following culture {0}", CultureInfo.CurrentCulture.EnglishName);
if (CultureInfo.CurrentCulture != info.InstalledUICulture)
    Console.WriteLine("BUT you installed with {0}", info.InstalledUICulture.EnglishName);
    Console.WriteLine("and you installed with that culture too");

This gives us:


This is isn’t the only way to get computer information, there is plenty in other locations in the framework – for example the System.Environment class from the mscorlib assembly has things like:

  • Environment.Is64BitOperatingSystem
  • Environment.Is64BitProcess
  • Environment.MachineName
  • Environment.OSVersion
  • Environment.ProcessorCount
  • Environment.Version