Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   FindWindowEx in C#? (https://www.delphipraxis.net/121752-findwindowex-c.html)

Pseudemys Nelsoni 3. Okt 2008 20:50


FindWindowEx in C#?
 
Moin,

Ich möchte in meinem C# Programm ein Edit eines fremden Programms Text hinzufügen, nur wie mache ich das?

Ich habe herausegefunden, dass ich den Prozess per:

Code:
        private void button1_Click(object sender, EventArgs e)
        {
            Process[] p = Process.GetProcessesByName("SPORE(TM)_code");
        }
bekomme, doch wie geht es dann weiter? Wie komme ich an das Edit, dass sich dort befindet? Und wie beschreibe ich es auchnoch?

MfG

Marc. 3. Okt 2008 21:44

Re: FindWindowEx in C#?
 
Hi! Schau mal, ob Dir das weiterhilft. ;)
Code:
   
[DllImport("user32")]
   private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
           
[DllImport("user32")]
   private static extern IntPtr FindWindowEx(IntPtr hWnd1, IntPtr hWnd2, string lpsz1, string lpsz2);
 
[DllImport("user32")]
   private static extern bool SetWindowText(IntPtr hWnd, string lpString);

  IntPtr HWnd;
             
  HWnd = FindWindow();
  HWnd = FindWindowEx();              
  SetWindowText();
Grüße,
Marc

Marc. 13. Okt 2008 23:19

Re: FindWindowEx in C#?
 
€: Ohne
Code:
using System.Runtime.InteropServices;
funktioniert es natürlich nicht. ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:05 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz