Linked In Twitter RSS

Silverlight 3 FireStarter LiveMeeting Event September 17th

8. September 2009  · Comments (0)

This summer’s biggest blockbuster technology event is coming to Redmond, WA on the 17th of September. 

Register to attend the Silverlight-3 FireStarter event on Thursday, the 17th of September. We have a stellar speaker line up from the Microsoft roster. We will have Scott Guthrie keynote the event followed by presentations from Tim Heuer, Brad Abrams, Karl Shifflett and others...

 At this event we will focus on three areas:

 What’s latest and greatest in with the latest release of Silverlight

 What’s happening in the world of Expression 3, and

 Give you a run down on .NET RIA Services, Toolkit, etc. 

 

Time

Session

Speaker

8:45 – 9:00 AM

Event Kick off

Mithun Dhar

9:00 – 10:00 AM

Keynote

Scott Guthrie

10:00 – 11:00 AM

Key Silverlight Scenarios

Tim Heuer

11:00 – 11:15 AM

Break

 

11:15 AM – 12:15 PM

Expression 3 Overview (Includes Behaviors)

Adam Kinney

12:15 – 1:00 PM

Lunch Break (Provided by Microsoft)

 

1:00 – 1:30 PM

Sketch Flow

Janete Perez

1:30 – 2:30 PM

Toolkit & Controls

Justin Angel/Shawn Oster

2:30 – 3:30 PM

RIA Services

Brad Abrams

3:30 – 3:45 PM

Break

 

3:45 – 4:30 PM

Building Silverlight UIs with XAML Power toys

Karl Shifflett

4:30 – 5:00 PM

Q & A Panel

All Speakers

 

Registrations:

Source:
http://blogs.msdn.com/mithund/archive/2009/08/12/silverlight-3-firestarter-thursday-september-17th-2009-attend-redmond-wa-or-online-must-register.aspx

VSTestHost hang on Windows 7 RTM

6. September 2009  · Comments (0)

I have Windows 7 RTM installed and Visual Studio 2008 with SP1. After writing some simple unit test and run it I have got VSTestHost.exe not responding error.

First I have thought that is Windows 7 error. I have looked and find some hotfix and if you have some similar problems I suggest to try run sample test with no code to ensure that problem is not in your code. That hotfix is on this address : http://code.msdn.microsoft.com/970449/Release/ProjectReleases.aspx?ReleaseId=2830

After better looking in my code I have found that problem is in my own code. I have had recursive call to a method inside unit test so test method is never finishing and VSTestHost is hang out after few seconds with unknown error.

Hopefully this post will help someone struggling with similar issues…

Screenshot your WPF application

3. September 2009  · Comments (3)

Often we need a way to capture picture of UI. For example if error occurs in our application we can take picture of UI and send this picture in error report.

Usual way in windows forms is calling Graphic.CopyFromScreen method. This way is not work very well in WPF. If we have some transparent controls on form this method will save image under transparent control.

So in WPF we will use GDI+ to take picture of UI. We have internal class NativeMethods:

 internal class NativeMethods

    {

        [DllImport("user32.dll")]

        public extern static IntPtr GetDesktopWindow();

 

        [System.Runtime.InteropServices.DllImport("user32.dll")]

        public static extern IntPtr GetWindowDC(IntPtr hwnd);

 

        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]

        public static extern IntPtr GetForegroundWindow();

 

        [System.Runtime.InteropServices.DllImport("gdi32.dll")]

        public static extern UInt64 BitBlt

             (IntPtr hDestDC,

             int x,

             int y,

             int nWidth,

             int nHeight,

             IntPtr hSrcDC,

             int xSrc,

             int ySrc,

             System.Int32 dwRop);

    }

And we take picture UI by calling this method :

 public void SaveScreen()

        {

            Bitmap myImage = new Bitmap(Screen.PrimaryScreen.WorkingArea.Width,

            Screen.PrimaryScreen.WorkingArea.Height);

 

            Graphics gr1 = Graphics.FromImage(myImage);

            IntPtr dc1 = gr1.GetHdc();

 

            IntPtr dc2 = NativeMethods.GetWindowDC(NativeMethods.GetForegroundWindow());

 

 

            NativeMethods.BitBlt(dc1, Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, Screen.PrimaryScreen.Bounds.Width,

                 Screen.PrimaryScreen.Bounds.Height, dc2, 0, 0, 13369376);

            gr1.ReleaseHdc(dc1);

            myImage.Save("screen.png", ImageFormat.Png);

        }

 

You can download Demo application :

ScreenShotWPF.rar (38.14 kb)