Newbie Question



I added the following declaration withing a namespace but not within a class


[DllImport("user32.dll", EntryPoint="SendMessage", CharSet=CharSet.Auto )]

public static extern int SendCharFmtMsg( IntPtr hWnd, int Msg, int wParam,

ref CHARFORMAT2 cf2 );

And UI get the following compiler error
C:\Componenets\ABC\ABCColor\Class1.cs(11): Expected class, delegate, enum,
interface, or struct


Thank you,
Shmuel Shulman




.



Relevant Pages

  • Re: How to disable the second click
    ... IntPtr hWnd = GetCapture; ... int n0 = Marshal.GetLastWin32Error; ... n1=87 =>The parameter is incorrect. ... This means that the handle of the form is not correct (GetCapture fails).... ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Multi-Select Listbox
    ... Either you can PInvoke to change the control underlying behaviour to ... private static extern IntPtr GetCapture; ... private static extern int GetWindowLong ... IntPtr hWnd = GetCapture; ...
    (microsoft.public.pocketpc.developer)
  • Re: Cant get rid of that task bar
    ... > public extern static int SetWindowPos ( ... > IntPtr hWnd, HWND pos, ... > int X, int Y, int cx, int cy, SWP uFlags); ... But the calendar program cannot occupy ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ListView
    ... If you send WM_VSCROLL to a listview window handle you will scroll its ... IntPtr hwnd = GetCapture; ... extern static IntPtr GetCapture; ... extern static int SendMessage(IntPtr hWnd, uint Msg, int WParam, int ...
    (microsoft.public.dotnet.framework.compactframework)
  • to get the main window of a Process immediately!!!
    ... about the function: ShellExecute, ... there's a Parameter: nShowCmd. ... and int .net: ... IntPtr hwnd = proc.MainWindowHandle; ...
    (microsoft.public.windows.file_system)

Loading