[DllImport("user32.dll")]
public static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
このような。私は両方が必要です。私がintptrに行くと、それは適切にintに変換できないので、postmessageなどは失敗します。そうでなければ、「handle」を必要とするものはポインタであるはずなので失敗します。
Bitmap thisScreenshot = new Bitmap(Width, Height);
Graphics gfxScreenshot = Graphics.FromImage(thisScreenshot);
IntPtr hdcBitmap = gfxScreenshot.GetHdc();
PrintWindow(handle, hdcBitmap, 0);
gfxScreenshot.ReleaseHdc(hdcBitmap);
基本的には、intfindwindow関数を使用しながらこれを実行したいと思います。どのようにアイデア?また、Findwindowはハンドルですよね?