who on earth has done a complete win32 api wrapper for C#?

D

~dr-sci-fi

looking for a comprehensive version of most common API functions used in
..Net, sample below:

===============================================================
using System;
using System.Runtime.InteropServices;

namespace ApiWrapper
{
/// <summary>
/// Summary description for Win32API.
/// Date: 5 March, 2004
/// </summary>
public class Win32API
{
/// <summary>
/// The SendMessage function sends the specified message to a window or
windows.
/// The function calls the window procedure for the specified window and
does not return
/// until the window procedure has processed the message. The PostMessage
function, in contrast,
/// posts a message to a thread's message queue and returns immediately.
/// </summary>
/// <param name="WindowHandle">hWnd: Identifies the window whose window
procedure is to receive
/// the message. Two values have special meanings:
/// HWND_BROADCAST
/// The message is posted to all top-level windows in the system,
including disabled or
/// invisible unowned windows, overlapped windows, and pop-up windows.
/// The message is not posted to child windows.
/// NULL
/// The function behaves like a call to PostThreadMessage with the
dwThreadId parameter set
/// to the identifier of the current thread.</param>
/// <param name="Command">wMsg: Message to send</param>
/// <param name="Data">wParam: Specifies additional message-specific
information.</param>
/// <param name="ID">lParam: Specifies additional message-specific
information.</param>
/// <returns>The return value specifies the result of the message
processing and depends on the message sent.</returns>
[DllImport("user32.dll", EntryPoint="SendMessage")]
public static extern int SendMessage(int WindowHandle, int Command, int
Data, int ID);

/// <summary>
/// The PostMessage function places (posts) a message in the message queue
associated with the
/// thread that created the specified window and then returns without
waiting for the thread
/// to process the message.
/// </summary>
/// <param name="WindowHandle">hWnd: Identifies the window whose window
procedure is to receive
/// the message. Two values have special meanings:
/// HWND_BROADCAST
/// The message is posted to all top-level windows in the system,
including disabled or
/// invisible unowned windows, overlapped windows, and pop-up windows.
/// The message is not posted to child windows.
/// NULL
/// The function behaves like a call to PostThreadMessage with the
dwThreadId parameter set
/// to the identifier of the current thread.</param>
/// <param name="Command">wMsg: Message to send</param>
/// <param name="Data">wParam: Specifies additional message-specific
information.</param>
/// <param name="ID">lParam: Specifies additional message-specific
information.</param>
/// <returns>The return value specifies the result of the message
processing and depends on the message sent.</returns>
[DllImport("user32.dll", EntryPoint="PostMessage")]
public static extern int PostMessage(int WindowHandle, int Command, int
Data, int ID);

/// <summary>
/// The FindWindow function retrieves the handle to the top-level window
whose class name and
/// window name match the specified strings. This function does not search
child windows.
/// </summary>
/// <param name="ClassName"></param>
/// <param name="WindowName"></param>
/// <returns></returns>
[DllImport("user32.dll", EntryPoint="FindWindow")]
public static extern int FindWindow(string ClassName, string WindowName);


[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
public static extern bool BitBlt(
IntPtr hdcDest, // handle to destination DC
int nXDest, // x-coord of destination upper-left corner
int nYDest, // y-coord of destination upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
IntPtr hdcSrc, // handle to source DC
int nXSrc, // x-coordinate of source upper-left corner
int nYSrc, // y-coordinate of source upper-left corner
System.Int32 dwRop // raster operation code
);
}
}
===============================================================

TIA

- sci
 
B

Bob Powell [MVP]

Thats an excellent concept but lacking in content.

I keep adding to my win32 definitions but I don't think I'll ever do a
complete one. Too much work!

--
Bob Powell [MVP]
Visual C#, System.Drawing

Image transition effects, automatic persistent configuration and
design time mouse operations all in April's issue of Well Formed
http://www.bobpowell.net/wellformed.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top