<?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[CreateWindowEx aus dll]]></title><description><![CDATA[<p>hi<br />
ich versuche einen fenster aus ner dll zu öffnen</p>
<pre><code class="language-cpp">void createW(void* pParams){

	const char g_szClassName [] = &quot;My Window Class&quot;;
	HINSTANCE hThisInstance = GetModuleHandle(NULL);

    HWND hwnd;               /* This is the handle for our window */
    MSG messages;            /* Here messages to the application are saved */
    WNDCLASSEX wincl;        /* Data structure for the windowclass */

    /* The Window structure */
    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = (LPCWSTR)g_szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
    wincl.cbSize = sizeof (WNDCLASSEX);

    /* Use default icon and mouse-pointer */
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = NULL;                 /* No menu */
    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
    wincl.cbWndExtra = 0;                      /* structure or the window instance */
    /* Use Windows's default color as the background of the window */
    wincl.hbrBackground = (HBRUSH)COLOR_BACKGROUND;

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClassEx (&amp;wincl))
	{
		MessageBoxA(NULL , &quot;Failed to register window class&quot; ,
                        &quot;Error&quot; , MB_ICONEXCLAMATION | MB_OK );
 	        return;

	}

    /* The class is registered, let's create the program*/
    hwnd = CreateWindowExA (
           0,                   /* Extended possibilites for variation */
           g_szClassName,         /* Classname */
           &quot;MyWindow&quot;,       /* Title Text */
           WS_POPUP| WS_BORDER, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           420,                 /* The programs width */
           250,                 /* and height in pixels */
           HWND_DESKTOP,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           hThisInstance,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (hwnd, SW_SHOW);

    /* Run the message loop. It will run until GetMessage() returns 0 */
    while (GetMessage (&amp;messages, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&amp;messages);
        /* Send message to WindowProcedure */
        DispatchMessage(&amp;messages);
    }

}
</code></pre>
<p>mein Fenster wird jedoch nicht angezeigt.<br />
wo is der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/212978/createwindowex-aus-dll</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 07:25:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/212978.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 May 2008 22:26:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateWindowEx aus dll on Mon, 12 May 2008 22:26:15 GMT]]></title><description><![CDATA[<p>hi<br />
ich versuche einen fenster aus ner dll zu öffnen</p>
<pre><code class="language-cpp">void createW(void* pParams){

	const char g_szClassName [] = &quot;My Window Class&quot;;
	HINSTANCE hThisInstance = GetModuleHandle(NULL);

    HWND hwnd;               /* This is the handle for our window */
    MSG messages;            /* Here messages to the application are saved */
    WNDCLASSEX wincl;        /* Data structure for the windowclass */

    /* The Window structure */
    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = (LPCWSTR)g_szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
    wincl.cbSize = sizeof (WNDCLASSEX);

    /* Use default icon and mouse-pointer */
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = NULL;                 /* No menu */
    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
    wincl.cbWndExtra = 0;                      /* structure or the window instance */
    /* Use Windows's default color as the background of the window */
    wincl.hbrBackground = (HBRUSH)COLOR_BACKGROUND;

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClassEx (&amp;wincl))
	{
		MessageBoxA(NULL , &quot;Failed to register window class&quot; ,
                        &quot;Error&quot; , MB_ICONEXCLAMATION | MB_OK );
 	        return;

	}

    /* The class is registered, let's create the program*/
    hwnd = CreateWindowExA (
           0,                   /* Extended possibilites for variation */
           g_szClassName,         /* Classname */
           &quot;MyWindow&quot;,       /* Title Text */
           WS_POPUP| WS_BORDER, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           420,                 /* The programs width */
           250,                 /* and height in pixels */
           HWND_DESKTOP,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           hThisInstance,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (hwnd, SW_SHOW);

    /* Run the message loop. It will run until GetMessage() returns 0 */
    while (GetMessage (&amp;messages, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&amp;messages);
        /* Send message to WindowProcedure */
        DispatchMessage(&amp;messages);
    }

}
</code></pre>
<p>mein Fenster wird jedoch nicht angezeigt.<br />
wo is der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507790</guid><dc:creator><![CDATA[CantStOp]]></dc:creator><pubDate>Mon, 12 May 2008 22:26:15 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Tue, 13 May 2008 07:40:24 GMT]]></title><description><![CDATA[<p>Meines Erachtens nach, hat HWND_DESKTOP nichts bei CreateWindow zu suchen!</p>
<p>Was sagt den Spy++?<br />
Wird das Fensterwirklcih erzeugt? Du hast keinen Code der darauf reagiert, wenn das Fenster nicht erzeugt werden kann.</p>
<p>HINSTANCE sollte Deine DLL Istanz sein, die Du mit dem DllMain Aufruf erhälst. Nicht GetModuleHandle(NULL), spirch das HINSTANCE der Applikation.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1507888</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1507888</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 13 May 2008 07:40:24 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Tue, 13 May 2008 10:45:57 GMT]]></title><description><![CDATA[<p>Eine DLL wird durch die Einbindung (erfolgt mit dem 1. Aufruf einer DLL-Funktion) Teil der Anwendung. Also: in der Anwendung hInstance etc. als globale Grössen festhalten, dann dort benutzen wie gehabt. Mache eine DLL-Funktion InitMyApplication() oder so und installiere dort den Aufruf des gewünschten Fensters. DllMain() kann dann leer bleiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508000</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Tue, 13 May 2008 10:45:57 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Tue, 13 May 2008 11:51:10 GMT]]></title><description><![CDATA[<p>berniebutt schrieb:</p>
<blockquote>
<p>Eine DLL wird durch die Einbindung (erfolgt mit dem 1. Aufruf einer DLL-Funktion) Teil der Anwendung.</p>
</blockquote>
<p>nö</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508053</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508053</guid><dc:creator><![CDATA[haterskater]]></dc:creator><pubDate>Tue, 13 May 2008 11:51:10 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Tue, 13 May 2008 12:16:45 GMT]]></title><description><![CDATA[<p>berniebutt schrieb:</p>
<blockquote>
<p>Eine DLL wird durch die Einbindung (erfolgt mit dem 1. Aufruf einer DLL-Funktion) Teil der Anwendung. Also: in der Anwendung hInstance etc. als globale Grössen festhalten, dann dort benutzen wie gehabt. Mache eine DLL-Funktion InitMyApplication() oder so und installiere dort den Aufruf des gewünschten Fensters. DllMain() kann dann leer bleiben.</p>
</blockquote>
<p>Du weist offensichtlich nicht wie RegisterClass funktioniert...<br />
<a href="http://blog.m-ri.de/index.php/2007/12/12/die-unsitte-immer-getmodulehandlenull-fuer-hinstance-in-createwindow-und-registerclass-zu-verwenden/" rel="nofollow">http://blog.m-ri.de/index.php/2007/12/12/die-unsitte-immer-getmodulehandlenull-fuer-hinstance-in-createwindow-und-registerclass-zu-verwenden/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508073</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508073</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 13 May 2008 12:16:45 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Tue, 13 May 2008 12:32:38 GMT]]></title><description><![CDATA[<p>auch wenn ich HINSTANCE von meiner dll benutze, passiert nichts<br />
und HWND_DESKTOP hat bei mir immer funktioniert<br />
<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/1508085</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508085</guid><dc:creator><![CDATA[CantStOp]]></dc:creator><pubDate>Tue, 13 May 2008 12:32:38 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Tue, 13 May 2008 15:47:56 GMT]]></title><description><![CDATA[<p>Wird ein HWND returniert? Was sagt GetLastError?<br />
Wo wird die DLL geladen? In einen Service?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1508246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1508246</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 13 May 2008 15:47:56 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Thu, 15 May 2008 06:49:57 GMT]]></title><description><![CDATA[<p>Entschuldigung, habe mich schlecht oder unvollständig ausgesdrückt. &quot;Global&quot; soll heissen &quot;für alle Prozesse / Instanzen global&quot; (ref. Petzold). Geht leider nicht mit allen Compilern. Was immer geht, ist der Austausch zwischen Applikation und DLL-Funktionen über die Parameterliste. Habe das im Sinne der Frage ausprobiert, es geht einwandfrei!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509330</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Thu, 15 May 2008 06:49:57 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindowEx aus dll on Sat, 09 Aug 2008 10:38:15 GMT]]></title><description><![CDATA[<p>Guten Tag,<br />
es tut mir leid wenn ich den alten beitrag nochmal raushole.<br />
Doch ich verzweifle langsam. Ich kriege einfach kein Fenster per DLL Inject hin, egal ob mit Hooked funktion oder originalen. mainhWnd bleibt immer 0</p>
<pre><code class="language-cpp">void InitAll(HINSTANCE myInstance)
{
    WNDCLASS wc={0};
	wc.style=CS_HREDRAW|CS_VREDRAW|CS_OWNDC;
	wc.lpfnWndProc=WndProc;
	wc.hInstance=myInstance;
	wc.lpszClassName=(LPCWSTR)CLASS_NAME;

	wc.hCursor=(HCURSOR)LoadCursor(wc.hInstance,IDC_ARROW );
	wc.hbrBackground=0;//(HBRUSH)GetStockObject(BLACK_BRUSH);
	if(!RegisterClass( &amp;wc ))
	{
		MessageBoxA(NULL,&quot;Fehler 1&quot;,&quot;&quot;,MB_OK);
		return;
	}
	mainhWnd=CreateWindowEx_o(
			0,
			TEXT(&quot;Philip&quot;), // rest are same old.
			TEXT(&quot;OOOOOOOOOOOOOOOOH!!! GHOSTLY WINDOW!!&quot;),
			WS_POPUP| WS_BORDER | WS_VISIBLE,
			10, 10,
			400, 400,
			HWND_DESKTOP, NULL,
			wc.hInstance, NULL );
	if(!mainhWnd)
	{
		MessageBoxA(NULL,&quot;Fehler 2&quot;,&quot;&quot;,MB_OK);
		return;
	}

    ShowWindow(mainhWnd, SW_SHOWDEFAULT);
    UpdateWindow(mainhWnd);

}
</code></pre>
<pre><code class="language-cpp">DWORD WINAPI ThreadRender( LPVOID lpParam ) 
{ 
	InitAll((HINSTANCE)lpParam);
</code></pre>
<pre><code class="language-cpp">hThread=CreateThread(NULL,0,ThreadRender,(HINSTANCE)hInstance,0,NULL);
</code></pre>
<p>ich Hoffe jemand weiss eine lösung, denn ich arbeite schon seit mehreren Tagen daran und Google liefert auch nichts (Durch google bin ich hier gelandet)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1561781</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1561781</guid><dc:creator><![CDATA[newgamor]]></dc:creator><pubDate>Sat, 09 Aug 2008 10:38:15 GMT</pubDate></item></channel></rss>