33#include " PromptDialog.h"
44#include " resource.h"
55#include " Notepad_Plus_msgs.h"
6+ #include " WcharMbcsConverter.h"
67
78PromptDialog::PromptDialog (HINSTANCE hInst, HWND hNotepad)
89 : m_hInst(hInst),
@@ -62,9 +63,9 @@ INT_PTR CALLBACK PromptDialog::runDlgProc(HWND hWnd, UINT message, WPARAM wParam
6263 {
6364 SendMessage (m_hNotepad, NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast <LPARAM>(hWnd));
6465 m_hSelf = hWnd;
65- ::SetWindowTextA (::GetDlgItem(m_hSelf, IDC_PROMPT), m_prompt.c_str());
66- ::SetWindowTextA (m_hSelf, m_title.c_str());
67- ::SetWindowTextA (::GetDlgItem(m_hSelf, IDC_USERTEXT), m_initial.c_str());
66+ ::SetWindowText (::GetDlgItem(m_hSelf, IDC_PROMPT), WcharMbcsConverter::char2tchar( m_prompt.c_str()).get ());
67+ ::SetWindowText (m_hSelf, WcharMbcsConverter::char2tchar( m_title.c_str()).get ());
68+ ::SetWindowText (::GetDlgItem(m_hSelf, IDC_USERTEXT), WcharMbcsConverter::char2tchar( m_initial.c_str()).get ());
6869 ::SendMessage (::GetDlgItem(m_hSelf, IDC_USERTEXT), EM_SETSEL, 0, -1);
6970 SetFocus (::GetDlgItem (m_hSelf, IDC_USERTEXT));
7071
@@ -90,9 +91,9 @@ INT_PTR CALLBACK PromptDialog::runDlgProc(HWND hWnd, UINT message, WPARAM wParam
9091 {
9192 case IDOK:
9293 {
93- char buffer[1000 ];
94- ::GetWindowTextA (::GetDlgItem(m_hSelf, IDC_USERTEXT), buffer, 1000);
95- m_value = buffer;
94+ TCHAR buffer[1000 ];
95+ ::GetWindowText (::GetDlgItem(m_hSelf, IDC_USERTEXT), buffer, 1000);
96+ m_value = WcharMbcsConverter::tchar2char ( buffer). get () ;
9697 m_result = RESULT_OK;
9798 }
9899 // lint -fallthrough
0 commit comments