From 9e8da84fff2f4e11bb9182bbd1b727e525ff0d30 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 29 Sep 2014 18:51:27 +0000 Subject: Tox: fixed crash on closing tox profile import window git-svn-id: http://svn.miranda-ng.org/main/trunk@10635 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_profile.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 168e998d8c..1ad015dee3 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -124,7 +124,11 @@ INT_PTR CToxProto::ToxProfileManagerProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP return TRUE; case WM_CLOSE: - EndDialog(hwnd, 0); + { + std::tstring defaultProfilePath = proto->GetToxProfilePath(); + fclose(_wfopen(defaultProfilePath.c_str(), _T("w"))); + EndDialog(hwnd, 0); + } break; case WM_DESTROY: @@ -134,6 +138,14 @@ INT_PTR CToxProto::ToxProfileManagerProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP case WM_COMMAND: switch (LOWORD(wParam)) { + case IDC_PROFILE_PATH: + if ((HWND)lParam == GetFocus()) + { + if (HIWORD(wParam) != EN_CHANGE) return 0; + EnableWindow(GetDlgItem(hwnd, IDOK), TRUE); + } + break; + case IDC_BROWSE_PROFILE: { TCHAR filter[MAX_PATH] = { 0 }; -- cgit v1.2.3