<?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[ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle)]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich hab jetzt schon einige Zeit gegoogelt und die doku durchgeforstet, allerdings komme ich zu keinem Ergebnis. Ein ProcessHandle mit Windownamen zu bekommen ist nicht das Problem</p>
<pre><code class="language-cpp">HWND hWnd;
    DWORD threadid;
    HANDLE hPrc;

    hWnd = FindWindowA(NULL, &quot;Zielprogramm&quot;);

    threadid = GetWindowThreadProcessId(hWnd, NULL);    

    hPrc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, threadid);
        // hier der code
    CloseHandle(hPrc);
</code></pre>
<p>Aber über den Prozessnamen schon <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Hab selbstverständlich <a href="http://www.codeproject.com/threads/getprocessid.asp?df=100&amp;forumid=4487&amp;exp=0&amp;select=1507518" rel="nofollow">http://www.codeproject.com/threads/getprocessid.asp?df=100&amp;forumid=4487&amp;exp=0&amp;select=1507518</a> das hier gefunden, aber weiterbringen tut mich das nicht unbedingt, weil ich diese 2 Zeilen:<br />
std::vector&lt;DWORD&gt; SetOfPID;<br />
GetProcessID(&quot;Rundll32&quot;,SetOfPID);<br />
nicht verstehe.</p>
<p>Hm, hab mir zwar Mühe gegeben, aber ich brauch wirklich Hilfe <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/topic/194247/processid-eines-anderen-prozesses-über-prozessname-ermitteln-gt-processhandle</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 05:35:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/194247.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Oct 2007 14:07:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle) on Thu, 04 Oct 2007 14:07:35 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich hab jetzt schon einige Zeit gegoogelt und die doku durchgeforstet, allerdings komme ich zu keinem Ergebnis. Ein ProcessHandle mit Windownamen zu bekommen ist nicht das Problem</p>
<pre><code class="language-cpp">HWND hWnd;
    DWORD threadid;
    HANDLE hPrc;

    hWnd = FindWindowA(NULL, &quot;Zielprogramm&quot;);

    threadid = GetWindowThreadProcessId(hWnd, NULL);    

    hPrc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, threadid);
        // hier der code
    CloseHandle(hPrc);
</code></pre>
<p>Aber über den Prozessnamen schon <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Hab selbstverständlich <a href="http://www.codeproject.com/threads/getprocessid.asp?df=100&amp;forumid=4487&amp;exp=0&amp;select=1507518" rel="nofollow">http://www.codeproject.com/threads/getprocessid.asp?df=100&amp;forumid=4487&amp;exp=0&amp;select=1507518</a> das hier gefunden, aber weiterbringen tut mich das nicht unbedingt, weil ich diese 2 Zeilen:<br />
std::vector&lt;DWORD&gt; SetOfPID;<br />
GetProcessID(&quot;Rundll32&quot;,SetOfPID);<br />
nicht verstehe.</p>
<p>Hm, hab mir zwar Mühe gegeben, aber ich brauch wirklich Hilfe <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/1377935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377935</guid><dc:creator><![CDATA[chris2k6]]></dc:creator><pubDate>Thu, 04 Oct 2007 14:07:35 GMT</pubDate></item><item><title><![CDATA[Reply to ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle) on Thu, 04 Oct 2007 15:43:48 GMT]]></title><description><![CDATA[<p>chris2k6 schrieb:</p>
<blockquote>
<p>...allerdings komme ich zu keinem Ergebnis.</p>
</blockquote>
<p>Du würdest vermutlich im WinAPI-Forum Hilfe bekommen, das Thema hat aber nichts mit AnsiC++ zu tun, daher hier auch nichts verloren. Aber warte, der Thread wird mit Sicherheit von einem Aufmerksamen Forumsadmin verschoben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378023</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378023</guid><dc:creator><![CDATA[falschesForum]]></dc:creator><pubDate>Thu, 04 Oct 2007 15:43:48 GMT</pubDate></item><item><title><![CDATA[Reply to ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle) on Thu, 04 Oct 2007 19:24:59 GMT]]></title><description><![CDATA[<p>Das Problem ist, dass ich nie wirklich weiss wan API und wann normales C++ Forum ..</p>
<p>Wie dem auch sei:</p>
<p>Hab bin das mal angegangen..</p>
<pre><code class="language-cpp">HWND targetHWND=0;
  DWORD otherThread;
  HANDLE hProcess;

  //Ziel finden
  targetHWND=FindWindowA(NULL,&quot;sa&quot;);
  if(targetHWND==0) {MessageBoxA(0,&quot;Can't find...&quot;,&quot;OUCH&quot;,0);}

  otherThread = GetWindowThreadProcessId(targetHWND, NULL);

  cout &lt;&lt; otherThread &lt;&lt; &quot;\n&quot;;  

  hProcess = OpenProcess(PROCESS_VM_READ, FALSE, otherThread);

  DWORD error = GetLastError();

  cout &lt;&lt; &quot;\n&quot; &lt;&lt; error &lt;&lt; &quot;\n&quot;;

  CloseHandle(hProcess);
</code></pre>
<p>Der errorcode ist immer 87.<br />
ERROR_INVALID_PARAMETER<br />
87 The parameter is incorrect.</p>
<p>Obwohl ich keinen Fehler erkenne kann <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378079</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378079</guid><dc:creator><![CDATA[chris2k6]]></dc:creator><pubDate>Thu, 04 Oct 2007 19:24:59 GMT</pubDate></item><item><title><![CDATA[Reply to ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle) on Thu, 04 Oct 2007 19:28:15 GMT]]></title><description><![CDATA[<p>chris2k6 schrieb:</p>
<blockquote>
<p>Das Problem ist, dass ich nie wirklich weiss wan API und wann normales C++ Forum ..</p>
</blockquote>
<p>Das ist eigentlich ganz einfach:</p>
<p>Wenn es um die grundlegende Sprache geht (Sprich: Die Schlüsselworte von C++ wie z.B. int, if, return, template...) oder um die STL bist du hier richtig (ebenso auch für allgemeingültige C++ Bibliotheken die an kein Betriebssystem gebunden sind und kein eigenes Forum haben wie z.B. Boost und Loki). Ebenso wenn es sich um allgemeine, nicht Plattformspezifische Probleme handelt, wo du nicht weißt wie du sie umsetzen kannst.</p>
<p>Geht es wie hier aber um Plattformspezifisches Wissen (und HWND etc. deutet schon darauf hin), bist du im AnsiC++ Bereich falsch. Grundsätzlich kann man sagen alles wo es um GUI geht (es gibt in den Basisbibliotheken von C++ keine GUI außer die Konsole), und um Zugriffe auf Betriebssystemfunktionen sind die speziellen Unterforen richtig.</p>
<p>cu André</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378153</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Thu, 04 Oct 2007 19:28:15 GMT</pubDate></item><item><title><![CDATA[Reply to ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle) on Thu, 04 Oct 2007 19:35:56 GMT]]></title><description><![CDATA[<p>Ah danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> Also sobald ich windows.h includiere ab ins API Forum <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378159</guid><dc:creator><![CDATA[chris2k6]]></dc:creator><pubDate>Thu, 04 Oct 2007 19:35:56 GMT</pubDate></item><item><title><![CDATA[Reply to ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle) on Fri, 05 Oct 2007 10:23:15 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" 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/1378467</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378467</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 05 Oct 2007 10:23:15 GMT</pubDate></item><item><title><![CDATA[Reply to ProcessID eines anderen Prozesses über Prozessname ermitteln (-&amp;gt;ProcessHandle) on Fri, 05 Oct 2007 10:49:28 GMT]]></title><description><![CDATA[<p>OpenProcess () braucht eine ProcessID und keine ThreadID :</p>
<pre><code class="language-cpp">DWORD threadid, processid;
...
threadid = GetWindowThreadProcessId(targetHWND, &amp;processid);
...
hProcess = OpenProcess(PROCESS_VM_READ, FALSE, processid);
...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1378484</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378484</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 05 Oct 2007 10:49:28 GMT</pubDate></item></channel></rss>