Click here to Skip to main content
15,884,629 members
Articles / Programming Languages / C#

C# List View v1.3

Rate me:
Please Sign up or sign in to vote.
4.90/5 (168 votes)
2 Mar 2004CPOL13 min read 2.1M   55.8K   434  
A fully featured completely managed C# ListView.
/***************************************************
 * Glacial List v1.30
 * 
 * Written By Allen Anderson
 * http://www.glacialcomponents.com
 * 
 * February 24th, 2004
 * 
 * You may redistribute this control in binary and modified binary form as you please.  You may
 * use this control in commercial applications without need for external credit royalty free.
 * 
 * However, you are restricted from releasing the source code in any modified fashion
 * whatsoever.
 * 
 * I MAKE NO PROMISES OR WARRANTIES ON THIS CODE/CONTROL.  IF ANY DAMAGE OR PROBLEMS HAPPEN FROM ITS USE
 * THEN YOU ARE RESPONSIBLE.
 * 
 */

using System;
using System.Runtime.InteropServices;

namespace GlacialComponents.Controls
{
	/// <summary>
	/// Summary description for Win32.
	/// </summary>
	internal class Win32
	{
      [DllImport("user32.dll", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Auto)]
      static public extern IntPtr BeginDeferWindowPos(int nNumWindows);

      [DllImport("user32.dll", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Auto)]
      static public extern bool EndDeferWindowPos(IntPtr hWinPosInfo);

      [DllImport("user32.dll", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Auto)]
      static public extern IntPtr DeferWindowPos(IntPtr hWinPosInfo, HandleRef hwnd, HandleRef hwndInsertAfter, int x, int y, int cx, int cy, uint uFlags);

      [DllImport("user32.dll", ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Auto)]
      static public extern bool SetWindowPos(HandleRef hwnd, HandleRef hwndInsertAfter, int x, int y, int cx, int cy, uint uFlags);

      public const int SWP_NOSIZE = 0x0001,
         SWP_NOMOVE = 0x0002,
         SWP_NOZORDER = 0x0004,
         SWP_NOACTIVATE = 0x0010,
         SWP_FRAMECHANGED = 0x0020,
         SWP_DRAWFRAME = SWP_FRAMECHANGED,
         SWP_SHOWWINDOW = 0x0040,
         SWP_HIDEWINDOW = 0x0080,
         SWP_NOCOPYBITS = 0x0100,
         SWP_NOOWNERZORDER = 0x0200,
         SWP_NOREPOSITION = SWP_NOOWNERZORDER,
         SWP_NOSENDCHANGING = 0x0400,
         SWP_DEFERERASE = 0x2000,
         SWP_ASYNCWINDOWPOS = 0x4000;

      public static HandleRef HWND_TOP = new HandleRef(null, (IntPtr)0);
      public static HandleRef HWND_BOTTOM = new HandleRef(null, (IntPtr)1);
      public static HandleRef HWND_TOPMOST = new HandleRef(null, new IntPtr(-1));
      public static HandleRef HWND_NOTOPMOST = new HandleRef(null, new IntPtr(-2));
      public static HandleRef HWND_NULL = new HandleRef(null, (IntPtr)0);
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer Primary Architects, Inc.
United States United States
I started my programming career in the late 80's with video games and have since written games on the AppleIIgs, SNES, Saturn, Playstation, and PC. After leaving the games industry and joining the ranks of consultants I began doing a lot of work with client/server applications, data movement, and communications. I've also become a recent convert to the XP principles of software development. Despite my defection to the business world I am still an avid gamer and I can be found on the gamezone most weekends slugging it out with others in the various online games there.

I currently live in Utah where I run PA (enterprise architecture consulting firm) and occasionally guest speak at architect forums. I mountain bike (badly), golf (very badly), and have fun (often).

Comments and Discussions