[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 801- 901- 1001- 2chのread.cgiへ]
Update time : 06/01 23:03 / Filesize : 190 KB / Number-of Response : 1002
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

Win32API質問箱 Build66



864 名前:いのぶー mailto:sage [2008/06/05(木) 22:58:59 ]
 ペイントを操作して、絵を描こうとしているのですが、ウィンドウをポップアップできてもドローイングエリアを
クリックできません。
C#の板でスルーされたのでやってきました、お願いいたします、教えていただけませんでしょうか? 。
[DllImport("USER32.DLL")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindowEx(IntPtr hWnd, IntPtr hwndChildAfter, String lpszClass, String lpszWindow);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, Int32 wParam, Int32 lParam);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);
[StructLayout(LayoutKind.Sequential)]
public struct RECT {
public int left;
public int top;
public int right;
public int bottom;
}
const uint WM_LBUTTONDOWN = 0x201;
const uint WM_LBUTTONUP = 0x202;

public void RemotePaint() {
IntPtr hWnd = FindWindow("MSPaintApp", null);
SetForegroundWindow(hWnd);
hWnd = FindWindowEx(hWnd, IntPtr.Zero, "AfxFrameOrView42u", null);
RECT winRect = new RECT();
GetWindowRect(hWnd, ref winRect);
PostMessage(hWnd, WM_LBUTTONDOWN, winRect.right - winRect.left, winRect.bottom - winRect.top);
PostMessage(hWnd, WM_LBUTTONUP, winRect.right - winRect.left, winRect.bottom - winRect.top);
}






[ 続きを読む ] / [ 携帯版 ]

全部読む 前100 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<190KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef