Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. const int ButtonId = 0x0000E910;
  2. IntPtr handle = IntPtr.Zero;
  3. Process[] localAll = Process.GetProcesses();
  4. foreach (Process p in localAll)
  5. {
  6. if (p.MainWindowHandle != IntPtr.Zero)
  7. {
  8. ProcessModule pm = GetModule(p);
  9. if (pm != null && p.MainModule.FileName == fn)
  10. handle = p.MainWindowHandle;
  11. }
  12. }
  13. if (handle == IntPtr.Zero)
  14. {
  15. Console.WriteLine("Not found");
  16. return;
  17. }
  18. Console.WriteLine("{0:X}", handle);
  19. IntPtr hWndButton = GetDlgItem(handle, ButtonId);
  20. string myText = getText.GetControlText(hWndButton);
  21. Console.WriteLine("Error Code = {0}", GetLastError());
  22. Console.WriteLine("Iput Window Text !!! = {0}", myText);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement