171{
173 {
174
175
177 return;
178 }
179
180
181
183 {
187
188
189 char editedValue[255];
190 SendMessage(
m_hwndEditor, WM_GETTEXT, 255, (LPARAM)&editedValue);
191 editedValue[sizeof(editedValue)-1] = '\0';
192
193
194
196 {
197
198 }
199 else
200 {
202 {
204 if (ptr1 != NULL)
205 {
208
210
211 strncpy_s(newTitle,
sizeof(newTitle),
m_pszTitleANSI, (
int)(ptr1-ptr0));
212 newTitle[(int)(ptr1-ptr0)] = '\0';
213 if (strlen(editedValue) > 0) strcat(newTitle, editedValue);
214 strcat(newTitle, ptr2);
215 newTitle[sizeof(newTitle)-1] = '\0';
216
217
218
221
224 MultiByteToWideChar(CP_UTF8, 0, newTitle, strlen(newTitle)+1, newTitleUnicode,
MAX_LINE_LENGTH);
226 }
227 }
228 else
229 {
230 if (strlen(editedValue) > 0)
231 {
234 if (ptr1 != NULL)
235 {
237
238 strncpy_s(newTitle,
sizeof(newTitle),
m_pszTitleANSI, (
int)(ptr1-ptr0)+1);
239 newTitle[(int)(ptr1-ptr0)+1] = '\0';
240 if (strlen(editedValue) > 0) strcat(newTitle, editedValue);
241 strcat(newTitle, ptr1+1);
242 newTitle[sizeof(newTitle)-1] = '\0';
243
244
245
248
251 MultiByteToWideChar(CP_UTF8, 0, newTitle, strlen(newTitle)+1, newTitleUnicode,
MAX_LINE_LENGTH);
253 }
254 }
255 }
256
259 }
260
261
263 m_pszInit = editedValue ? _strdup(editedValue) : _strdup(
"");
264
265
267 {
270 }
271
272
273
274
276
278 {
279
280
281 int nLen = strlen(editedValue);
282 memmove(editedValue+1, editedValue, strlen(editedValue));
283 editedValue[0] = editedValue[nLen+1] = '\"';
284 editedValue[nLen+2] = '\0';
285
286
287
288
289 }
290
292
294
295
296
297
299 SetWindowPos(
m_pParent->GetWindow(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
300
301
305 }
306
307
308
309 else
310 {
311
313 {
314
318 SetWindowPos(
m_pParent->GetWindow(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
320 }
322 {
323
325 si->DestroyEditWindow();
326 si->editboxActive = false;
329 SetWindowPos(
m_pParent->GetWindow(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
330 }
331
332
336 }
337}
bool IsInString(LPCSTR inputString, LPCSTR searchString)
Definition BBApi.cpp:2519
HWND GetBBWnd()
Definition BBApi.cpp:128
#define BB_BROADCAST
Definition BBApi.h:245
#define MAX_LINE_LENGTH
Definition BBApi.h:64
MenuItem * menuEditboxStringItemPtr
Definition Settings.h:389
StringItem(char *pszTitleANSI, wchar_t *pszTitleUnicode, char *pszCommand, char *pszInit, bool isSelected)
Definition StringItem.cpp:45
void CreateEditWindow()
Definition StringItem.cpp:73