<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Drydo's Blog</title><link>http://blogs.vbcity.com/drydo/</link><description>Teenager of the Internet</description><managingEditor>Mark Dryden</managingEditor><dc:language>en-GB</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Mark Dryden</dc:creator><title>Getting Expression Blend to open an Image in Fireworks / Photoshop, etc.</title><link>http://blogs.vbcity.com/drydo/archive/2008/04/23/9050.aspx</link><pubDate>Wed, 23 Apr 2008 13:34:00 GMT</pubDate><guid>http://blogs.vbcity.com/drydo/archive/2008/04/23/9050.aspx</guid><wfw:comment>http://blogs.vbcity.com/drydo/comments/9050.aspx</wfw:comment><comments>http://blogs.vbcity.com/drydo/archive/2008/04/23/9050.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.vbcity.com/drydo/comments/commentRss/9050.aspx</wfw:commentRss><trackback:ping>http://blogs.vbcity.com/drydo/services/trackbacks/9050.aspx</trackback:ping><description>&lt;p&gt;So firing up Expression Blend and getting into the whole WPF thing is always a refreshing change, especially getting away from mundane coding and alike.  However, the first thing to trip me up and my colleague up was using the "Edit Externally" command from the project view to edit an existing '.png' file and whipping into my favourite graphics editor.  Imagine my surprise when I was greeted with MSPaint!  How there are two things to consider here...&lt;/p&gt;

&lt;p&gt;
&lt;ol&gt;
&lt;li&gt;I used to be a design guy prior to becoming a programmer, so MSPaint is the last thing I need to see.&lt;/li&gt;
&lt;li&gt;Two - MSPaint is in no way anything like a sophisticated design application.  Just get used to it ;-)&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;Now the doomsayers and conspiracy freaks might consider that MS has done this on purpose, so I fired up Reflector to work out how the project items (such as image files) were actually being catagorised and executed.  What Blend does is by using the old .NET standby of Process.Start but explicitly passing through the 'Edit' string as the 'Verb' when making the call.  In short, they're letting explorer handle the file association.  Note: this works differently from explorer where if you double-click an existing and recognised dot extension it fires up the application with the selected file because its using the 'Open' verb and not the 'Edit' verb.&lt;/p&gt;

&lt;p&gt;Ideally, Blend should use the 'Open' verb rather than hardcoding the 'Edit' verb (well, selection that is then implemented in the EditExternalCommand object) into the 'DocumentType.PreferredExternalEditCommand' property.  Or even better - allow the user to specify those application they want for editing resources.  But hey, its version 1.&lt;/p&gt;

&lt;p&gt;So to get around this, a quick registry tweak will get things working.  Navigate to the key...&lt;/p&gt;

&lt;p&gt;HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit\command&lt;/p&gt;

&lt;p&gt;...and change the value of the '(Default)' value to your favourite package from...&lt;/p&gt;

&lt;p&gt;"%systemroot%\system32\mspaint.exe" "%1"&lt;/p&gt;

&lt;p&gt;...to &lt;your package name and argument&gt;, so in my case to Fireworks...&lt;/p&gt;

&lt;p&gt;"C:\Program Files\Macromedia\Fireworks 8\Fireworks.exe" "%1"&lt;/p&gt;

&lt;p&gt;...and job done + no need restart...&lt;/p&gt;

&lt;p&gt;HTH - And remember this fix / hack comes without warranty and will effect other instances where applications use this key as well.  In short, be careful and backup your registry before doing this.&lt;/p&gt;&lt;img src ="http://blogs.vbcity.com/drydo/aggbug/9050.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Mark Dryden</dc:creator><title>System.Net.Mail.SmtpClient not sending until the application exits</title><link>http://blogs.vbcity.com/drydo/archive/2008/03/26/9006.aspx</link><pubDate>Wed, 26 Mar 2008 16:07:00 GMT</pubDate><guid>http://blogs.vbcity.com/drydo/archive/2008/03/26/9006.aspx</guid><wfw:comment>http://blogs.vbcity.com/drydo/comments/9006.aspx</wfw:comment><comments>http://blogs.vbcity.com/drydo/archive/2008/03/26/9006.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.vbcity.com/drydo/comments/commentRss/9006.aspx</wfw:commentRss><trackback:ping>http://blogs.vbcity.com/drydo/services/trackbacks/9006.aspx</trackback:ping><description>&lt;p&gt;A very quick one.  Been playing with the above class for generating emails in .NET 2.0, embedding images within HTML views which is rather cool.  However, I noticed an unusual problem.  The emails I generated in my test project would not send until I had exited the application.  It was almost like it would only 'flush' the generated email once the application had unloaded.  Interestingly, if I attempted to send the email using the 'SendAsync' method, it would fire the SendCompleted event but still nothing would come through until the application had ended.&lt;/p&gt;

