@@ -27,10 +27,16 @@ int nssm_gui(int resource, nssm_service_t *service) {
27
27
/* Create window */
28
28
HWND dlg = dialog (MAKEINTRESOURCE (resource), 0 , nssm_dlg, (LPARAM) service);
29
29
if (! dlg) {
30
- popup_message (MB_OK, NSSM_GUI_CREATEDIALOG_FAILED, error_string (GetLastError ()));
30
+ popup_message (0 , MB_OK, NSSM_GUI_CREATEDIALOG_FAILED, error_string (GetLastError ()));
31
31
return 1 ;
32
32
}
33
33
34
+ /* Load the icon. */
35
+ HANDLE icon = LoadImage (GetModuleHandle (0 ), MAKEINTRESOURCE (IDI_NSSM), IMAGE_ICON, GetSystemMetrics (SM_CXSMICON), GetSystemMetrics (SM_CYSMICON), 0 );
36
+ if (icon) SendMessage (dlg, WM_SETICON, ICON_SMALL, (LPARAM) icon);
37
+ icon = LoadImage (GetModuleHandle (0 ), MAKEINTRESOURCE (IDI_NSSM), IMAGE_ICON, GetSystemMetrics (SM_CXICON), GetSystemMetrics (SM_CYICON), 0 );
38
+ if (icon) SendMessage (dlg, WM_SETICON, ICON_BIG, (LPARAM) icon);
39
+
34
40
/* Remember what the window is for. */
35
41
SetWindowLongPtr (dlg, GWLP_USERDATA, (LONG_PTR) resource);
36
42
@@ -129,8 +135,8 @@ int nssm_gui(int resource, nssm_service_t *service) {
129
135
if (! service->rotate_bytes_high ) SetDlgItemInt (tablist[NSSM_TAB_ROTATION], IDC_ROTATE_BYTES_LOW, service->rotate_bytes_low , 0 );
130
136
131
137
/* Check if advanced settings are in use. */
132
- if (service->stdout_disposition ^ service->stderr_disposition || service->stdout_disposition & ~CREATE_ALWAYS || service->stderr_disposition & ~CREATE_ALWAYS) popup_message (MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_STDIO);
133
- if (service->rotate_bytes_high ) popup_message (MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_ROTATE_BYTES);
138
+ if (service->stdout_disposition ^ service->stderr_disposition || service->stdout_disposition & ~CREATE_ALWAYS || service->stderr_disposition & ~CREATE_ALWAYS) popup_message (dlg, MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_STDIO);
139
+ if (service->rotate_bytes_high ) popup_message (dlg, MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_ROTATE_BYTES);
134
140
135
141
/* Environment tab. */
136
142
TCHAR *env;
@@ -149,14 +155,14 @@ int nssm_gui(int resource, nssm_service_t *service) {
149
155
TCHAR *formatted;
150
156
unsigned long newlen;
151
157
if (format_environment (env, envlen, &formatted, &newlen)) {
152
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" environment" ), _T (" nssm_dlg()" ));
158
+ popup_message (dlg, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" environment" ), _T (" nssm_dlg()" ));
153
159
}
154
160
else {
155
161
SetDlgItemText (tablist[NSSM_TAB_ENVIRONMENT], IDC_ENVIRONMENT, formatted);
156
162
HeapFree (GetProcessHeap (), 0 , formatted);
157
163
}
158
164
}
159
- if (service->envlen && service->env_extralen ) popup_message (MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_ENVIRONMENT);
165
+ if (service->envlen && service->env_extralen ) popup_message (dlg, MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_ENVIRONMENT);
160
166
}
161
167
162
168
/* Go! */
@@ -222,10 +228,10 @@ static inline void set_rotation_enabled(unsigned char enabled) {
222
228
EnableWindow (GetDlgItem (tablist[NSSM_TAB_ROTATION], IDC_ROTATE_BYTES_LOW), enabled);
223
229
}
224
230
225
- static inline void check_io (TCHAR *name, TCHAR *buffer, unsigned long len, unsigned long control) {
231
+ static inline void check_io (HWND owner, TCHAR *name, TCHAR *buffer, unsigned long len, unsigned long control) {
226
232
if (! SendMessage (GetDlgItem (tablist[NSSM_TAB_IO], control), WM_GETTEXTLENGTH, 0 , 0 )) return ;
227
233
if (GetDlgItemText (tablist[NSSM_TAB_IO], control, buffer, (int ) len)) return ;
228
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_PATH_TOO_LONG, name);
234
+ popup_message (owner, MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_PATH_TOO_LONG, name);
229
235
ZeroMemory (buffer, len * sizeof (TCHAR));
230
236
}
231
237
@@ -242,15 +248,15 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
242
248
243
249
/* Get service name. */
244
250
if (! GetDlgItemText (window, IDC_NAME, service->name , _countof (service->name ))) {
245
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_SERVICE_NAME);
251
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_SERVICE_NAME);
246
252
cleanup_nssm_service (service);
247
253
return 2 ;
248
254
}
249
255
250
256
/* Get executable name */
251
257
if (! service->native ) {
252
258
if (! GetDlgItemText (tablist[NSSM_TAB_APPLICATION], IDC_PATH, service->exe , _countof (service->exe ))) {
253
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PATH);
259
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PATH);
254
260
return 3 ;
255
261
}
256
262
@@ -263,7 +269,7 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
263
269
/* Get flags. */
264
270
if (SendMessage (GetDlgItem (tablist[NSSM_TAB_APPLICATION], IDC_FLAGS), WM_GETTEXTLENGTH, 0 , 0 )) {
265
271
if (! GetDlgItemText (tablist[NSSM_TAB_APPLICATION], IDC_FLAGS, service->flags , _countof (service->flags ))) {
266
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_OPTIONS);
272
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_OPTIONS);
267
273
return 4 ;
268
274
}
269
275
}
@@ -272,14 +278,14 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
272
278
/* Get details. */
273
279
if (SendMessage (GetDlgItem (tablist[NSSM_TAB_DETAILS], IDC_DISPLAYNAME), WM_GETTEXTLENGTH, 0 , 0 )) {
274
280
if (! GetDlgItemText (tablist[NSSM_TAB_DETAILS], IDC_DISPLAYNAME, service->displayname , _countof (service->displayname ))) {
275
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_DISPLAYNAME);
281
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_DISPLAYNAME);
276
282
return 5 ;
277
283
}
278
284
}
279
285
280
286
if (SendMessage (GetDlgItem (tablist[NSSM_TAB_DETAILS], IDC_DESCRIPTION), WM_GETTEXTLENGTH, 0 , 0 )) {
281
287
if (! GetDlgItemText (tablist[NSSM_TAB_DETAILS], IDC_DESCRIPTION, service->description , _countof (service->description ))) {
282
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_DESCRIPTION);
288
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_DESCRIPTION);
283
289
return 5 ;
284
290
}
285
291
}
@@ -307,21 +313,21 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
307
313
/* Username. */
308
314
service->usernamelen = SendMessage (GetDlgItem (tablist[NSSM_TAB_LOGON], IDC_USERNAME), WM_GETTEXTLENGTH, 0 , 0 );
309
315
if (! service->usernamelen ) {
310
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_USERNAME);
316
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_USERNAME);
311
317
return 6 ;
312
318
}
313
319
service->usernamelen ++;
314
320
315
321
service->username = (TCHAR *) HeapAlloc (GetProcessHeap (), 0 , service->usernamelen * sizeof (TCHAR));
316
322
if (! service->username ) {
317
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" account name" ), _T (" install()" ));
323
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" account name" ), _T (" install()" ));
318
324
return 6 ;
319
325
}
320
326
if (! GetDlgItemText (tablist[NSSM_TAB_LOGON], IDC_USERNAME, service->username , (int ) service->usernamelen )) {
321
327
HeapFree (GetProcessHeap (), 0 , service->username );
322
328
service->username = 0 ;
323
329
service->usernamelen = 0 ;
324
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_USERNAME);
330
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_USERNAME);
325
331
return 6 ;
326
332
}
327
333
@@ -341,11 +347,11 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
341
347
342
348
if (! orig_service || ! orig_service->username || ! str_equiv (service->username , orig_service->username ) || service->passwordlen || passwordlen) {
343
349
if (! service->passwordlen ) {
344
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PASSWORD);
350
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PASSWORD);
345
351
return 6 ;
346
352
}
347
353
if (passwordlen != service->passwordlen ) {
348
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PASSWORD);
354
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PASSWORD);
349
355
return 6 ;
350
356
}
351
357
service->passwordlen ++;
@@ -356,7 +362,7 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
356
362
HeapFree (GetProcessHeap (), 0 , service->username );
357
363
service->username = 0 ;
358
364
service->usernamelen = 0 ;
359
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" password confirmation" ), _T (" install()" ));
365
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" password confirmation" ), _T (" install()" ));
360
366
return 6 ;
361
367
}
362
368
@@ -367,7 +373,7 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
367
373
HeapFree (GetProcessHeap (), 0 , service->username );
368
374
service->username = 0 ;
369
375
service->usernamelen = 0 ;
370
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" password" ), _T (" install()" ));
376
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" password" ), _T (" install()" ));
371
377
return 6 ;
372
378
}
373
379
@@ -381,7 +387,7 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
381
387
HeapFree (GetProcessHeap (), 0 , service->username );
382
388
service->username = 0 ;
383
389
service->usernamelen = 0 ;
384
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_PASSWORD);
390
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_PASSWORD);
385
391
return 6 ;
386
392
}
387
393
@@ -396,13 +402,13 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
396
402
HeapFree (GetProcessHeap (), 0 , service->username );
397
403
service->username = 0 ;
398
404
service->usernamelen = 0 ;
399
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_PASSWORD);
405
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_PASSWORD);
400
406
return 6 ;
401
407
}
402
408
403
409
/* Compare. */
404
410
if (_tcsncmp (password, service->password , service->passwordlen )) {
405
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PASSWORD);
411
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_PASSWORD);
406
412
SecureZeroMemory (password, service->passwordlen );
407
413
HeapFree (GetProcessHeap (), 0 , password);
408
414
SecureZeroMemory (service->password , service->passwordlen );
@@ -437,9 +443,9 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
437
443
if (service->default_exit_action == CB_ERR) service->default_exit_action = 0 ;
438
444
439
445
/* Get I/O stuff. */
440
- check_io (_T (" stdin" ), service->stdin_path , _countof (service->stdin_path ), IDC_STDIN);
441
- check_io (_T (" stdout" ), service->stdout_path , _countof (service->stdout_path ), IDC_STDOUT);
442
- check_io (_T (" stderr" ), service->stderr_path , _countof (service->stderr_path ), IDC_STDERR);
446
+ check_io (window, _T (" stdin" ), service->stdin_path , _countof (service->stdin_path ), IDC_STDIN);
447
+ check_io (window, _T (" stdout" ), service->stdout_path , _countof (service->stdout_path ), IDC_STDOUT);
448
+ check_io (window, _T (" stderr" ), service->stderr_path , _countof (service->stderr_path ), IDC_STDERR);
443
449
444
450
/* Override stdout and/or stderr. */
445
451
if (SendDlgItemMessage (tablist[NSSM_TAB_ROTATION], IDC_TRUNCATE, BM_GETCHECK, 0 , 0 ) & BST_CHECKED) {
@@ -459,13 +465,13 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
459
465
if (envlen) {
460
466
TCHAR *env = (TCHAR *) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, (envlen + 2 ) * sizeof (TCHAR));
461
467
if (! env) {
462
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" environment" ), _T (" install()" ));
468
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" environment" ), _T (" install()" ));
463
469
cleanup_nssm_service (service);
464
470
return 5 ;
465
471
}
466
472
467
473
if (! GetDlgItemText (tablist[NSSM_TAB_ENVIRONMENT], IDC_ENVIRONMENT, env, envlen + 1 )) {
468
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_ENVIRONMENT);
474
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_ENVIRONMENT);
469
475
HeapFree (GetProcessHeap (), 0 , env);
470
476
cleanup_nssm_service (service);
471
477
return 5 ;
@@ -475,7 +481,7 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
475
481
unsigned long newlen;
476
482
if (unformat_environment (env, envlen, &newenv, &newlen)) {
477
483
HeapFree (GetProcessHeap (), 0 , env);
478
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" environment" ), _T (" install()" ));
484
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" environment" ), _T (" install()" ));
479
485
cleanup_nssm_service (service);
480
486
return 5 ;
481
487
}
@@ -486,7 +492,7 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service
486
492
487
493
/* Test the environment is valid. */
488
494
if (test_environment (env)) {
489
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_ENVIRONMENT);
495
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INVALID_ENVIRONMENT);
490
496
HeapFree (GetProcessHeap (), 0 , env);
491
497
cleanup_nssm_service (service);
492
498
return 5 ;
@@ -518,37 +524,37 @@ int install(HWND window) {
518
524
/* See if it works. */
519
525
switch (install_service (service)) {
520
526
case 1 :
521
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" service" ), _T (" install()" ));
527
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" service" ), _T (" install()" ));
522
528
cleanup_nssm_service (service);
523
529
return 1 ;
524
530
525
531
case 2 :
526
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_OPEN_SERVICE_MANAGER_FAILED);
532
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_OPEN_SERVICE_MANAGER_FAILED);
527
533
cleanup_nssm_service (service);
528
534
return 2 ;
529
535
530
536
case 3 :
531
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_PATH_TOO_LONG, NSSM);
537
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_PATH_TOO_LONG, NSSM);
532
538
cleanup_nssm_service (service);
533
539
return 3 ;
534
540
535
541
case 4 :
536
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_OUT_OF_MEMORY_FOR_IMAGEPATH);
542
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_OUT_OF_MEMORY_FOR_IMAGEPATH);
537
543
cleanup_nssm_service (service);
538
544
return 4 ;
539
545
540
546
case 5 :
541
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INSTALL_SERVICE_FAILED);
547
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_INSTALL_SERVICE_FAILED);
542
548
cleanup_nssm_service (service);
543
549
return 5 ;
544
550
545
551
case 6 :
546
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_CREATE_PARAMETERS_FAILED);
552
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_CREATE_PARAMETERS_FAILED);
547
553
cleanup_nssm_service (service);
548
554
return 6 ;
549
555
}
550
556
551
- popup_message (MB_OK, NSSM_MESSAGE_SERVICE_INSTALLED, service->name );
557
+ popup_message (window, MB_OK, NSSM_MESSAGE_SERVICE_INSTALLED, service->name );
552
558
cleanup_nssm_service (service);
553
559
return 0 ;
554
560
}
@@ -562,41 +568,41 @@ int remove(HWND window) {
562
568
if (service) {
563
569
/* Get service name */
564
570
if (! GetDlgItemText (window, IDC_NAME, service->name , _countof (service->name ))) {
565
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_SERVICE_NAME);
571
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_MISSING_SERVICE_NAME);
566
572
cleanup_nssm_service (service);
567
573
return 2 ;
568
574
}
569
575
570
576
/* Confirm */
571
- if (popup_message (MB_YESNO, NSSM_GUI_ASK_REMOVE_SERVICE, service->name ) != IDYES) {
577
+ if (popup_message (window, MB_YESNO, NSSM_GUI_ASK_REMOVE_SERVICE, service->name ) != IDYES) {
572
578
cleanup_nssm_service (service);
573
579
return 0 ;
574
580
}
575
581
}
576
582
577
583
switch (remove_service (service)) {
578
584
case 1 :
579
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" service" ), _T (" remove()" ));
585
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" service" ), _T (" remove()" ));
580
586
cleanup_nssm_service (service);
581
587
return 1 ;
582
588
583
589
case 2 :
584
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_OPEN_SERVICE_MANAGER_FAILED);
590
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_OPEN_SERVICE_MANAGER_FAILED);
585
591
cleanup_nssm_service (service);
586
592
return 2 ;
587
593
588
594
case 3 :
589
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_SERVICE_NOT_INSTALLED);
595
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_SERVICE_NOT_INSTALLED);
590
596
return 3 ;
591
597
cleanup_nssm_service (service);
592
598
593
599
case 4 :
594
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_REMOVE_SERVICE_FAILED);
600
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_REMOVE_SERVICE_FAILED);
595
601
cleanup_nssm_service (service);
596
602
return 4 ;
597
603
}
598
604
599
- popup_message (MB_OK, NSSM_MESSAGE_SERVICE_REMOVED, service->name );
605
+ popup_message (window, MB_OK, NSSM_MESSAGE_SERVICE_REMOVED, service->name );
600
606
cleanup_nssm_service (service);
601
607
return 0 ;
602
608
}
@@ -612,28 +618,28 @@ int edit(HWND window, nssm_service_t *orig_service) {
612
618
613
619
switch (edit_service (service, true )) {
614
620
case 1 :
615
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" service" ), _T (" edit()" ));
621
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_EVENT_OUT_OF_MEMORY, _T (" service" ), _T (" edit()" ));
616
622
cleanup_nssm_service (service);
617
623
return 1 ;
618
624
619
625
case 3 :
620
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_PATH_TOO_LONG, NSSM);
626
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_MESSAGE_PATH_TOO_LONG, NSSM);
621
627
cleanup_nssm_service (service);
622
628
return 3 ;
623
629
624
630
case 4 :
625
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_OUT_OF_MEMORY_FOR_IMAGEPATH);
631
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_OUT_OF_MEMORY_FOR_IMAGEPATH);
626
632
cleanup_nssm_service (service);
627
633
return 4 ;
628
634
629
635
case 5 :
630
636
case 6 :
631
- popup_message (MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_EDIT_PARAMETERS_FAILED);
637
+ popup_message (window, MB_OK | MB_ICONEXCLAMATION, NSSM_GUI_EDIT_PARAMETERS_FAILED);
632
638
cleanup_nssm_service (service);
633
639
return 6 ;
634
640
}
635
641
636
- popup_message (MB_OK, NSSM_MESSAGE_SERVICE_EDITED, service->name );
642
+ popup_message (window, MB_OK, NSSM_MESSAGE_SERVICE_EDITED, service->name );
637
643
cleanup_nssm_service (service);
638
644
return 0 ;
639
645
}
0 commit comments