Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET General
 Microsoft Win32 to Microsoft .NET F...
.NET Development (General) Technical Articles
Microsoft Win32 to Microsoft .NET Framework API Map
 

Microsoft .NET Framework and Microsoft Visual Studio User Education Teams
Microsoft Corporation

January 2004

Applies to:
    Microsoft® .NET Framework version 1.0 or 1.1
    Microsoft Visual Studio® .NET
    Microsoft Win32® functions

Summary: This article identifies the Microsoft .NET Framework version 1.0 or 1.1 APIs that provide similar functionality to Microsoft Win32 functions. One or more relevant .NET Framework APIs are shown for each Win32 function listed. The intended audience for this article is experienced Win32 developers who are creating applications or libraries based on the Microsoft .NET Framework, but anyone looking for a managed counterpart for a Win32 function could find this document useful. (85 printed pages)

In this article, the Microsoft® Win32® functions are organized by category. Each Win32 function that is listed belongs to only one category, and each category is presented in its own table. An alphabetical list of the Win32 categories is provided, as well as a hierarchical list. To locate a Win32 function, select the appropriate category from one of the category lists or search the article for the name of the function. If you do not find the Win32 function that you are seeking, it means that no equivalent .NET Framework API exists in the .NET Framework version 1.0 or 1.1 or that the Win32 function and the relevant .NET Framework API were inadvertently omitted from the list.

If you believe that a Win32 function and the relevant .NET Framework API have been omitted from this article, please let us know by using the feedback link. For more information on the APIs listed in this article, see the Platform SDK documentation or the .NET Framework SDK documentation in the MSDN® library.

Alphabetical Win32 Category List

A-C

D-I

J-N

O-R

S-T

U-Z

Hierarchical Win32 Category List

Base Services

Graphics Device Interface

User Interface

Atom Functions

Win32 function Description .NET Framework API
AddAtom Adds a character string to the local atom table. System.String.Intern

Note   String is not exactly an atom.

FindAtom Searches the local atom table for the specified character string. System.String.IsInterned

Note   String is not exactly an atom.

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Bitmap Functions

Win32 function Description .NET Framework API
AlphaBlend Displays a bitmap with transparent or semitransparent pixels. System.Drawing.Graphics.DrawImage
BitBlt Performs a bit-block transfer. System.Drawing.Graphics.DrawImage
CreateBitmap Creates a bitmap. System.Drawing.Bitmap constructor

Note   Creates a DIB, not a DDB.

GetBitmapDimensionEx Gets the dimensions of a bitmap. System.Drawing.Bitmap.Size
GetDIBColorTable Retrieves RGB color values from a DIB section bitmap. System.Drawing.Bitmap.Palette
GetDIBits Copies a bitmap into a buffer. System.Drawing.Bitmap.LockBits
GetPixel Gets the RGB color value of the pixel at a given coordinate. System.Drawing.Bitmap.GetPixel
GradientFill Fills rectangle and triangle structures. System.Drawing.Graphics.FillRectangle(Drawing2D.LinearGradiantBrush, Rectangle)
LoadBitmap Loads a bitmap from a module's executable file. System.Drawing.Bitmap.Bitmap(Type, String)
SetPixel Sets the color for a pixel. System.Drawing.Bitmap.SetPixel
SetPixelV Sets a pixel to the best approximation of a color. System.Drawing.Bitmap.SetPixel(, Graphics.GetNearestColor(Color))
StretchBlt Copies a bitmap and stretches or compresses it. System.Drawing.Graphics.DrawImage

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Brush Functions

Win32 function Description .NET Framework API
CreateBrushIndirect Creates a brush with a specified style, color, and pattern. Any of the following:
System.Drawing.Brushes
System.Drawing.SolidBrush
System.Drawing.TextureBrush
System.Drawing.Drawing2D.HatchBrush
System.Drawing.Drawing2D.LinearGradientBrush
System.Drawing.Drawing2D.PathGradientBrush
CreateHatchBrush Creates a brush with a hatch pattern and color. System.Drawing.Drawing2D.HatchBrush constructor
CreatePatternBrush Creates a brush with a bitmap pattern. System.Drawing.TextureBrush constructor
CreateSolidBrush Creates a brush with a solid color. System.Drawing.SolidBrush constructor
GetSysColorBrush Gets a handle for a brush that corresponds to a color index. System.Drawing.Brushes class

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Button Functions

Win32 function Description .NET Framework API
CheckDlgButton Changes the check state of a button control. System.Windows.Forms.CheckBox.Checked
CheckRadioButton Adds a check mark to a specified radio button in a group and removes a check mark from all other radio buttons in the group. System.Windows.Forms.RadioButton.Checked
IsDlgButtonChecked Determines whether a button control has a check mark next to it or whether a three-state button control is grayed, checked, or neither. System.Windows.Forms.CheckBox.CheckState

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Clipboard Functions

Win32 function Description .NET Framework API
CountClipboardFormats Retrieves the number of different data formats currently on the clipboard. System.Windows.Forms.DataObject.GetFormats
EnumClipboardFormats Enumerates the data formats currently available on the clipboard. System.Windows.Forms.DataObject.GetFormats
GetClipboardData Retrieves data from the clipboard in a specified format. System.Windows.Forms.ClipBoard.GetDataObject
IsClipboardFormatAvailable Determines whether the clipboard contains data in the specified format. System.Windows.Forms.DataObject.GetDataPresent
RegisterClipboardFormat Registers a new clipboard format. System.Windows.Forms.DataFormats.GetFormat
SetClipboardData Places data on the clipboard in a specified clipboard format. System.Windows.Forms.ClipBoard.SetDataObject

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Clipping Functions

