/* Create window */\r
HWND dlg = CreateDialog(0, MAKEINTRESOURCE(resource), 0, install_dlg);\r
if (! dlg) {\r
- snprintf(blurb, sizeof(blurb), "CreateDialog() failed with error code %d", GetLastError());\r
+ _snprintf(blurb, sizeof(blurb), "CreateDialog() failed with error code %d", GetLastError());\r
MessageBox(0, blurb, NSSM, MB_OK);\r
return 1;\r
}\r
DispatchMessage(&message);\r
}\r
\r
- return message.wParam;\r
+ return (int) message.wParam;\r
}\r
\r
void centre_window(HWND window) {\r
/* Centre window */\r
x = (desktop_size.right - size.right) / 2;\r
y = (desktop_size.bottom - size.bottom) / 2;\r
- MoveWindow(window, x, y, size.right, size.bottom, 0);\r
+ MoveWindow(window, x, y, size.right - size.left, size.bottom - size.top, 0);\r
}\r
\r
/* Install the service */\r
\r
/* Check parameters in the window */\r
char name[STRING_SIZE];\r
- char exe[MAX_PATH];\r
+ char exe[EXE_LENGTH];\r
char flags[STRING_SIZE];\r
\r
/* Get service name */\r
\r
/* Confirm */\r
char blurb[MAX_PATH];\r
- if (snprintf(blurb, sizeof(blurb), "Remove the \"%s\" service?", name) < 0) {\r
+ if (_snprintf(blurb, sizeof(blurb), "Remove the \"%s\" service?", name) < 0) {\r
if (MessageBox(0, "Remove the service?", NSSM, MB_YESNO) != IDYES) return 0;\r
}\r
else if (MessageBox(0, blurb, NSSM, MB_YESNO) != IDYES) return 0;\r
}\r
\r
/* Install/remove dialogue callback */\r
-int CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {\r
+INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {\r
switch (message) {\r
/* Creating the dialogue */\r
case WM_INITDIALOG:\r