<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Atoshi Sahoo</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/atosah/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/atosah/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:09:30 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Enable Code Analysis tab in properties in Visual Studio 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/atosah/enable-code-analysis-tab-in-properties-in-visual-studio-2008</link>
      <pubDate>Tue, 05 Jan 2010 12:50:00 GMT</pubDate>
      <dc:creator><![CDATA[Rani Sarangi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/atosah/2010/01/05/enable-code-analysis-tab-in-properties-in-visual-studio-2008/</guid>
      <description><![CDATA[Took me a couple of hours to figure this out. As I had rebuilt my dev box to install Win 7, and...]]></description>
      <content:encoded><![CDATA[<P>Took me a couple of hours to figure this out. As I had rebuilt my dev box to install Win 7, and freshly intsalled VS 2008, I was wondering why I was not getting the code analysis tab in the project proerties - I use C#.</P>
<P>It requires Visual Studio Team System 2008 for it to work. I chose the Test Suite option. Then installed updates and afterwards rebooted for the updates to take place.</P>
<P>The you are good to go! Happy FxCopping :)</P>]]></content:encoded>
    </item>
    <item>
      <title>Disable Close X button in Winforms using C#</title>
      <link>https://docs.microsoft.com/archive/blogs/atosah/disable-close-x-button-in-winforms-using-c</link>
      <pubDate>Fri, 18 May 2007 18:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Rani Sarangi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/atosah/2007/05/18/disable-close-x-button-in-winforms-using-c/</guid>
      <description><![CDATA[Demo code on how to disable the X button in menu bar in a window. I found a lot of posts on this in...]]></description>
      <content:encoded><![CDATA[<P>Demo code on how to disable the X button in menu bar in a window. I found a lot of posts on this in VB, but none for C#. So if you are a C# fan like me, this is for you...</P>
<P>1. There is no direct way to disbale the X button, like there is a property for Maximize button called MaximizeBox = false.</P>
<P>2. This is implemented by importing unmanaged dll "user32" and calling it's functions.</P>
<P>3. Before you use this code, make sure to add a Close button in your form so that you can close your app. See the attached screen shot Disabled.jpg. Below is the code for this form.</P>
<P>Add the following&nbsp;library</P><FONT color=#0000ff size=2>
<P>using</FONT><FONT size=2> System.Runtime.InteropServices;</P>
<P></FONT>Declare the following as class level variable</P><FONT color=#0000ff size=2>
<P>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> MF_BYPOSITION = 0x400;</FONT><FONT size=2></P>
<P>[</FONT><FONT color=#2b91af size=2>DllImport</FONT><FONT size=2>(</FONT><FONT color=#a31515 size=2>"User32"</FONT><FONT size=2>)]</P>
<P></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>static</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>extern</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> RemoveMenu(</FONT><FONT color=#2b91af size=2>IntPtr</FONT><FONT size=2> hMenu, </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> nPosition, </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> wFlags);</P>
<P>[</FONT><FONT color=#2b91af size=2>DllImport</FONT><FONT size=2>(</FONT><FONT color=#a31515 size=2>"User32"</FONT><FONT size=2>)]</P>
<P></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>static</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>extern</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>IntPtr</FONT><FONT size=2> GetSystemMenu(</FONT><FONT color=#2b91af size=2>IntPtr</FONT><FONT size=2> hWnd, </FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> bRevert);</P>
<P>[</FONT><FONT color=#2b91af size=2>DllImport</FONT><FONT size=2>(</FONT><FONT color=#a31515 size=2>"User32"</FONT><FONT size=2>)]</P>
<P></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>static</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>extern</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> GetMenuItemCount(</FONT><FONT color=#2b91af size=2>IntPtr</FONT><FONT size=2> hWnd);</FONT></P>
<P><FONT size=2>In the Form_Load() event, write the following code:</FONT></P><FONT size=2><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> Form1_Load(</FONT><FONT color=#0000ff size=2>object</FONT><FONT size=2> sender, </FONT><FONT color=#2b91af size=2>EventArgs</FONT><FONT size=2> e)</P>
<P>{</P>
<P></FONT><FONT color=#2b91af size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IntPtr</FONT><FONT size=2> hMenu = GetSystemMenu(</FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>.Handle, </FONT><FONT color=#0000ff size=2>false</FONT><FONT size=2>);</P>
<P></FONT><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</FONT><FONT size=2> menuItemCount = GetMenuItemCount(hMenu);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RemoveMenu(hMenu, menuItemCount - 1, MF_BYPOSITION);</P>
<P>}</P>
<P>4. Run it. Voila! you are done. If you know of a ay to do it without calling unmanaged code, please do let me know.</P></FONT></FONT>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/02/72/02/26/Disabled.JPG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-02-72-02-26/Disabled.JPG">Disabled.JPG</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>