<?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[speichern unter...]]></title><description><![CDATA[<p>Hi.<br />
Ich hab von WinAPI egtl keine Ahnung muss aber dennoch ein Programm proggen, in dem man den Speichern Dialog aufruft. Nun weiß ich nicht wie da der Befehl zu lautet</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/153683/speichern-unter</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Apr 2026 05:33:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/153683.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Jul 2006 16:34:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to speichern unter... on Wed, 19 Jul 2006 16:34:41 GMT]]></title><description><![CDATA[<p>Hi.<br />
Ich hab von WinAPI egtl keine Ahnung muss aber dennoch ein Programm proggen, in dem man den Speichern Dialog aufruft. Nun weiß ich nicht wie da der Befehl zu lautet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1100531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1100531</guid><dc:creator><![CDATA[Fredi]]></dc:creator><pubDate>Wed, 19 Jul 2006 16:34:41 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Wed, 19 Jul 2006 17:08:54 GMT]]></title><description><![CDATA[<p>Fredi schrieb:</p>
<blockquote>
<p>Hi.<br />
Ich hab von WinAPI egtl keine Ahnung muss aber dennoch ein Programm proggen, in dem man den Speichern Dialog aufruft. Nun weiß ich nicht wie da der Befehl zu lautet</p>
</blockquote>
<p>LoL, wer gibt denn solche Aufgaben ? <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>Also du brauchst die Struktur OPENFILENAME (<a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary/commondialogboxreference/commondialogboxstructures/openfilename.asp" rel="nofollow">MSDN-LINK</a>) und die Funktion GetSaveFileName() (<a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary/commondialogboxreference/commondialogboxfunctions/getsavefilename.asp?frame=true" rel="nofollow">MSDN-LINK</a>)</p>
<p><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/1100545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1100545</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 19 Jul 2006 17:08:54 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Wed, 19 Jul 2006 21:23:07 GMT]]></title><description><![CDATA[<p>Ich weiß zwar nicht ob man das darf so einen Link zu posten, aber ich tue das jetzt erstmal:</p>
<p>[url]<br />
<a href="http://www.winapi.net/index.php?inhalt=s26" rel="nofollow">http://www.winapi.net/index.php?inhalt=s26</a><br />
[/url]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1100664</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1100664</guid><dc:creator><![CDATA[-=Chris=-]]></dc:creator><pubDate>Wed, 19 Jul 2006 21:23:07 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Wed, 19 Jul 2006 21:50:22 GMT]]></title><description><![CDATA[<p>-=Chris=- schrieb:</p>
<blockquote>
<p>Ich weiß zwar nicht ob man das darf so einen Link zu posten, aber ich tue das jetzt erstmal:</p>
<p>[url]<br />
<a href="http://www.winapi.net/index.php?inhalt=s26" rel="nofollow">http://www.winapi.net/index.php?inhalt=s26</a><br />
[/url]</p>
</blockquote>
<p>Du darfst. <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/1100675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1100675</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 19 Jul 2006 21:50:22 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Thu, 20 Jul 2006 13:28:11 GMT]]></title><description><![CDATA[<p>Wenn ich das so einbaue erhalte ich aber 2 Linkerfehler:</p>
<pre><code>error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;int __cdecl PopFileSaveDlg(struct HWND__ *,char *,wchar_t *)&quot; (?PopFileSaveDlg@@YAHPAUHWND__@@PADPA_W@Z)&quot; in Funktion &quot;&quot;long __stdcall WindowProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WindowProc@@YGJPAUHWND__@@IIJ@Z)&quot;.

 fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
</code></pre>
<p>Wes passt da nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1101253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1101253</guid><dc:creator><![CDATA[Fredi]]></dc:creator><pubDate>Thu, 20 Jul 2006 13:28:11 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Thu, 20 Jul 2006 14:16:06 GMT]]></title><description><![CDATA[<p>Zeig mal dein Quellcode. Hast du das wirklich alles so rauskopiert? Und hast du die beiden Zeilen</p>
<pre><code>// Funktionsprototypen
void PopFileInitialize (HWND);
BOOL PopFileSaveDlg (HWND , PTSTR , PTSTR);
</code></pre>
<p>Auch in ner Header-Datei reingepackt oder ganz oben in deiner .c/.cpp datei geschrieben?</p>
<p>MfG schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1101285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1101285</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Thu, 20 Jul 2006 14:16:06 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Thu, 20 Jul 2006 16:39:17 GMT]]></title><description><![CDATA[<p>Ich hab es ohne Header gemacht</p>
<pre><code class="language-cpp">#define UNICODE 
#include &lt;windows.h&gt;
#include &lt;commdlg.h&gt;

namespace fix
{
	const unsigned short IDM_NEW			= 0;	// Neue Datei 
    const unsigned short IDM_OPEN			= 1;	// Öffnen
	const unsigned short IDM_SAVE			= 2;	// Speichern
    const unsigned short IDM_SAVEAS			= 3;	// Speichern unter...
    const unsigned short IDM_QUIT			= 4;	// beenden
    const unsigned short IDM_UNDO			= 5;	// Rückgängig
	const unsigned short IDM_REDO			= 6;	// Wiederherstellen
	const unsigned short IDM_CUT			= 7;	// Auschneiden
	const unsigned short IDM_COPY			= 8;	// Kopieren
	const unsigned short IDM_PASTE			= 9;	// Einfügen
	const unsigned short IDM_SELECTALL		= 10;	// Alles auswählen
	const unsigned short IDM_DESELECTALL	= 11;	// Alles abwählen
} 
// Funktionsprototypen
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ;
void PopFileInitialize(HWND);
BOOL PopFileSaveDlg(HWND , PTSTR , PTSTR);

// Globale Variablen
	WPARAM						wParam;
	::HWND						hWnd;
    ::WNDCLASS					wndcls; 
    ::MSG						msg; 
	HMENU						hMenu_			= CreateMenu(); 
    HMENU						hMenuTemp		= CreateMenu(); 
	HMENU						hMenuObject		= CreateMenu();
	HMENU						hMenuTemp2		= CreateMenu();
	static						OPENFILENAME ofn;
	char						lpstrDateiname[MAX_PATH+2];
	HANDLE						hFile;

int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow) 
{ 
// -- Obermenü -- 
    // Das Dateinemü 
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_NEW, L&quot;&amp;Neu\tStrg + N&quot;); 
    AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_OPEN, L&quot;&amp;Öffnen ...\tStrg + 0&quot;); 
    AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_SAVE, L&quot;&amp;Speichern\tStrg + S&quot;); 
    AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_SAVEAS, L&quot;&amp;Speichern unter ...&quot;); 
    AppendMenuW(hMenuTemp, MF_SEPARATOR, 0, NULL); 
    AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_QUIT, L&quot;&amp;Beenden\tStrg + Q&quot;); 
    AppendMenu(hMenu_, MF_POPUP, (UINT_PTR)hMenuTemp, L&quot;&amp;Datei&quot;); 
	hMenuTemp = CreateMenu();

	// Das Bearbeitenmenü
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_UNDO, L&quot;&amp;Rückgängig\tStr + Z&quot;);
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_REDO, L&quot;&amp;Wiederherstellen\tStr + Y&quot;);
	AppendMenuW(hMenuTemp, MF_SEPARATOR, 0, NULL); 
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_CUT, L&quot;&amp;Ausschneiden\tStr + X&quot;);
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_COPY, L&quot;&amp;Kopieren\tStr + C&quot;);
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_PASTE, L&quot;&amp;Einfügen\tStr + V&quot;);
	AppendMenuW(hMenuTemp, MF_SEPARATOR, 0, NULL); 
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_SELECTALL, L&quot;&amp;Alles auswählen\tStr + A&quot;);
	AppendMenuW(hMenuTemp, MF_STRING, fix::IDM_DESELECTALL, L&quot;&amp;Alles auswählen\tStr + Shift + A&quot;);
	AppendMenu(hMenu_, MF_POPUP, (UINT_PTR)hMenuTemp, L&quot;&amp;Bearbeiten&quot;);

	hMenuTemp = CreateMenu();
	wndcls.cbClsExtra = 0; 
    wndcls.cbWndExtra = 0; 
    wndcls.hbrBackground = static_cast&lt;HBRUSH&gt;(::GetStockObject((int)WHITE_BRUSH)); 
    wndcls.hCursor = NULL; 
    wndcls.hIcon = NULL; 
    wndcls.hInstance = hInstance; 
    wndcls.lpfnWndProc = WindowProc; 
    wndcls.lpszClassName = L&quot;app&quot;; 
    wndcls.lpszMenuName = NULL;  // &lt;= Menu rein 
    wndcls.style = CS_HREDRAW | CS_VREDRAW; 

    if(!::RegisterClassW(&amp;wndcls)) 
        return -1; 

    hWnd = ::CreateWindowW( L&quot;app&quot;, L&quot;Level-Editor&quot; , WS_OVERLAPPEDWINDOW, 0, 0, 1280, 783, ::GetDesktopWindow(), hMenu_, hInstance, NULL); 

    if(!hWnd) 
        return -1; 
	WORD wNotifityCode;
	WORD wId=1;

    ::ShowWindow(hWnd, nCmdShow); 
    ::UpdateWindow(hWnd); 

    while(::GetMessageW(&amp;msg, NULL, NULL, NULL)) 
    { 
        ::TranslateMessage(&amp;msg); 
        ::DispatchMessageW(&amp;msg); 
    } 
    return 0; 
} 

LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 
{ 
    switch(uMsg) 
    { 
    case WM_CLOSE: 
        PostQuitMessage(0); 
        return 0; 
	case WM_COMMAND: 
		if(LOWORD(wParam) == fix::IDM_NEW) // Neue Datei
		{ 
			MessageBox(hWnd, L&quot;Sie haben auf Neu gedrückt gedrückt!&quot;, L&quot;Neu&quot;, MB_OK); 
			break;
		}
		if(LOWORD(wParam) == fix::IDM_OPEN) // Datei öffnen
		{ 
			MessageBox(hWnd, L&quot;Sie haben auf Öffnen gedrückt!&quot;, L&quot;Öffnen&quot;, MB_OK); 
			break;
		}
		if(LOWORD(wParam) == fix::IDM_SAVE) // speichern
		{ 
			PopFileInitialize (hwnd); // Initialisierung
			PopFileSaveDlg (hwnd, lpstrDateiname, NULL); // Systemdialog anzeigen
			// Keine best. Datei ersetzen!
			hFile = CreateFile(ofn.lpstrFile ,GENERIC_WRITE, 0, (LPSECURITY_ATTRIBUTES) NULL,
             CREATE_NEW, FILE_ATTRIBUTE_NORMAL,(HANDLE) NULL); 
			// ..
			// Datei speichern
			// ..
			CloseHandle(hFile);
			break;
		}
		if(LOWORD(wParam) == fix::IDM_QUIT) // Beenden
		{
			DestroyWindow(hWnd);
			return -1;
			break;
		}
    }; 
    return ::DefWindowProcW(hwnd, uMsg, wParam, lParam); 
} 

void PopFileInitialize (HWND hwnd)
{
// welche Dateitypen sollen gespeichert werden können
   static TCHAR szFilter[] = TEXT (&quot;Textdateien (*.TXT)\0*.txt\0&quot;) \
   TEXT (&quot;ASCII-Dateien (*.ASC)\0*.asc\0&quot;) \
   TEXT (&quot;Alle Dateien (*.*)\0*.*\0\0&quot;);

   ZeroMemory(&amp;ofn, sizeof(OPENFILENAME));
   ofn.lStructSize = sizeof (OPENFILENAME);
   ofn.hwndOwner = hwnd;
   ofn.hInstance = NULL;
   ofn.lpstrFilter = szFilter;
   ofn.lpstrCustomFilter = NULL;
   ofn.nMaxCustFilter = 0;
   ofn.nFilterIndex = 0;
   ofn.lpstrFile = NULL; // Bei Öffnen bzw. Schließen gesetzt
   ofn.nMaxFile = MAX_PATH;
   ofn.lpstrFileTitle = NULL; // Bei Öffnen bzw. Schließen gesetzt
   ofn.nMaxFileTitle = MAX_PATH;
   ofn.lpstrInitialDir = NULL;
   ofn.lpstrTitle = NULL;
   ofn.Flags = 0; // Bei Öffnen bzw. Schließen gesetzt
   ofn.nFileOffset = 0;
   ofn.nFileExtension = 0;
   ofn.lpstrDefExt = TEXT (&quot;txt&quot;);
   ofn.lCustData = 0L;
   ofn.lpfnHook = NULL;
   ofn.lpTemplateName = NULL;
}

// Den &quot;Speichern unter&quot; Dialog anzeigen und das Handle zum File zurückliefern
BOOL PopFileSaveDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName)
{
   ofn.hwndOwner = hwnd;
   ofn.lpstrFile = pstrFileName;
   ofn.lpstrFileTitle = pstrTitleName;
   ofn.Flags = OFN_HIDEREADONLY | OFN_CREATEPROMPT;

   return GetSaveFileName (&amp;ofn);
}
</code></pre>
<p>Aber da krieg ich noch einen Fehler</p>
<pre><code>error C2664: 'PopFileSaveDlg': Konvertierung des Parameters 2 von 'char [262]' in 'PTSTR' nicht möglich
        Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1101379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1101379</guid><dc:creator><![CDATA[Fredi]]></dc:creator><pubDate>Thu, 20 Jul 2006 16:39:17 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Thu, 20 Jul 2006 17:14:40 GMT]]></title><description><![CDATA[<p>Glaube du vermischt hier UNICODE und ANSI:</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>PTSTR: A PWSTR ifUNICODE is defined, a PSTR otherwise.</p>
</blockquote>
<p>Versuch man PTCHAR anstatt char*<br />
und TCHAR anstatt char</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1101398</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1101398</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 20 Jul 2006 17:14:40 GMT</pubDate></item><item><title><![CDATA[Reply to speichern unter... on Thu, 20 Jul 2006 18:01:30 GMT]]></title><description><![CDATA[<p>Es klappt super 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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1101422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1101422</guid><dc:creator><![CDATA[Fredi]]></dc:creator><pubDate>Thu, 20 Jul 2006 18:01:30 GMT</pubDate></item></channel></rss>