Win32 function Description .NET Framework API
ExcludeClipRect Creates a new clipping region that consists of the existing clipping region minus the specified rectangle. System.Drawing.Graphics.ExcludeClip
ExtSelectClipRgn Combines the specified region with the current clipping region using the specified mode. System.Drawing.Graphics.SetClip
GetClipBox Retrieves the dimensions of the tightest bounding rectangle that can be drawn around the current visible area on the device. System.Drawing.Graphics.VisibleClipBounds
GetClipRgn Retrieves a handle identifying the current application-defined clipping region for the specified device context. System.Drawing.Graphics.Clip
IntersectClipRect Creates a new clipping region from the intersection of the current clipping region and the specified rectangle. System.Drawing.Graphics.IntersectClip
OffsetClipRgn Moves the clipping region of a device context by the specified offsets. System.Drawing.Graphics.TranslateClip
PtVisible Determines whether the specified point is within the clipping region of a device context. System.Drawing.Graphics.IsVisible
RectVisible Determines whether any part of the specified rectangle lies within the clipping region of a device context. System.Drawing.Graphics.IsVisible
SelectClipPath Selects the current path as a clipping region for a device context, combining the new region with any existing clipping region by using the specified mode. System.Drawing.Graphics.SetClip
SelectClipRgn Selects a region as the current clipping region for the specified device context. System.Drawing.Graphics.Clip

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Color Functions

Win32 function Description .NET Framework API
CreateHalftonePalette Creates a halftone palette for the specified device context. System.Drawing.Graphics.GetHalftonePalette
CreatePalette Creates a logical palette. System.Drawing.Image.Palette
GetNearestColor Retrieves a color value identifying a color from the system palette that will be displayed when the specified color value is used. System.Drawing.Graphics.GetNearestColor
GetPaletteEntries Retrieves a specified range of palette entries from the given logical palette. System.Drawing.Image.Palette.Entries

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Combo Box Functions

Win32 function Description .NET Framework API
DlgDirListComboBox Replaces the contents of a combo box with the names of specified subdirectories and files. System.Windows.Forms.ComboBox.Items.AddRange(System.IO.Directory.GetFileSystemEntries)
DlgDirSelectComboBoxEx Retrieves the current selection from a combo box filled by using DlgDirListComboBox. System.Windows.Forms.ComboBox.SelectedItem
GetComboBoxInfo Retrieves information about a specified combo box. System.Windows.Forms.ComboBox properties

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Common Dialog Box Functions

Win32 function Description .NET Framework API
ChooseColor Creates a Color dialog box that enables the user to select a color. System.Windows.Forms.ColorDialog constructor

Note   Dialog cannot be modified through a hook.

ChooseFont Creates a Font dialog box that enables the user to choose attributes for a logical font. System.Windows.Forms.FontDialog constructor

Note   Dialog cannot be modified through a hook.

GetFileTitle Retrieves the name of the specified file. System.IO.FileInfo.Name

Note   Does not take user preferences into account.

GetOpenFileName Creates an Open dialog box that lets the user specify the drive, directory, and name of a file or set of files to open. System.Windows.Forms.OpenFileDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

GetSaveFileName Creates a Save dialog box that lets the user specify the drive, directory, and name of a file to save. System.Windows.Forms.SaveFileDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

PageSetupDlg Creates a Page Setup dialog box that enables the user to specify the attributes of a printed page. System.Windows.Forms.PageSetupDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

PrintDlg Displays a Print dialog box. System.Windows.Forms.PrintDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Console Functions

Win32 function Description .NET Framework API
GetStdHandle Retrieves a handle for the standard input, standard output, or standard error device. System.Console.OpenStandardIn
System.Console.OpenStandardOut
System.Console.OpenStandardError
ReadConsole Reads character input from the console input buffer and removes it from the buffer. System.Console.Read
SetStdHandle Sets the handle for the standard input, standard output, or standard error device. System.Console.SetIn
System.Console.SetOut
System.Console.SetError
WriteConsole Writes a character string to a console screen buffer beginning at the current cursor location. System.Console.Write

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Coordinate Functions

Win32 function Description .NET Framework API
ClientToScreen Converts the client-area coordinates of a specified point to screen coordinates. System.Windows.Forms.Form.PointToScreen
CombineTransform Concatenates two world-space to page-space transformations. System.Drawing.Drawing2D.Matrix.Multiply
DPtoLP Converts device coordinates into logical coordinates. System.Drawing.Graphics.TransformPoints
GetMapMode Retrieves the current mapping mode. System.Drawing.Graphics.PageUnit
GetWindowExtEx Retrieves the x-extent and y-extent of the window for the specified device context. System.Drawing.Graphics.PageScale
GetWindowOrgEx Retrieves the x-coordinates and y-coordinates of the window origin for the specified device context. System.Drawing.Graphics.Transform.OffsetX
System.Drawing.Graphics.Transform.OffsetY
GetWorldTransform Retrieves the current world-space to page-space transformation. System.Drawing.Graphics.Transform
LPtoDP Converts logical coordinates into device coordinates. System.Drawing.Graphics.TransformPoints
ModifyWorldTransform Changes the world transformation for a device context using the specified mode. System.Drawing.Graphics.Transform
OffsetViewportOrgEx Modifies the viewport origin for a device context using the specified horizontal and vertical offsets. System.Drawing.Graphics.TranslateTransform
OffsetWindowOrgEx Modifies the window origin for a device context using the specified horizontal and vertical offsets. System.Drawing.Graphics.TranslateTransform
ScreenToClient Converts the screen coordinates of a specified point on the screen-to-client coordinates. System.Windows.Forms.Form.PointToClient
SetMapMode Sets the mapping mode of the specified device context. System.Drawing.Graphics.PageUnit
SetWindowExtEx Sets the horizontal and vertical extents of the window for a device context by using the specified values. System.Drawing.Graphics.PageScale
Drawing.Graphics.ScaleTransform
SetWindowOrgEx Specifies which window point maps to the viewport origin (0,0). System.Drawing.Graphics.TranslateTransform
SetWorldTransform Sets a two-dimensional linear transformation between world space and page space for the specified device context. System.Drawing.Graphics.Transform

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Cursor Functions

Win32 function Description .NET Framework API
ClipCursor Confines the cursor to a rectangular area on the screen. System.Windows.Forms.Cursor.Clip
CopyCursor Copies the specified cursor. System.Windows.Forms.Cursor.CopyHandle
CreateCursor Creates a cursor having the specified size, bit patterns, and hot spot. System.Windows.Forms.Cursor constructor
System.Windows.Forms.Cursor.Size
System.Windows.Forms.Cursor.Position
DestroyCursor Destroys a cursor. System.Windows.Forms.Cursor.Dispose
GetClipCursor Retrieves the screen coordinates of the rectangular area to which the cursor is confined. System.Windows.Forms.Cursor.Clip
GetCursor Retrieves a handle to the current cursor. System.Windows.Forms.Cursor.Handle
GetCursorInfo Retrieves information about the global cursor. System.Windows.Forms.Cursor.Position
System.Windows.Forms.SystemInformation.CursorSize
GetCursorPos Retrieves the cursor's position. System.Windows.Forms.Control.MousePosition
System.Windows.Forms.Cursor.Position
LoadCursor Loads a cursor resource from an executable file. System.Windows.Forms.Cursor constructor
LoadCursorFromFile Creates a cursor based on data contained in a file. System.Windows.Forms.Cursor constructor
SetCursor Sets the cursor shape. System.Windows.Forms.Cursor.Current
SetCursorPos Moves the cursor to the specified screen coordinates. System.Windows.Forms.Cursor.Position
ShowCursor Displays or hides the cursor. System.Windows.Forms.Cursor.Show
Windows.Forms.Cursor.Hide

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Debugging Functions

Win32 function Description .NET Framework API
DebugActiveProcess Enables a debugger to attach to an active process and debug it. System.Diagnostics.Debugger.Launch
DebugBreak Causes a breakpoint exception to occur in the current process. System.Diagnostics.Debugger.Break
IsDebuggerPresent Determines whether the calling process is running under the context of a debugger. System.Diagnostics.Debugger.IsAttached
OutputDebugString Sends a string to the debugger for display. System.Diagnostics.Debugger.Log

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Device Context Functions

Win32 function Description .NET Framework API
ChangeDisplaySettings Changes the settings of the default display device to the specified graphics mode. System.Management.ManagementClass("Win32_VideoController")
ChangeDisplaySettingsEx Changes the settings of the specified display device to the specified graphics mode. System.Management.ManagementClass("Win32_VideoController")
DeviceCapabilities Retrieves the capabilities of a printer device driver. System.Drawing.Printing.PageSettings
System.Drawing.Printing.PrinterSettings
EnumDisplayDevices Retrieves information about the display devices in a system. System.Management.ManagementClass("Win32_DesktopMonitor")
EnumDisplaySettings Retrieves information about one of the graphics modes for a display device. System.Management.ManagementClass("CIM_VideoControllerResolution")
GetDC Retrieves a handle to a display device context for the client area of a specified window or for the entire screen. To retrieve a Graphics object, use any of the following:
System.Drawing.Graphics.FromHwnd(Windows.Forms.Control.Handle)
System.Drawing.Printing.PrintPageEventArgs.Graphics
System.Windows.Forms.PaintEventArgs.Graphics

To explicitly retrieve a handle, use the following:
System.Drawing.Graphics.GetHdc

GetDCEx Retrieves a handle to a display device context for the client area of a specified window or for the entire screen. To retrieve a Graphics object, use any of the following:
System.Drawing.Graphics.FromHwnd(Windows.Forms.Control.Handle)
System.Drawing.Printing.PrintPageEventArgs.Graphics
System.Windows.Forms.PaintEventArgs.Graphics

To explicitly retrieve a handle, use the following:
System.Drawing.Graphics.GetHdc

