注意你的大小写
[DllImport("user32.dll",EntryPoint="Findwindow")]
public static extern int FindWindow (
string lpClassName,
string lpWindowName
);
其中EntryPoint="Findwindow" “W”大写 就OK了
哦对了int hwnd = Program.FindWindow(null,"水晶球连连看");
改成int hwnd = FindWindow(null,"水晶球连连看");
直接int hwnd = FindWindow(null,"水晶球连连看");
直接int hwnd = FindWindow(null,"水晶球连连看"); 的话会显示.
无法在 DLL“user32.dll”中找到名为“Findwindow”的入口点。
Form1.FindWindow(null,"水晶球连连看");
c#调用API比VB,VC都麻烦