WinDays 11

Illustration

This WinDays in Rovinj, on 6th April 2011 at 9:00 I will give presentation named “Azure Java”.

It will be (hopefully) interesting talk about Microsoft Azure and Sun Oracle Java. After presentation there might be some beer involved so be sure to visit. :)

VHD Attach 2.00

Illustration

It took me a while but new version of VHD Attach is here. Although there isn’t much changed on surface, internals went through significant changes and quite a few bug-fixes.

Probably most visible change is adding auto-mount button directly on toolbar. It seems that lot of people were unaware of feature because it was buried in Options dialog.

Version is available at https://www.medo64.com/vhdattach/. Enjoy.

MagiWOL 3.00 (Beta 1)

Illustration

Although MagiWOL is not program that gets downloaded the most from these pages, it is definitely one that generates most of feedback. Good feedback from loyal users forced me to continue development and it is directly responsible for this beta.

Changes are:

  • No registry writes will be performed if application is not installed.
  • Double-click now wakes computer instead of editing entry.
  • Broadcast address now can be host name (useful for waking over Internet).
  • Lot of bug fixing.

Beta is available for download at https://www.medo64.com/magiwol/beta/.

Bingo

Strange thing just happened. I got same one-time password two times. First one I got in November last year and second one I received just now. Some would call it an error but I call it a warning.

Run away! Laws of physics do not apply here. Escape while you can.

P.S. I already heard best joke about this from friend in office: “Only Chuck Norris and you can get same one-time password twice.”

ToolStrip as Main Menu

Let’s take small project as an example. You need two or three options and you cram everything as root menu item. Since you like your users and your users like pictures, you additionally create toolbar with same options. Final toolbar has one-to-one mapping with menu. Now question is why do we need menu in first place?

Personally I see only one reason - keyboard accessibility. Toolbar might be nice but it will not allow us to use pure keyboard interface in order to select items. However, solution is simple. First we set KeyPreview=true on form itself and then we just handle Alt key:

private void MainForm_KeyDown(object sender, KeyEventArgs e) {
    switch (e.KeyData) {
        case Keys.Alt | Keys.Menu: {
            menu.Select();
            menuNew.Select();
            e.SuppressKeyPress = true;
            e.Handled = true;
        } break;
    }
}

This code acts upon Alt key press. First we need to select ToolStrip control and then we select first item (New, in this case) within it. If we just use Select on item it will look same, but keyboard arrows will not move selection between items.

Downside to this is handling shortcut keys. While MenuItem will allow us to set Ctrl+N as shortcut key same is not true for ToolStripButton. All shortcuts should be handled explicitly now (within MainForm_KeyDown event):

···
case Keys.Control | Keys.N:
    menuNew_Click(null, null);
    e.SuppressKeyPress = true;
    e.Handled = true;
    break;
···

Full code example is available here.