GetDeviceCaps Retrieves device-specific information for the specified device. System.Drawing.Graphics properties
System.Drawing.Printing.PrinterSettings
System.Management
classes
GetLayout Retrieves the layout of a device context. System.Windows.Forms.Control.RightToLeft
GetObject Retrieves information for the specified graphics object. System.Drawing.Bitmap properties
System.Drawing.Brush
properties
System.Drawing.Font
properties
System.Drawing.Pen
properties
GetObjectType Retrieves the type of the specified object. System.Object.GetType
GetStockObject Retrieves a handle to one of the stock pens, brushes, fonts, or palettes. System.Drawing.Brushes
System.Drawing.Pens
ReleaseDC Releases a device context, freeing it for use by other applications. System.Drawing.Graphics.ReleaseHdc
SetLayout Sets the layout for a device context. System.Windows.Forms.Control.RightToLeft = System.Windows.Forms.RightToLeft.Yes

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Dialog Box Functions

Win32 function Description .NET Framework API
CreateDialog Creates a modeless dialog box from a dialog box template resource. System.Windows.Forms.Form constructor
System.Windows.Forms.Form
properties
CreateDialogIndirect Creates a modeless dialog box from a dialog box template in memory. System.Windows.Forms.Form constructor
System.Windows.Forms.Form
properties
DefDlgProc Calls the default dialog box window procedure to provide default processing for any window messages that a dialog box with a private window class does not process. System.Windows.Forms.Form.DefWndProc
DialogBox Creates a modal dialog box from a dialog box template resource. System.Windows.Forms.Form constructor
System.Windows.Forms.Form.ShowDialog
DialogBoxIndirect Creates a modal dialog box from a dialog box template in memory. System.Windows.Forms.Form constructor
System.Windows.Forms.Form.ShowDialog
DialogProc An application-defined callback function used with the CreateDialog and DialogBox families of functions. System.Windows.Forms.Form.WndProc
EndDialog Destroys a modal dialog box. System.Windows.Forms.Form.Close
GetDlgCtrlID Retrieves the identifier of the specified control. System.Windows.Forms.Form.Controls.IndexOf
GetDlgItem Retrieves a handle to a control in the specified dialog box. System.Windows.Forms.Form.Controls.Item
GetDlgItemInt Translates the text of a specified control in a dialog box into an integer value. System.Int32.Parse(Form.Text)
System.UInt32.Parse(Form.Text)
GetDlgItemText Retrieves the title or text associated with a control in a dialog box. System.Windows.Forms.Form.Controls.Item[].Text
GetNextDlgGroupItem Retrieves a handle to the first control in a group of controls that precedes (or follows) the specified control. Iterate through the controls:
System.Windows.Forms.Form.Controls.Item

Remember to determine whether the control is active by referencing the Enabled and Visible properties of the control.

Note   The order that the controls are presented in might not be the same order in which GetNextDlgGroupItem presents the controls.

GetNextDlgTabItem Retrieves a handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control. Iterate through the controls:
System.Windows.Forms.Form.Controls.Item

Remember to determine whether the control is active by referencing the Enabled, Visible, and TabStop properties of the control.

Note   The order that the controls are presented in might not be the same order in which GetNextDlgGroupItem presents the controls.

MessageBox Creates, displays, and operates a message box. System.Windows.Forms.MessageBox.Show
MessageBoxEx Creates, displays, and operates a message box. System.Windows.Forms.MessageBox.Show
MessageBoxIndirect Creates, displays, and operates a message box. System.Windows.Forms.MessageBox.Show
SendDlgItemMessage Sends a message to the specified control in a dialog box. System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message)
SetDlgItemInt Sets the text of a control in a dialog box to the string representation of a specified integer value. System.Windows.Forms.Control.Text = System.Int32.ToString
SetDlgItemText Sets the title or text of a control in a dialog box. System.Windows.Forms.Control.Text

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Dynamic-Link Library Functions

Win32 function Description .NET Framework API
GetModuleFileName Retrieves the full path and file name for the file containing the specified module. System.Reflection.Module.FullyQualifiedName
GetModuleHandle Retrieves a module handle for the specified module. System.Runtime.InteropServices.Marshal.GetHINSTANCE
LoadLibrary Maps the specified executable module into the address space of the calling process. Any of the following:
System.Reflection.Assembly.Load
System.Reflection.Assembly.LoadFrom
System.Reflection.Assembly.LoadWithPartialName
LoadLibraryEx Maps the specified executable module into the address space of the calling process. Any of the following:
System.Reflection.Assembly.Load
System.Reflection.Assembly.LoadFrom
System.Reflection.Assembly.LoadWithPartialName

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Error Handling Functions

Win32 function Description .NET Framework API
FatalAppExit Displays a message box and terminates the application when the message box is closed. System.Windows.Forms.MessageBox.Show
System.Diagnostics.Process.Kill
GetLastError Retrieves the calling thread's last-error code value. System.Runtime.InteropServices.Marshall.GetLastWin32Error

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Event Logging Functions

