당신은 (에서의 PInvoke)는 Win32 API에서 FindWindow
및 GetWindowText
를 사용해야합니다 :
FindWindow
: 만 자막으로
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
찾기 창을.
[DllImport("user32.dll", EntryPoint="FindWindow", SetLastError = true)]
static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
또한 호출 할 수 있습니다 FindWindow(default(string), lpWindowName)
또는 FindWindow((string)null, lpWindowName)
및 GetWindowText
: 당신이 첫 번째 매개 변수로 IntPtr.Zero
을 통과해야합니다
복사 지정된 윈도우의 텍스트 (MSDN에서) 제목 표시 줄 (있는 경우)을 버퍼에 넣습니다. 지정된 윈도우가 컨트롤이면 컨트롤의 텍스트는이 창을 취득하기 위해 노력하고,
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
출처
2012-10-24 08:14:58
Ria
이 좋아 복사됩니다. 그러나 나는 이미 창문을 가지고있다. 창문 안에 통제가 필요해. – Tomtom
win32의 각 컨트롤이 창입니다. 'spy ++'를 사용하여 컨트롤의 핸드를보십시오. find 컨트롤은 텍스트를 처리하고 가져옵니다. – Ria