Jumping of how i will find windows handle in my main program...
in C#
I run notepad.exe then type something in it,then find the main window handle using SPY++ (0x111111) ,and
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern int GetWindowText(IntPtr hWnd, [Out] StringBuilder lpString, int nMaxCount);
.
.
.
GetWindowText((IntPtr)(0x111111), str, 1024);
this code works fine and return me the caption of the main window.
: : but when i do the same to find caption of the child of notepad.exe it just set str to nothing. the spy++ told me that the child's caption has value.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…