Click here to Skip to main content
15,905,616 members
Home / Discussions / C#
   

C#

 
GeneralImage Rotation in C# Pin
mmxguy17-May-04 21:07
mmxguy17-May-04 21:07 
GeneralMessage Removed Pin
17-May-04 23:21
wibblewibblewibble17-May-04 23:21 
GeneralRe: Image Rotation in C# Pin
mmxguy18-May-04 0:00
mmxguy18-May-04 0:00 
GeneralRe: Image Rotation in C# Pin
Heath Stewart18-May-04 3:40
protectorHeath Stewart18-May-04 3:40 
GeneralWriting a bot in C# Pin
kashif Syed17-May-04 20:42
kashif Syed17-May-04 20:42 
GeneralRe: Writing a bot in C# Pin
Heath Stewart18-May-04 3:44
protectorHeath Stewart18-May-04 3:44 
GeneralImage Transparent for Web Pin
Anonymous17-May-04 19:32
Anonymous17-May-04 19:32 
GeneralRe: Image Transparent for Web Pin
Paul Watson17-May-04 23:39
sitebuilderPaul Watson17-May-04 23:39 
GeneralRe: Image Transparent for Web Pin
Dave Kreskowiak18-May-04 0:13
mveDave Kreskowiak18-May-04 0:13 
GeneralRe: Image Transparent for Web Pin
Heath Stewart18-May-04 3:45
protectorHeath Stewart18-May-04 3:45 
GeneralRe: Image Transparent for Web Pin
Dave Kreskowiak18-May-04 10:11
mveDave Kreskowiak18-May-04 10:11 
GeneralRe: Image Transparent for Web Pin
Heath Stewart18-May-04 10:15
protectorHeath Stewart18-May-04 10:15 
GeneralHELP on Blob analysia on captured images Pin
Rais Hafidz17-May-04 18:52
Rais Hafidz17-May-04 18:52 
Generalthread confusion Pin
macromark17-May-04 18:19
macromark17-May-04 18:19 
GeneralRe: thread confusion Pin
valikac17-May-04 18:33
valikac17-May-04 18:33 
GeneralRe: thread confusion Pin
macromark18-May-04 10:05
macromark18-May-04 10:05 
GeneralPropertyGrid ----Third Party tool Pin
Jay Shankar17-May-04 18:19
Jay Shankar17-May-04 18:19 
GeneralRe: PropertyGrid ----Third Party tool Pin
Heath Stewart18-May-04 3:49
protectorHeath Stewart18-May-04 3:49 
GeneralRe: PropertyGrid ----Third Party tool Pin
leppie18-May-04 7:16
leppie18-May-04 7:16 
GeneralRe: PropertyGrid ----Third Party tool Pin
Heath Stewart18-May-04 7:21
protectorHeath Stewart18-May-04 7:21 
Questionhow to use *msg in C# ? Pin
fu017-May-04 15:31
fu017-May-04 15:31 
AnswerRe: how to use *msg in C# ? Pin
Heath Stewart18-May-04 3:54
protectorHeath Stewart18-May-04 3:54 
MSG is a simple struct:
[StructLayout(LayoutLind.Sequential)]
public struct MSG
{
  public IntPtr hwnd;
  [MarshalAs(UnmanagedType.SysUInt)] public IntPtr message;
  public IntPtr wParam;
  public IntPtr lParam;
  [MarshalAs(UnmanagedType.U4)] public int time;
  public System.Drawing.Point pt;
}
The second field is an IntPtr because the unmanaged type UINT is a processor-dependent bit width: 32 bits on a 32-bit CPU and 64 bits on a 64-bit CPU. To pass a value, just use new IntPtr(someNum);

If you need a pointer to this struct (MSG*), you can either use the Marshal.StructureToPtr to marshal it to an IntPtr or - even easier - declare the method that accepts the MSG* as ref MSG msg. Here's an example:
[DllImport("user32.dll")]
private static extern bool SomeExampleFunc(ref MSG msg);
This automatically marshals the MSG struct (that you simply instantiate and fill the fields) as a MSG*.

 

Microsoft MVP, Visual C#
My Articles
GeneralDataTable - DataGrid Pin
moonboy17-May-04 14:33
moonboy17-May-04 14:33 
GeneralRe: DataTable - DataGrid Pin
Jay Shankar17-May-04 16:07
Jay Shankar17-May-04 16:07 
GeneralRe: DataTable - DataGrid Pin
Moon Boy17-May-04 18:20
Moon Boy17-May-04 18:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.