Skip to content

Commit

Permalink
Ask user for file to export lib to
Browse files Browse the repository at this point in the history
  • Loading branch information
ffes committed May 15, 2015
1 parent ef022ad commit 77778b1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions DlgConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,26 @@ static void OnLibraryImport(HWND hWnd)

static void OnLibraryExport(HWND hWnd)
{
UNREFERENCED_PARAMETER(hWnd);

// We need space to store the filename
WCHAR szFileName[MAX_PATH];
ZeroMemory(szFileName, MAX_PATH);

// Initialize the FileSave dialog
OPENFILENAME ofn;
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = g_nppData._nppHandle;
ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
ofn.lpstrFilter = L"SQLite databases (*.sqlite)\0*.sqlite\0All Files (*.*)\0*.*\0\0";
ofn.nMaxFile = _MAX_PATH;
ofn.lpstrFile = szFileName;
ofn.lpstrDefExt = L"sqlite";

// Did we get a filename from the user?
if (GetSaveFileName(&ofn))
s_curLibrary->ExportTo(ofn.lpstrFile);
}

/////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 77778b1

Please sign in to comment.