当前位置:编程学习 > C#/ASP.NET >>

下面代码是什么意思啊????????

 
       [DllImport("user32.dll", EntryPoint = "FindWindowA")]
        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

        [DllImport("user32.dll", EntryPoint = "PostMessageA")]
        public static extern bool PostMessage(IntPtr hWnd, int Msg, int wParam, int lParam);

        [DllImport("user32.dll", EntryPoint = "GetWindowThreadProcessId")]
        public static extern int GetWindowThreadProcessId(IntPtr hWnd, out int lpdwProcessId);

        [DllImport("kernel32.dll", EntryPoint = "OpenProcess")]
        public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

        [DllImport("kernel32.dll", EntryPoint = "CloseHandle")]
        public static extern bool CloseHandle(IntPtr hObject);

        [DllImport("kernel32.dll", EntryPoint = "ReadProcessMemory")]
        public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, IntPtr lpBuffer,   int nSize, IntPtr lpNumberOfBytesRead);

        public const int WM_LBUTTONDOWN = 513;
        public const int WM_LBUTTONUP = 514;
        public const int STANDARD_RIGHTS_REQUIRED = 983040;
        public const int SYNCHRONIZE = 1048576; --------------------编程问答-------------------- DllImport,引用非托管dll,最后面是定一些消息 --------------------编程问答--------------------
引用 1 楼 bdmh 的回复:
DllImport,引用非托管dll,最后面是定一些消息


MSDN上有它们的用途和用法 --------------------编程问答--------------------
引用 1 楼 bdmh 的回复:
DllImport,引用非托管dll,最后面是定一些消息

参考DllImport的用法
http://blog.csdn.net/jame_peng/article/details/4387906
--------------------编程问答--------------------
引用 1 楼 bdmh 的回复:
DllImport,引用非托管dll,最后面是定一些消息
我想引用下面这个函数应该怎么写
HHOOK SetWindowsHookEx(

int idHook, // type of hook to install
HOOKPROC lpfn, // address of hook procedure
HINSTANCE hMod, // handle of application instance
DWORD dwThreadId // identity of thread to install hook for
);  --------------------编程问答-------------------- ??????急啊
--------------------编程问答-------------------- 导入Windows库,调用系统API --------------------编程问答--------------------   [DllImport("XXX.dll")]//XXX是dll文件的名字
  public static extern HHOOK SetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId);

--------------------编程问答--------------------
引用 7 楼 mizuho_2006 的回复:
  [DllImport("XXX.dll")]//XXX是dll文件的名字
  public static extern HHOOK SetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId);

那个dll --------------------编程问答--------------------
引用 7 楼 mizuho_2006 的回复:
  [DllImport("XXX.dll")]//XXX是dll文件的名字
  public static extern HHOOK SetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId);

按照上面写的
HHOOK缺少using指令或程序集应用
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,