<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CreateProcess und dann Handle vom Fokus-Element?]]></title><description><![CDATA[<p>Moin!</p>
<p>Ich bräuchte mal etwas Hilfe (in Code-Form).</p>
<p>Ich will ein externes Programm mittels CreateProcess starten (soweit kein Problem!) und dann zu einem beliebigen Zeitpunkt den handle des fokusierten Elements abfragen.</p>
<p>Ähhh.... ja! Ich versuchs nochmal etwas eindeutiger:</p>
<p>Klick auf nen Button in meinem Prog -&gt; CreateProcess -&gt; ich bekomme den Handle der Anwendung -&gt; Der Benutzer arbeitet mit dem Programm (klickt, schreibt, etc.) -&gt; Der Benutzer kommt zu meinem Prog zurück (die andere Anwendung wird vom Benutzer NICHT BEENDET) -&gt; Jetzt hätte ich gerne den Handle (Hwnd oder sonstwas) von dem Element der anderen Anwendung, wo der Benutzer zuletzt &quot;war&quot;. Wie mache ich das???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/93825/createprocess-und-dann-handle-vom-fokus-element</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 22:19:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/93825.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Dec 2004 07:26:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Fri, 03 Dec 2004 07:26:46 GMT]]></title><description><![CDATA[<p>Moin!</p>
<p>Ich bräuchte mal etwas Hilfe (in Code-Form).</p>
<p>Ich will ein externes Programm mittels CreateProcess starten (soweit kein Problem!) und dann zu einem beliebigen Zeitpunkt den handle des fokusierten Elements abfragen.</p>
<p>Ähhh.... ja! Ich versuchs nochmal etwas eindeutiger:</p>
<p>Klick auf nen Button in meinem Prog -&gt; CreateProcess -&gt; ich bekomme den Handle der Anwendung -&gt; Der Benutzer arbeitet mit dem Programm (klickt, schreibt, etc.) -&gt; Der Benutzer kommt zu meinem Prog zurück (die andere Anwendung wird vom Benutzer NICHT BEENDET) -&gt; Jetzt hätte ich gerne den Handle (Hwnd oder sonstwas) von dem Element der anderen Anwendung, wo der Benutzer zuletzt &quot;war&quot;. Wie mache ich das???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664912</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Fri, 03 Dec 2004 07:26:46 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Fri, 03 Dec 2004 10:48:33 GMT]]></title><description><![CDATA[<p>Oder doch eher WinApi? *skeptischguck*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/665038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/665038</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Fri, 03 Dec 2004 10:48:33 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Fri, 03 Dec 2004 16:40:49 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=437" rel="nofollow">Jansen</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=2" rel="nofollow">Borland C++ Builder (VCL/CLX)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/665320</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/665320</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 03 Dec 2004 16:40:49 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Fri, 03 Dec 2004 20:00:08 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/process_information_str.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/process_information_str.asp</a><br />
thread id holen</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/getguithreadinfo.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/getguithreadinfo.asp</a></p>
<p>und hier müsste alles stehen was du brauchst<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowstructures/guithreadinfo.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowstructures/guithreadinfo.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/665483</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/665483</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Fri, 03 Dec 2004 20:00:08 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Fri, 03 Dec 2004 21:16:12 GMT]]></title><description><![CDATA[<p>Och, das ist ja einfacher, als ich gedacht hab! *staun*</p>
<p>Ich hoffe, ich krieg das hin, aber auf jeden Fall ein <strong>MEGADANKE</strong>!!!</p>
<p>(Und sorry, weil ichs falsch reingesetzt hab!)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/665521</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/665521</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Fri, 03 Dec 2004 21:16:12 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Mon, 06 Dec 2004 12:23:13 GMT]]></title><description><![CDATA[<p>Also: Ich habs jetzt mal getestet.</p>
<p>CreateProcess klappt und liefert die PROCESS_INFORMATION ausgefüllt zurück.<br />
Daraus hol ich mir mittels sProcessInfo-&gt;dwThreadId die ThreadID. Die stimmt auch, habs mit Spy++ getestet.<br />
GetGUIThreadInfo(sProcessInfo-&gt;dwThreadId, &amp;lpgui); liefert aber nur NULL, also nicht die Funktion, sondern in lpgui sind alle Variablen =NULL, ausser cbSize, das hab ich ja aber vorher selber initialisiert mit sizeof(GUITHREADINFO).</p>
<p>Was mach ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/667049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667049</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Mon, 06 Dec 2004 12:23:13 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Mon, 06 Dec 2004 12:27:38 GMT]]></title><description><![CDATA[<p>el Clio schrieb:</p>
<blockquote>
<p>GetGUIThreadInfo(sProcessInfo-&gt;dwThreadId, <strong>&amp;lpgui</strong>);</p>
</blockquote>
<p>sieht verdächtig aus. zeig mal deine deklaration.</p>
<p>rückgabewert? getlasterror?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/667057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667057</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 06 Dec 2004 12:27:38 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Mon, 06 Dec 2004 12:40:08 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">GUITHREADINFO lpgui;

ZeroMemory(&amp;lpgui, sizeof(GUITHREADINFO)); // egal ob mit oder ohne init.!

lpgui.cbSize = sizeof(GUITHREADINFO);

...

bool rc = GetGUIThreadInfo(sProcessInfo-&gt;dwThreadId, &amp;lpgui);
if(rc == false)
{
  // Fehler
  return -1;  // hier renn ich nich rein, Rückgabewert ist true!
}
...
HWND hwndFocus = lpgui.hwndFocus; // ist immer NULL!
</code></pre>
<p>GetLastError (hab ich grad mal eingebaut) liefert 0, also ERROR_SUCCESS.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/667066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667066</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Mon, 06 Dec 2004 12:40:08 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Mon, 06 Dec 2004 13:19:37 GMT]]></title><description><![CDATA[<p>sieht eigentlich ganz vernünfig aus. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>hab mal nen kleinen test geschrieben, bei funktioniert es wie ich beschrieben hatte. am besten du postest mal deinen relevanten code.</p>
<p>mein test:</p>
<pre><code class="language-cpp">int main(int argc, char *argv[])
{
    STARTUPINFO si;
    PROCESS_INFORMATION pi;

    ZeroMemory(&amp;si, sizeof(si));
    si.cb = sizeof(si);
    ZeroMemory(&amp;pi, sizeof(pi));

    if(!CreateProcess(
		NULL,
        TEXT(&quot;notepad.exe&quot;),
        NULL,
        NULL,
        FALSE,
        0,
        NULL,
        NULL,
        &amp;si,
        &amp;pi)) 
    {
		cout &lt;&lt; &quot;CreateProcess failed &lt; &quot; &lt;&lt; GetLastError() &lt;&lt; &quot; &gt;&quot; &lt;&lt; endl;
	        return -1;
    }

    // natürlich nicht die feine englische, aber für nen test geht's  ;) 
    WaitForSingleObject(pi.hProcess, 3000);

	GUITHREADINFO gui;

	ZeroMemory(&amp;gui, sizeof(GUITHREADINFO));

	gui.cbSize = sizeof(GUITHREADINFO);

	if(!(GetGUIThreadInfo(pi.dwThreadId, &amp;gui)))
	{
		cout &lt;&lt; &quot;GetGUIThreadInfo failed &lt; &quot; &lt;&lt; GetLastError() &lt;&lt; &quot; &gt;&quot; &lt;&lt; endl;
	        return -1;
	}

	cout &lt;&lt; &quot;hwndFocus &lt; &quot; &lt;&lt; gui.hwndFocus &lt;&lt; &quot; &gt;&quot; &lt;&lt; endl;

    CloseHandle(pi.hProcess);
    CloseHandle(pi.hThread);

	system(&quot;pause&quot;);

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/667101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667101</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 06 Dec 2004 13:19:37 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Mon, 06 Dec 2004 13:37:25 GMT]]></title><description><![CDATA[<p>mmm... hab ich ja eigentlich ganz genauso...<br />
was meinste denn mit &quot;relevantem code&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/667116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667116</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Mon, 06 Dec 2004 13:37:25 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Mon, 06 Dec 2004 14:00:53 GMT]]></title><description><![CDATA[<p>el Clio schrieb:</p>
<blockquote>
<p>was meinste denn mit &quot;relevantem code&quot;?</p>
</blockquote>
<p>du funktionen die etwas mit dem problem zu tun haben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
es ist zum beispiel völlig uninteressant welche child fenster du in deiner anwendung hast oder wie du auf wm_size reagierst, waren jetzt nur beispiele (falls es sich um eine winapi gui anwendung handelt) aber ich denke du weisst was ich meine. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/667151</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667151</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 06 Dec 2004 14:00:53 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Mon, 06 Dec 2004 14:48:16 GMT]]></title><description><![CDATA[<p>ach so...</p>
<p>Na dann leg ich mal los! Vorab noch:Es ist alles noch nicht fertig, weil ich eben beim &quot;hwndFocus&quot; hängengeblieben bin.<br />
Ach so, erstellt hab ich den &quot;Unsinn&quot; übrigens mit BCB.</p>
<pre><code class="language-cpp">// in meiner Formular-cpp
HANDLE hTest;
PROCESS_INFORMATION sProcessInfo;
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
   // Init der Variablen bzw. Anzeige
   Edit1-&gt;Text = &quot;c:\\windows\\notepad.exe&quot;;
   Edit2-&gt;Text = &quot;&quot;;
   hTest = NULL;  // Edit2 dient zur Statusanzeige!
   Button2-&gt;Enabled = false;

   ZeroMemory(&amp;sProcessInfo, sizeof(PROCESS_INFORMATION));
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
   // starte Prog und prüfe, ob ok!
   if((hTest = ExecuteProcess(Edit1-&gt;Text, ExtractFilePath(Edit1-&gt;Text), &amp;sProcessInfo)) != NULL)
   {
      Edit2-&gt;Text = &quot;Prog läuft&quot;;
      Timer1-&gt;Enabled = true;
      Button2-&gt;Enabled = true;
   }
   else
   {
      // na sowas!
      Edit2-&gt;Text = &quot;Prog NICHT gestartet!!!&quot;;
   }        
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
   if(hTest != NULL) // sollt immer ok sein!
   {
      DWORD noteExitCode; // hier werden gleich daten gespeichert

      // hole ExitCode und prüfe, ob Ausführung ok!
      if(GetExitCodeProcess(hTest,&amp;noteExitCode))
      {
         if(noteExitCode == STILL_ACTIVE)
         {
            // immer noch an
            Edit2-&gt;Text = &quot;Prog läuft noch!&quot;;
            Button2-&gt;Enabled = true;
         }
         else
         {
            // Programm beendet
            Timer1-&gt;Enabled = false;
            CloseHandle(hTest);
            Edit2-&gt;Text = &quot;Prog beendet&quot;;
            Button2-&gt;Enabled = false;
         }
      }
   }        
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
   Edit3-&gt;Text = TextSend(hTest,&amp;sProcessInfo,Edit3-&gt;Text);        
}
</code></pre>
<pre><code class="language-cpp">// in meiner CreateProcess.cpp (aus der FAQ des Boards übernommen und modifiziert)
HANDLE ExecuteProcess( const String &amp;CommandLine, const String &amp;WorkDir, PROCESS_INFORMATION *sProcessInfo)
{
   STARTUPINFO sStartInfo;
   ZeroMemory( &amp;sStartInfo, sizeof(STARTUPINFO) );
   sStartInfo.cb = sizeof(STARTUPINFO);
   sStartInfo.wShowWindow = SW_SHOWDEFAULT;
   sStartInfo.dwFlags = STARTF_USESHOWWINDOW;

   bool ok = CreateProcess( NULL,
                            CommandLine.c_str(),
                            NULL,
                            NULL,
                            false,//true,
                            0,//NORMAL_PRIORITY_CLASS,
                            NULL,
                            NULL,//WorkDir.c_str(),
                            &amp;sStartInfo,
                            sProcessInfo
                            );

   if(!ok)
   {
      sProcessInfo-&gt;hProcess = 0;
   }

   return sProcessInfo-&gt;hProcess; // zwar nicht mehr nötig, aber egal.
}
</code></pre>
<pre><code class="language-cpp">// in meiner Textsenden-cpp
AnsiString TextSend(HANDLE hWin, PROCESS_INFORMATION *sProcessInfo, AnsiString text)
{
   GUITHREADINFO lpgui;

   ZeroMemory(&amp;lpgui, sizeof(GUITHREADINFO));

   lpgui.cbSize = sizeof(GUITHREADINFO);

   bool rc = GetGUIThreadInfo(sProcessInfo-&gt;dwThreadId, &amp;lpgui);
   if(rc == false)
   {
      // Fehler
      return &quot;Fehler!&quot;;
   }

   HWND hwndFocus = lpgui.hwndFocus;
   AnsiString ret;
   int nLen;
   if(hwndFocus != NULL)
   {
      // Länge des Textes holen
      nLen = SendMessage(hwndFocus, WM_GETTEXTLENGTH, 0, 0);
      char *pText = new char[nLen];

      // Text holen und speichern
      SendMessage(hwndFocus, WM_GETTEXT, (WPARAM)nLen, (LPARAM)pText);
      ret = pText;

      // Text modifizieren (im Moment einfaches ersetzen)
      ret = text;

      // Text in das Element zurückschreiben
      SendMessage(hwndFocus, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)ret.c_str());

      return ret;
   }
   else
   {
      return AnsiString((int)hwndFocus); // nur zur Kontrolle, logischerweise immer NULL
   }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/667228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667228</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Mon, 06 Dec 2004 14:48:16 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 11:55:31 GMT]]></title><description><![CDATA[<p>Also ich blicks echt nich... Hat das was mit dem XP-SP2 zu tun, oder was? (Wär ja nich das erste mal!)<br />
Was mach ich denn falsch, dass das bei mir nicht klappt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/667913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667913</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Tue, 07 Dec 2004 11:55:31 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 12:07:29 GMT]]></title><description><![CDATA[<p>Ich krieg die Krise!</p>
<p>Ich habe das bisher ja so gehabt, dass ich mit dem einen Button das Programm starte, und mit dem 2. Button die Funktion TextSend() aufrufe.<br />
In der TextSend() erhalte ich dann ständig NULL.<br />
Ich habe jetzt den Aufruf</p>
<pre><code class="language-cpp">Edit3-&gt;Text = TextSend(hTest,&amp;sProcessInfo,Edit3-&gt;Text);
</code></pre>
<p>mit in die Button1Click() reingepackt, direkt nach Ausführung von Executeprocess().</p>
<p>Und siehe da, es funktioniert!</p>
<p>Problem: Das hilft mir nix, da ich ja auch zu späteren Zeitpunkten auf das andere Prog zugreifen will.<br />
Der Versuch, das andere Prog vorher in den Vordergrund zu holen klappt mit etForegroundWindow(hWin) bzw. etForegroundWindow(sProcessInfo-&gt;dwThreadId) auch nicht, das liefert immer false zurück!</p>
<p>BITTE HELFT MIR!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/667925</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667925</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Tue, 07 Dec 2004 12:07:29 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 12:52:38 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> welche buttons buttons du wie klickst wussteste ich natürlich nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>el Clio schrieb:</p>
<blockquote>
<p>Problem: Das hilft mir nix, da ich ja auch zu späteren Zeitpunkten auf das andere Prog zugreifen will.</p>
</blockquote>
<p>was meinst du damit?<br />
ich hab es so verstanden das wenn deine app den focus wieder hat soll sie an den prozess den sie gestartet hat an das letzte aktive control eine nachricht schicken. richtig?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/667949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/667949</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Tue, 07 Dec 2004 12:52:38 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 14:19:17 GMT]]></title><description><![CDATA[<p>miller_m schrieb:</p>
<blockquote>
<p>was meinst du damit?<br />
ich hab es so verstanden das wenn deine app den focus wieder hat soll sie an den prozess den sie gestartet hat an das letzte aktive control eine nachricht schicken. richtig?</p>
</blockquote>
<p>Fast! Ich will das Prog starten und irgendwann - wann auch immer der Benutzer will - div. Nachrichten (u.A. auch Text) an die andere Anwendung schicken.<br />
Das soll solange möglich sein, bis meine oder die andere Anwendung geschlossen werden. Zwischendurch sollen beide Progs beliebig genutzt werden können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/668050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/668050</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Tue, 07 Dec 2004 14:19:17 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 14:35:01 GMT]]></title><description><![CDATA[<p>wenn deine app aktiviert wird, müsstest du dir die handles holen und bei einem click auf einen &quot;aktionsbutton&quot; dann die aktion mit dem gespeicherten handle ausführen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/668067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/668067</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Tue, 07 Dec 2004 14:35:01 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 14:37:10 GMT]]></title><description><![CDATA[<p>miller_m schrieb:</p>
<blockquote>
<p>wenn deine app aktiviert wird, müsstest du dir die handles holen und bei einem click auf einen &quot;aktionsbutton&quot; dann die aktion mit dem gespeicherten handle ausführen.</p>
</blockquote>
<p>Ich dachte eigentlich, dass ich genau das tue. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/668070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/668070</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Tue, 07 Dec 2004 14:37:10 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 14:41:44 GMT]]></title><description><![CDATA[<p>und wo ist dann dein problem? oder ist jetzt alles ok?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/668074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/668074</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Tue, 07 Dec 2004 14:41:44 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und dann Handle vom Fokus-Element? on Tue, 07 Dec 2004 14:51:36 GMT]]></title><description><![CDATA[<p>Das Problem ist folgendes:</p>
<p>Ich starte mit CreateProcess ein anderes Programm.<br />
Wenn ich direkt danach, also in der gleichen &quot;Button-Funktion&quot; GetGUIThreadInfo(sProcessInfo-&gt;dwThreadId, &amp;lpgui) aufrufe bekomme ich in lpgui ein handle auf das &quot;Fenster&quot; mit dem Fokus.<br />
Soweit so gut, so solls auch sein!</p>
<p>Wenn ich nach dem CreateProcess (ich speicher mir natürlich alle Strukturen und Handles) erst noch was anderes mit meiner anwendung mache und dann, zu einem späteren Zeitpunkt GetGUIThreadInfo(sProcessInfo-&gt;dwThreadId, &amp;lpgui) aufrufe, dann ist in lpgui alles NULL ausser cbSize.<br />
Also ist auch der Handle vom Fokus-Fenster NULL und ich kann nicht mehr das machen, was ich will.</p>
<p>Ich brauche also mal dringend nen Tip, wie ich zu nem späteren Zeitpunkt ein handle auf das element mit dem fokus kriege.</p>
<p>Mag auch sein, dass ich nen Denkfehler drinhab oder so...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/668087</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/668087</guid><dc:creator><![CDATA[el Clio]]></dc:creator><pubDate>Tue, 07 Dec 2004 14:51:36 GMT</pubDate></item></channel></rss>