Win32 function Description .NET Framework API
ClearEventLog Clears the specified event log, and optionally saves the current copy of the log file to a backup file. System.Diagnostics.EventLog.Clear
CloseEventLog Closes a read handle to the specified event log. System.Diagnostics.EventLog.Close
DeregisterEventSource Closes a write handle to the specified event log. System.Diagnostics.EventLog.DeleteEventSource
GetNumberOfEventLogRecords Retrieves the number of records in the specified event log. System.Diagnostics.EventLog.Entries.Count
GetOldestEventLogRecord Retrieves the absolute record number of the oldest record in the specified event log. System.Diagnostics.EventLogEntryCollection[0]
System.Diagnostics.EventLogEntry.TimeWritten
NotifyChangeEventLog Enables an application to receive notification when an event is written to the specified event log file. System.Diagnostics.EventLog.EnableRaisingEvents
OpenBackupEventLog Opens a handle to a backup event log. System.Diagnostics.EventLog constructor
OpenEventLog Opens a handle to an event log. System.Diagnostics.EventLog constructor
ReadEventLog Reads a whole number of entries from the specified event log. System.Diagnostics.EventLogEntryCollection.CopyTo
RegisterEventSource Retrieves a registered handle to an event log. System.Diagnostics.EventLog.CreateEventSource
ReportEvent Writes an entry at the end of the specified event log. System.Diagnostics.EventLog.WriteEntry

Alphabetical Win32 Category List
Hierarchical Win32 Category List

File I/O Functions

Win32 function Description .NET Framework API
CopyFile Copies an existing file to a new file. Either of the following:
System.IO.File.Copy
IO.FileInfo.CopyTo
CreateDirectory Creates a new directory. Any of the following:
System.IO.Directory.CreateDirectory
System.IO.Directory.CreateSubdirectory
System.IO.DirectoryInfo.Create
CreateFile Creates or opens a file object. System.IO.File class and System.IO.FileInfo class
DeleteFile Deletes an existing file. Any of the following:
System.IO.Directory.Delete
System.IO.DirectoryInfo.Delete
System.IO.File.Delete
System.IO.FileInfo.Delete
FileIOCompletionRoutine An application-defined callback function used with ReadFileEx and WriteFileEx. User defined.
FindClose Closes the specified search handle. See FindFirstFile and FindNextFile
FindCloseChangeNotification Stops change notification handle monitoring. System.IO.FileSystemWatcher.EnableRaisingEvents
FindFirstChangeNotification Creates a change notification handle. System.IO.FileSystemWatcher class
FindFirstFile Searches a directory for a file whose name matches the specified file name. Any of the following:
System.IO.Directory.Exists
System.IO.Directory.GetDirectories
System.IO.Directory.GetFileSystemEntries
System.IO.Directory.GetFiles
System.IO.DirectoryInfo.Exists
System.IO.DirectoryInfo.GetDirectories
System.IO.DirectoryInfo.GetFileSystemInfos
System.IO.DirectoryInfo.GetFiles
System.IO.File.Exists
System.IO.FileInfo.Exists
FindFirstFileEx Searches a directory for a file whose name and attributes match the specified file name. Same as FindFirstFile
FindNextChangeNotification Requests that the operating system signal a change notification handle the next time it detects an appropriate change. System.IO.FileSystemWatcher class
FindNextFile Continues a file search. Any of the following:
System.IO.Directory.GetDirectories
System.IO.Directory.GetFileSystemEntries
System.IO.Directory.GetFiles
System.IO.DirectoryInfo.GetDirectories
System.IO.DirectoryInfo.GetFileSystemInfos
System.IO.DirectoryInfo.GetFiles
FlushFileBuffers Clears the buffers for the specified file and causes all buffered data to be written to the file. System.IO.FileStream.Flush
GetBinaryType Determines whether a file is executable. System.IO.FileSystemInfo.Extension

Note   Only manipulates strings; does not do a file-system check.

GetCurrentDirectory Retrieves the current directory for the current process. System.IO.Directory.GetCurrentDirectory
GetDriveType Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. System.Management.ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"").Get
System.Management.ManagementObject.Properties
System.IO.DriveInfo.DriveType
GetFileAttributes Retrieves attributes for a specified file or directory. Any of the following:
System.IO.Directory.GetAttributes
System.IO.File.GetAttributes
System.IO.FileSystemInfo.Attributes
GetFileAttributesEx Retrieves attributes for a specified file or directory. Any of the following:
System.IO.Directory.GetAttributes
System.IO.File.GetAttributes
System.IO.FileSystemInfo.Attributes
GetFileInformationByHandle Retrieves file information for a specified file. System.IO.FileInfo properties
GetFileSize Retrieves the size of a specified file. Either of the following:
System.IO.FileInfo.Length
System.IO.FileStream.Length
GetFileSizeEx Retrieves the size of a specified file. Either of the following:
System.IO.FileInfo.Length
System.IO.FileStream.Length
GetFullPathName Retrieves the full path and file name of a specified file. Either of the following:
System.IO.FileSystemInfo.FullName
System.IO.Path.GetFullPath
GetTempFileName Creates a name for a temporary file. System.IO.Path.GetTempFileName
GetTempPath Retrieves the path of the directory designated for temporary files. System.IO.Path.GetTempPath
LockFile Locks a region in an open file. System.IO.FileStream.Lock
LockFileEx Locks a region in an open file for shared or exclusive access. System.IO.FileStream.Lock
MoveFile Moves an existing file or a directory. Any of the following:
System.IO.Directory.Move
System.IO.DirectoryInfo.MoveTo
System.IO.File.Move
System.IO.FileInfo.MoveTo
ReadDirectoryChangesW Retrieves information describing the changes occurring within a directory. System.IO.FileSystemWatcher class
ReadFile Reads data from a file, starting at the specified position. Any of the following:
System.IO.FileStream.BeginRead/EndRead
System.IO.FileStream.Read
System.IO.FileStream.ReadByte
ReadFileEx Reads data from a file asynchronously. System.IO.FileStream.BeginRead/EndRead
RemoveDirectory Deletes an existing empty directory. Either of the following:
System.IO.Directory.Delete
System.IO.DirectoryInfo.Delete
SearchPath Searches for the specified file. Any of the following:
System.IO.Directory.Exists
System.IO.Directory.GetDirectories
System.IO.Directory.GetFileSystemEntries
System.IO.Directory.GetFiles
System.IO.DirectoryInfo.Exists
System.IO.DirectoryInfo.GetDirectories
System.IO.DirectoryInfo.GetFileSystemInfos
System.IO.DirectoryInfo.GetFiles
System.IO.File.Exists
System.IO.FileInfo.Exists
SetCurrentDirectory Changes the current directory for the current process. System.IO.Directory.SetCurrentDirectory
SetEndOfFile Moves the end-of-file position for the specified file. System.IO.FileStream.SetLength
SetFileAttributes Sets the attributes for a file. System.IO.File.SetAttributes
SetFilePointer Moves the file pointer of an open file. Either of the following:
System.IO.FileStream.Position
System.IO.FileStream.Seek
SetFilePointerEx Moves the file pointer of an open file. Either of the following:
System.IO.FileStream.Position
System.IO.FileStream.Seek
UnlockFile Unlocks a previously locked region in an open file. System.IO.FileStream.Unlock
UnlockFileEx Unlocks a previously locked region in an open file. System.IO.FileStream.Unlock
WriteFile Writes data to a file. Any of the following:
System.IO.FileStream.BeginWrite
and EndWrite
System.IO.FileStream.Write
System.IO.FileStream.WriteByte
System.IO.BinaryWriter.Write
WriteFileEx Writes data to a file asynchronously. System.IO.FileStream.BeginWrite and EndWrite

Alphabetical Win32 Category List
Hierarchical Win32 Category List

File System Functions

Used with file systems:

Win32 function Description .NET Framework API
GetDiskFreeSpace Retrieves information about the specified disk, including the amount of free space on the disk. System.Management.ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"").Get
System.Management.ManagementObject.Properties
GetDiskFreeSpaceEx Retrieves information about the specified disk, including the amount of free space on the disk. System.Management.ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"").Get
System.Management.ManagementObject.Properties
GetLogicalDriveStrings Fills a buffer with strings that specify valid drives in the system. Either of the following:
System.Environment.GetLogicalDrives
System.IO.Directory.GetLogicalDrives

Used with an encrypted file system:

Win32 function Description .NET Framework API
DecryptFile Decrypts an encrypted file or directory. System.Security.Cryptography.CryptoStream.Read
EncryptFile Encrypts a file or directory. System.Security.Cryptography.CryptoStream.Write
FileEncryptionStatus Retrieves the encryption status of the specified file. System.IO.FileSystemInfo.Attributes

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Filled Shape Functions

Win32 function Description .NET Framework API
Chord Draws an area bounded by an ellipse and a line segment. System.Drawing.Graphics.DrawArc
System.Drawing.Graphics.DrawLine
Ellipse Draws an ellipse. System.Drawing.Graphics.DrawEllipse
System.Drawing.Graphics.FillEllipse
FillRect Fills a rectangle using a brush. System.Drawing.Graphics.FillRectangle
InvertRect Inverts the color values of the pixels in a rectangle. System.Windows.Forms.ControlPaint.DrawReversibleFrame
System.Windows.Forms.ControlPaint.DrawReversibleLine
Pie Draws a pie-shaped wedge bounded by an ellipse and two radials. System.Drawing.Graphics.DrawPie
System.Drawing.Graphics.FillPie
Polygon Draws a polygon. System.Drawing.Graphics.DrawPolygon
System.Drawing.Graphics.FillPolygon
Rectangle Draws a rectangle. System.Drawing.Graphics.DrawRectangle
System.Drawing.Graphics.FillRectangle
RoundRect Draws a rectangle with rounded corners. System.Drawing.Drawing2D.GraphicsPath.AddLines
System.Drawing.Pen.LineJoin = System.Drawing.Pen.LineJoin.Round
System.Drawing.Graphics.DrawPath
System.Drawing.Graphics.FillPath

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Font and Text Functions

Win32 function Description .NET Framework API
AddFontMemResourceEx Adds an embedded font to the system font table. System.Drawing.Text.PrivateFontCollection.AddMemoryFont
AddFontResourceEx Adds a private or non-enumerable font to the system font table. System.Drawing.Text.PrivateFontCollection.AddFontFile
CreateFont Creates a logical font. System.Drawing.Font constructor
DrawText Draws formatted text in a rectangle. System.Drawing.Graphics.DrawString
DrawTextEx Draws formatted text in a rectangle. System.Drawing.Graphics.DrawString
EnumFontFamExProc An application-defined callback function used with EnumFontFamiliesEx to process fonts. System.Drawing.Text.InstalledFontCollection.Families
EnumFontFamiliesEx Enumerates all fonts in the system with certain characteristics. System.Drawing.Text.InstalledFontCollection.Families
ExtTextOut Draws a character string. System.Drawing.Graphics.DrawString
GetCharABCWidths Gets the widths of consecutive characters from the TrueType font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Rectangle.Round(Region.GetBounds).Width

GetCharABCWidthsFloat Gets the widths of consecutive characters from the current font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Region.GetBounds.Width

GetCharWidth32 Gets the widths of consecutive characters from the current font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Rectangle.Round(Region.GetBounds).Width

GetCharWidthFloat Gets the fractional widths of consecutive characters from the current font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Region.GetBounds.Width

GetOutlineTextMetrics Gets text metrics for TrueType fonts. System.Drawing.Font properties
GetTabbedTextExtent Computes the width and height of a character string, including tabs. System.Drawing.Graphics.MeasureString
GetTextAlign Gets the text-alignment setting for a device context. System.Drawing.StringFormat.Alignment
System.Drawing.StringFormat.LineAlignment
GetTextColor Gets the text color for a device context. System.Drawing.SolidBrush.Color
GetTextExtentPoint32 Computes the width and height of a string of text. System.Drawing.Graphics.MeasureString
GetTextFace Gets the name of the font that is selected into a device context. System.Drawing.Font.Name
GetTextMetrics Fills a buffer with the metrics for a font. System.Drawing.Font properties
RemoveFontMemResourceEx Removes a font whose source was embedded in a document from the system font table. System.Drawing.Text.PrivateFontCollection.Dispose
RemoveFontResourceEx Removes a private or non-enumerable font from the system font table. System.Drawing.Text.PrivateFontCollection.Dispose
SetTextAlign Sets the text-alignment flags for a device context. System.Drawing.StringFormat.Alignment
System.Drawing.StringFormat.LineAlignment
SetTextColor Sets the text color for a device context. Either of the following:
System.Drawing.Brushes
System.Drawing.SolidBrush.SolidBrush(Color)
TabbedTextOut Writes a character string at a location, expanding tabs to specified values. System.Drawing.Graphics.DrawString using System.Drawing.StringFormat.SetTabStops
TextOut Writes a character string at a location. System.Drawing.Graphics.DrawString

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Icon Functions

Win32 function Description .NET Framework API
CopyIcon Copies an icon from another module. System.Drawing.Icon.FromHandle
CreateIcon Creates an icon with a specified size, color, and bit pattern. System.Drawing.Icon constructor
DestroyIcon Destroys an icon. System.Drawing.Icon.Dispose
DrawIcon Draws an icon. System.Drawing.Graphics.DrawIcon
DuplicateIcon Creates a duplicate of a specified icon. System.Drawing.Icon.Clone
LoadIcon Loads an icon from the executable file associated with an application. System.Drawing.Icon constructor

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Input Method Editor Functions

Win32 function Description .NET Framework API
ImmAssociateContext Associates the specified input context with the specified window. Either of the following:
System.Windows.Forms.Control.DefaultImeMode
System.Windows.Forms.Control.ImeMode
ImmAssociateContextEx Changes the association between the input method context and the specified window or its children. Any of the following:
System.Windows.Forms.Control.DefaultImeMode
System.Windows.Forms.Control.ImeMode
System.Windows.Forms.Control.ResetImeMode
ImmDisableIME Disables the Input Method Editor. System.Windows.Forms.Control.ImeMode = System.Windows.Forms.ImeMode.Disable
ImmGetContext Retrieves the input context associated with the specified window. System.Windows.Forms.Control.ImeMode

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Keyboard Accelerator Functions

Win32 function Description .NET Framework API
TranslateAccelerator Processes accelerator keys for menu commands. System.Windows.Forms.MenuItem.Shortcut

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Keyboard Input Functions

Win32 function Description .NET Framework API
ActivateKeyboardLayout Sets the input locale identifier for the calling thread or the current process. System.Windows.Forms.InputLanguage.CurrentInputLanguage
EnableWindow Enables or disables mouse and keyboard input to the specified window or control. System.Windows.Forms.Control.Enabled
GetActiveWindow Retrieves the window handle to the active window attached to the calling thread's message queue. System.Windows.Forms.Form.ActiveForm
GetFocus Retrieves the handle to the window that has the keyboard focus. System.Windows.Forms.Control.Controls[].Focused
GetKeyboardLayout Retrieves the active input locale identifier for the specified thread. System.Windows.Forms.InputLanguage.CurrentInputLanguage
GetKeyboardLayoutList Retrieves the input locale identifiers corresponding to the current set of input locales in the system. System.Windows.Forms.InputLanguage.InstalledInputLanguages
GetKeyboardLayoutName Retrieves the name of the active input locale identifier. System.Windows.Forms.InputLanguage.LayoutName
GetKeyNameText Retrieves a string that represents the name of a key. System.Windows.Forms.KeyEventArgs.KeyCode.ToString
IsWindowEnabled Determines whether the specified window is enabled for mouse and keyboard input. System.Windows.Forms.Form.Enabled
SetActiveWindow Activates a window. System.Windows.Forms.Activate
SetFocus Sets the keyboard focus to the specified window. System.Windows.Forms.Form.Focus
ToAscii Translates the specified virtual-key code and keyboard state to the corresponding character or characters. System.Windows.Forms.KeyPressEventArgs.KeyChar
ToUnicode Translates the specified virtual-key code and keyboard state to the corresponding Unicode character or characters. System.Windows.Forms.KeyPressEventArgs.KeyChar

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Line and Curve Functions

Win32 function Description .NET Framework API
AngleArc Draws a line segment and an arc. System.Drawing.Graphics.DrawLine
System.Drawing.Graphics.DrawArc
Arc Draws an elliptical arc. System.Drawing.Graphics.DrawArc
ArcTo Draws an elliptical arc. System.Drawing.Graphics.DrawArc
LineTo Draws a line from the current position up to, but not including, the specified point. System.Drawing.Graphics.DrawLine
PolyBezier Draws one or more B&x00E9;zier curves. System.Drawing.Graphics.DrawBeziers
Polyline Draws a series of line segments by connecting the points in the specified array. System.Drawing.Graphics.DrawLines

Alphabetical Win32 Category List
Hierarchical Win32 Category List

List Box Functions

Win32 function Description .NET Framework API
DlgDirList Replaces the contents of a list box with the names of the subdirectories and files in a specified directory. System.Windows.Forms.ListBox.Items.AddRange(System.IO.Directory.GetFileSystemEntries)
DlgDirSelectEx Retrieves the current selection from a single-selection list box. System.Windows.Forms.ListBox.SelectedItem
GetListBoxInfo Retrieves information about the specified list box. System.Windows.Forms.ListBox properties

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Memory Management Functions

Memory management functions:

Win32 function Description .NET Framework API
GlobalMemoryStatus Obtains information about the system's current usage of both physical and virtual memory. System.Management.ManagementClass("Win32_OperatingSystem")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties
GlobalMemoryStatusEx Obtains information about the system's current usage of both physical and virtual memory. System.Management.ManagementClass("Win32_OperatingSystem")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties

Global and local functions:

Win32 function Description .NET Framework API
GlobalAlloc Allocates the specified number of bytes from the heap. System.Runtime.InteropServices.Marshall.AllocHGlobal
GlobalFree Frees the specified global memory object. System.Runtime.InteropServices.Marshall.FreeHGlobal
GlobalReAlloc Changes the size or attributes of a specified global memory object. System.Runtime.InteropServices.Marshall.ReAllocHGlobal
LocalAlloc Allocates the specified number of bytes from the heap. System.Runtime.InteropServices.Marshall.AllocHGlobal
LocalFree Frees the specified local memory object. System.Runtime.InteropServices.Marshall.FreeHGlobal
LocalReAlloc Changes the size or the attributes of a specified local memory object. System.Runtime.InteropServices.Marshall.ReAllocHGlobal

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Menu Functions

Win32 function Descriptions .NET Framework API
AppendMenu Appends an item to various menus and submenus. System.Windows.Forms.Menu.MenuItemCollection.Add
CheckMenuItem Checks or clears a menu item. System.Windows.Forms.MenuItem.Checked
CheckMenuRadioItem Checks a specified menu item and makes it a radio item. System.Windows.Forms.MenuItem.RadioCheck
CreateMenu Creates a menu. Any of the following:
System.Windows.Forms.ContextMenu
constructor
System.Windows.Forms.MainMenu
constructor
System.Windows.Forms.Menu.MenuItemCollection
constructor
CreatePopupMenu Creates a drop-down menu, submenu, or shortcut menu. Either of the following:
System.Windows.Forms.ContextMenu
constructor
System.Windows.Forms.Menu.MenuItemCollection
constructor
DeleteMenu Deletes a menu item. System.Windows.Forms.Menu.MenuItemCollection.Remove
DestroyMenu Deletes a menu. System.Windows.Forms.Menu.Dispose
EnableMenuItem Enables, disables, or grays a menu item. System.Windows.Forms.MenuItem.Enabled
GetMenu Gets a handle to the menu. System.Windows.Forms.Form.Menu.Handle
GetMenuBarInfo Gets information about a menu bar. System.Windows.Forms.Form.Menu
GetMenuCheckMarkDimensions Returns the dimensions of the default check-mark bitmap. System.Windows.Forms.SystemInformation.MenuCheckSize
GetMenuDefaultItem Gets the default menu item on a menu. System.Windows.Forms.MenuItem.DefaultItem
GetMenuInfo Gets information about a menu. System.Windows.Forms.MenuItem properties
GetMenuItemCount Gets the number of items in a menu. System.Windows.Forms.Menu.MenuItemCollection.Count
GetMenuItemID Gets the identifier of a menu item. System.Windows.Forms.MenuItem.MenuID
GetMenuItemInfo Gets information about a menu item. System.Windows.Forms.MenuItem properties
GetMenuItemRect Gets the bounding rectangle for a menu item. System.Windows.Forms.MenuItem.DrawItem
System.Windows.Forms.DrawItemEventArgs.Bounds
GetMenuState Gets the menu flags associated with a menu item. System.Windows.Forms.MenuItem.Break
System.Windows.Forms.MenuItem.BarBreak
System.Windows.Forms.MenuItem.Checked
System.Windows.Forms.MenuItem.Enabled
System.Windows.Forms.MenuItem.OwnerDraw
GetMenuString Copies the text string of a menu item into a buffer. System.Windows.Forms.MenuItem.Text
GetSubMenu Gets a handle to the drop-down menu or submenu activated by a menu item. System.Windows.Forms.Menu.MenuItems[].Handle
InsertMenu Inserts a new menu item into a menu. System.Windows.Forms.Menu.MenuItemCollection.Add
InsertMenuItem Inserts a new menu item in a menu. System.Windows.Forms.Menu.MenuItemCollection.Add
ModifyMenu<