&lt;p&gt;The resolution?  Turning off Symantec Anti-Virus's 'Internet Email Auto-Protect' facility from the 'Configure' menu.  Once deselected, everything started behaving properly.  &lt;/p&gt;

&lt;p&gt;I cannot answer for any other AntiVirus packages - but its a good starting point if you're experiencing the above.&lt;/p&gt;

&lt;p&gt;M&lt;/p&gt;&lt;img src ="http://blogs.vbcity.com/drydo/aggbug/9006.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Mark Dryden</dc:creator><title>Disabling Flash (AxShockwaveFlash) Right-Click Context Menu</title><link>http://blogs.vbcity.com/drydo/archive/2008/03/03/8991.aspx</link><pubDate>Mon, 03 Mar 2008 16:42:00 GMT</pubDate><guid>http://blogs.vbcity.com/drydo/archive/2008/03/03/8991.aspx</guid><wfw:comment>http://blogs.vbcity.com/drydo/comments/8991.aspx</wfw:comment><comments>http://blogs.vbcity.com/drydo/archive/2008/03/03/8991.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.vbcity.com/drydo/comments/commentRss/8991.aspx</wfw:commentRss><trackback:ping>http://blogs.vbcity.com/drydo/services/trackbacks/8991.aspx</trackback:ping><description>&lt;p&gt;To be quite frank, after 3 months of ASP.NET development, the opportunity to do some down and dirty API programming really appealled to me today.  So, the question (as indicated by the title) involved a member wanting to disable the right-click context menu from the Flash ActiveX component when being used in a WinForms application.  (See previous blog entries for examples of Flash in VB.NET and communication between the two such as &lt;a href="http://blogs.vbcity.com/drydo/archive/2005/10/18/5586.aspx"&gt;http://blogs.vbcity.com/drydo/archive/2005/10/18/5586.aspx&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The simple answer is to capture the right-click of the Flash Window itself and prevent it from being processed.  A little play with Spy++ quickly came up with the answers and the rest was all about good old fashioned subclassing.  I must admit it pinched the API declarations from Pinvoke.net and smartened them up a tad and that is pretty much it.&lt;/p&gt;

&lt;p&gt;For the record, this is something I've been meaning to do for a while + I can leave work not feeling like some CSS floozy :)&lt;/p&gt;

&lt;p&gt;Note: to recreate, create one form, one button and add one Flash Active X control.  Copy and Paste as necessary.  Tested in VS2005.  If you get the dreaded 'Failed to import the ActiveX control' message, check out this &lt;a href="http://blogs.vbcity.com/drydo/archive/2005/12/07/5731.aspx"&gt;workaround&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
&lt;style&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }

&lt;/style&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;Imports&lt;/span&gt; System.Runtime.InteropServices

&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; Form1

