class Win32API
{
[DllImport("User32.dll")] //User32.dll是Windows操作系統的核心動態庫之一
public static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32", EntryPoint = "RegisterWindowMessage")]
public static extern int RegisterWindowMessage(
string lpString
);
[DllImport("user32", EntryPoint = "SendMessage")]
public static extern int SendMessage(
int hwnd,
int wMsg,
int wParam,
ref int lParam
);
[DllImport("OLEACC.DLL", EntryPoint = "ObjectFromLresult")]
public static extern int ObjectFromLresult(
int lResult,
ref System.Guid riid,
int wParam,
[System.Runtime.InteropServices.MarshalAs(UnmanagedType.Interface), System.Runtime.InteropServices.In, System.Runtime.InteropServices.Out]ref System.Object ppvObject
//注意這個函數ObjectFromLresult的聲明.
);
}