Navigation
Artikel
Stuff
RSS Feeds
|
Sourcecodes - Speichern/Laden DialogSprachenübersicht/C / C++/ C#/Daten & Ordner Keywords: Dialog, Speichern, Laden, C++ Dieser sc öffnet einen Datei-Dialog:
Code: //Öffnet einen Lade-dialog bool LoadDialog(HWND hWnd,PTSTR FileName,PTSTR FileTitle) { OPENFILENAME ofn; //Für die Files memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hWnd; ofn.hInstance = NULL; ofn.lpstrFilter = TEXT("BDS-Level-Dateien (*.bdl)\0*.bdl\0"); ofn.lpstrCustomFilter = NULL; ofn.nMaxCustFilter = NULL; ofn.nFilterIndex = NULL; ofn.nMaxFile = 255; ofn.lpstrTitle = NULL; ofn.nMaxFileTitle = 255; ofn.lpstrInitialDir = NULL; ofn.nFileOffset = NULL; ofn.nFileExtension = NULL; ofn.lpstrDefExt = TEXT("lvl"); ofn.lCustData = NULL; ofn.lpfnHook = NULL; ofn.lpTemplateName = NULL; ofn.Flags = OFN_HIDEREADONLY|OFN_CREATEPROMPT; ofn.lpstrFile = FileName; ofn.lpstrFileTitle = FileTitle; bool Check = true; Check = GetOpenFileName(&ofn); return Check; } //Öffnet einen Speicher-dialog bool SaveDialog(HWND hWnd,PTSTR FileName,PTSTR FileTitle) { OPENFILENAME ofn;//Für die Files memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner =hWnd; ofn.hInstance =NULL; ofn.lpstrFilter =TEXT("DS-Level-Dateien (*.dsl)\0*.dsl\0"); ofn.lpstrCustomFilter =NULL; ofn.nMaxCustFilter =NULL; ofn.nFilterIndex =NULL; ofn.nMaxFile =255; ofn.lpstrTitle =NULL; ofn.nMaxFileTitle =255; ofn.lpstrInitialDir =NULL; ofn.nFileOffset =NULL; ofn.nFileExtension =NULL; ofn.lpstrDefExt =TEXT("lvl"); ofn.lCustData =NULL; ofn.lpfnHook =NULL; ofn.lpTemplateName =NULL; ofn.Flags =OFN_HIDEREADONLY|OFN_CREATEPROMPT; ofn.lpstrFile =FileName; ofn.lpstrFileTitle =FileTitle; bool Check = true; Check = GetSaveFileName(&ofn); return Check; } Gibt es noch irgendwelche Fragen, oder wollen Sie über den Artikel diskutieren? Sprachenübersicht/C / C++/ C#/Daten & Ordner/Speichern/Laden Dialog |