&lt;span class="preproc"&gt;#Region&lt;/span&gt; &lt;span class="str"&gt;"API Routines"&lt;/span&gt;

    &amp;lt;DllImport(&lt;span class="str"&gt;"User32.dll"&lt;/span&gt;)&amp;gt; _
   &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Shared&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; EnumChildWindows _
       (&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; WindowHandle &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Callback &lt;span class="kwrd"&gt;As&lt;/span&gt; EnumWindowProcess, _
       &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; lParam &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;

    &amp;lt;DllImport(&lt;span class="str"&gt;"user32.dll"&lt;/span&gt;, CharSet:=CharSet.&lt;span class="kwrd"&gt;Auto&lt;/span&gt;)&amp;gt; _
&lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Shared&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; GetClassName(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; hWnd &lt;span class="kwrd"&gt;As&lt;/span&gt; System.IntPtr, _
   &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; lpClassName &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Text.StringBuilder, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; nMaxCount &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;)
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

    &amp;lt;DllImport(&lt;span class="str"&gt;"user32.dll"&lt;/span&gt;, CharSet:=CharSet.&lt;span class="kwrd"&gt;Auto&lt;/span&gt;)&amp;gt; _
    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Overloads&lt;/span&gt; &lt;span class="kwrd"&gt;Shared&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; SetWindowLong(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; hWnd &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt;&lt;br /&gt; nIndex &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; dwNewLong &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;

    &amp;lt;DllImport(&lt;span class="str"&gt;"user32.dll"&lt;/span&gt;, CharSet:=CharSet.&lt;span class="kwrd"&gt;Auto&lt;/span&gt;)&amp;gt; _
    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Overloads&lt;/span&gt; &lt;span class="kwrd"&gt;Shared&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; SetWindowLong(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; hWnd &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt;&lt;br /&gt; nIndex &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; dwNewLong &lt;span class="kwrd"&gt;As&lt;/span&gt; FlashCaptureRoutine) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;

    &amp;lt;DllImport(&lt;span class="str"&gt;"user32.dll"&lt;/span&gt;, CharSet:=CharSet.&lt;span class="kwrd"&gt;Auto&lt;/span&gt;)&amp;gt; _
     &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Shared&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; CallWindowProc(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; lpPrevWndFunc &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt;&lt;br /&gt; hWnd &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Msg &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; wParam &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; lParam &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;

&lt;span class="preproc"&gt;#End Region&lt;/span&gt;

&lt;span class="preproc"&gt;#Region&lt;/span&gt; &lt;span class="str"&gt;"Delegates"&lt;/span&gt;

    &lt;span class="rem"&gt;' Used for processing Flash Window messages&lt;/span&gt;
    &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Delegate&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; FlashCaptureRoutine(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; hwnd &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt;&lt;br /&gt; Msg &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; wParam &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; lParam &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;

    &lt;span class="rem"&gt;' Used for enumerating child windows&lt;/span&gt;
    &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Delegate&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; EnumWindowProcess(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Handle &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Parameter &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;

&lt;span class="preproc"&gt;#End Region&lt;/span&gt;

    &lt;span class="rem"&gt;' Constants&lt;/span&gt;
    &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Const&lt;/span&gt; GWL_WNDPROC &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = (-4)
    &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Const&lt;/span&gt; WM_ENTERMENULOOP &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = &amp;amp;H211
    &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Const&lt;/span&gt; WM_RBUTTONDOWN &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = &amp;amp;H204
    &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Const&lt;/span&gt; WM_INITMENU = &amp;amp;H116

    &lt;span class="rem"&gt;' Private vars&lt;/span&gt;
    &lt;span class="kwrd"&gt;Private&lt;/span&gt; mFlashWindowHandle &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr
    &lt;span class="kwrd"&gt;Private&lt;/span&gt; mPreviousHandle &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;
    &lt;span class="kwrd"&gt;Private&lt;/span&gt; isCapturing &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;

    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; Form1_FormClosing(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; sender &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Object&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; &lt;br /&gt;e &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Windows.Forms.FormClosingEventArgs) &lt;span class="kwrd"&gt;Handles&lt;/span&gt; &lt;span class="kwrd"&gt;Me&lt;/span&gt;.FormClosing
        &lt;span class="rem"&gt;' Cleanup if appropriate&lt;/span&gt;
        &lt;span class="kwrd"&gt;If&lt;/span&gt; isCapturing &lt;span class="kwrd"&gt;Then&lt;/span&gt; CleanupCapture()
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; Form1_Load(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; sender &lt;span class="kwrd"&gt;As&lt;/span&gt; System.&lt;span class="kwrd"&gt;Object&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; &lt;br /&gt;e &lt;span class="kwrd"&gt;As&lt;/span&gt; System.EventArgs) &lt;span class="kwrd"&gt;Handles&lt;/span&gt; &lt;span class="kwrd"&gt;MyBase&lt;/span&gt;.Load
        &lt;span class="rem"&gt;' Load the test movie...&lt;/span&gt;
        &lt;span class="kwrd"&gt;Me&lt;/span&gt;.AxShockwaveFlash1.Movie = &lt;span class="str"&gt;"MyTestMovie.swf"&lt;/span&gt;
        &lt;span class="kwrd"&gt;Me&lt;/span&gt;.AxShockwaveFlash1.Menu = &lt;span class="kwrd"&gt;True&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; Button1_Click(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; sender &lt;span class="kwrd"&gt;As&lt;/span&gt; System.&lt;span class="kwrd"&gt;Object&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; &lt;br /&gt;e &lt;span class="kwrd"&gt;As&lt;/span&gt; System.EventArgs) &lt;span class="kwrd"&gt;Handles&lt;/span&gt; Button1.Click
        &lt;span class="rem"&gt;' Capture / Reset Flash Window Processing as appropriate&lt;/span&gt;

        &lt;span class="rem"&gt;' React as approrpiate&lt;/span&gt;
        &lt;span class="kwrd"&gt;If&lt;/span&gt; isCapturing &lt;span class="kwrd"&gt;Then&lt;/span&gt;
            &lt;span class="rem"&gt;' Resume&lt;/span&gt;
            CleanupCapture()
        &lt;span class="kwrd"&gt;Else&lt;/span&gt;
            &lt;span class="rem"&gt;' Capture events&lt;/span&gt;
            CaptureRightClick()
        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
        &lt;span class="rem"&gt;' Switch over the flag&lt;/span&gt;
        isCapturing = &lt;span class="kwrd"&gt;Not&lt;/span&gt; isCapturing
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; CaptureRightClick()
        &lt;span class="rem"&gt;' Attempt to obtain the Flash Window&lt;/span&gt;
        EnumChildWindows(&lt;span class="kwrd"&gt;Me&lt;/span&gt;.Handle, &lt;br /&gt;&lt;span class="kwrd"&gt;AddressOf&lt;/span&gt; EnumWindow, IntPtr.Zero)
        &lt;span class="rem"&gt;' Subclass using new routine storing the old result&lt;/span&gt;
        mPreviousHandle = SetWindowLong(mFlashWindowHandle, GWL_WNDPROC, &lt;span class="kwrd"&gt;AddressOf&lt;/span&gt; FlashWindowCapture)
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; CleanupCapture()
        &lt;span class="rem"&gt;' Reset back to the original handle...&lt;/span&gt;
        SetWindowLong(mFlashWindowHandle, GWL_WNDPROC, mPreviousHandle)
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; FlashWindowCapture(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; hwnd &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Msg &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;br /&gt;&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; wParam &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; lParam &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;

        &lt;span class="rem"&gt;' Capture the appropriate message and prevent it from being processed&lt;/span&gt;
        &lt;span class="kwrd"&gt;Select&lt;/span&gt; &lt;span class="kwrd"&gt;Case&lt;/span&gt; Msg
            &lt;span class="kwrd"&gt;Case&lt;/span&gt; WM_RBUTTONDOWN
                &lt;span class="rem"&gt;' Exit&lt;/span&gt;
                &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;            
        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Select&lt;/span&gt;

        &lt;span class="rem"&gt;' Carry on...&lt;/span&gt;
        &lt;span class="kwrd"&gt;Return&lt;/span&gt; CallWindowProc(mPreviousHandle, hwnd, Msg, wParam, lParam)
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;

    &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; EnumWindow(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Handle &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Parameter &lt;span class="kwrd"&gt;As&lt;/span&gt; IntPtr) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;
        &lt;span class="rem"&gt;' Obtain the class name of the child window&lt;/span&gt;
        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; ClassName &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Text.StringBuilder(&lt;span class="str"&gt;""&lt;/span&gt;, 255)
        GetClassName(Handle, ClassName, ClassName.MaxCapacity)

        &lt;span class="rem"&gt;' Is this the Flash Window?&lt;/span&gt;
        &lt;span class="kwrd"&gt;If&lt;/span&gt; ClassName.ToString = &lt;span class="str"&gt;"MacromediaFlashPlayerActiveX"&lt;/span&gt; &lt;span class="kwrd"&gt;Then&lt;/span&gt;
            mFlashWindowHandle = Handle
        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
        &lt;span class="kwrd"&gt;Return&lt;/span&gt; &lt;span class="kwrd"&gt;True&lt;/span&gt;
    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;

&lt;span class="kwrd"&gt;End&lt;/span&gt; Class&lt;/pre&gt;
&lt;/p&gt;&lt;img src ="http://blogs.vbcity.com/drydo/aggbug/8991.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Mark Dryden</dc:creator><title>Importing a textfile to a typed dataset (failing and resolving)</title><link>http://blogs.vbcity.com/drydo/archive/2008/01/28/8963.aspx</link><pubDate>Mon, 28 Jan 2008 11:22:00 GMT</pubDate><guid>http://blogs.vbcity.com/drydo/archive/2008/01/28/8963.aspx</guid><wfw:comment>http://blogs.vbcity.com/drydo/comments/8963.aspx</wfw:comment><comments>http://blogs.vbcity.com/drydo/archive/2008/01/28/8963.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.vbcity.com/drydo/comments/commentRss/8963.aspx</wfw:commentRss><trackback:ping>http://blogs.vbcity.com/drydo/services/trackbacks/8963.aspx</trackback:ping><description>&lt;p&gt;I guess as developers we're used to solving the difficult problems, this task isn't working because of dependancy X, Y and Z - so we code around that, handshake with this and validate the other.  But as a developer its always the simple things that catch you out.&lt;/p&gt;

&lt;p&gt;For instance, I've spent the last 4 hours messing around with loading a comma delimited textfile into a typed dataset using one dataadapter, do some funky things to it and then upload those records into an SQL Server using an SQLDataAdapter.  Sounds easy, and it is - check out this &lt;a href="http://blogs.vbcity.com/drydo/archive/2007/09/28/8733.aspx"&gt;previous post&lt;/a&gt; for an example.&lt;/p&gt;

&lt;p&gt;So, I coded it up and interestingly it loaded the datarows correctly - but all the fields were NULL!  Now things shouldn't be more easier than this - you SELECT the data, it flys into the strongly typed dataset and job done.  I then spent my time working backwards through the code, exploring the various problems that might be occuring (tablemapping and that kinda thing).  However, the problem was much easier to diagnose - basically, a similar issue came up in the forums with someone using the same code as linked and the answer was...&lt;/p&gt;

&lt;p&gt;Change the file extension of the textfile being imported!  It turns out that the JET driver has certain restrictions placed upon it, by using a '.txt' extension it was expecting a tab delimited file - by changing the extension to '.csv' everything started working.  Check out this &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;304206"&gt;MS Support Page&lt;/a&gt; on the very subject, where only certain file extensions are supported and are subtlly dealt with in different ways.&lt;/p&gt;

&lt;p&gt;HTHs somebody - M&lt;/p&gt;&lt;img src ="http://blogs.vbcity.com/drydo/aggbug/8963.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Mark Dryden</dc:creator><title>Strongly Typed Datasets (.NET 2.0) - Course Notes</title><link>http://blogs.vbcity.com/drydo/archive/2008/01/24/8960.aspx</link><pubDate>Thu, 24 Jan 2008 09:55:00 GMT</pubDate><guid>http://blogs.vbcity.com/drydo/archive/2008/01/24/8960.aspx</guid><wfw:comment>http://blogs.vbcity.com/drydo/comments/8960.aspx</wfw:comment><comments>http://blogs.vbcity.com/drydo/archive/2008/01/24/8960.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.vbcity.com/drydo/comments/commentRss/8960.aspx</wfw:commentRss><trackback:ping>http://blogs.vbcity.com/drydo/services/trackbacks/8960.aspx</trackback:ping><description>&lt;p&gt;This course was created for the VBCity Academy where you can take online courses for free.  Unfortunately, the material I wrote is something I constantly want to keep linking to - so I've decided to place the course up as a flat article.&lt;/p&gt;

&lt;p&gt;I fully recommend that the take the course through the Academy where the structure and flow of the course should make a little more sense - however, if big long documents are your thing - check out the article at &lt;a href="http://blogs.vbcity.com/drydo/articles/8959.aspx"&gt;http://blogs.vbcity.com/drydo/articles/8959.aspx&lt;/a&gt;.&lt;/p&gt;&lt;img src ="http://blogs.vbcity.com/drydo/aggbug/8960.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>