X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=gui.cpp;h=b1174d124a17714cfaedb7f288dae6368f5e344e;hb=63363fbc93ec23e1673113029e819c1a55dd7967;hp=5041acdc89a9e692bd5adb28ee70f79b37bd440f;hpb=167b3e74003ed8f2b61bda7037f31447c488c29b;p=nssm.git diff --git a/gui.cpp b/gui.cpp index 5041acd..b1174d1 100644 --- a/gui.cpp +++ b/gui.cpp @@ -35,7 +35,7 @@ int nssm_gui(int resource, char *name) { DispatchMessage(&message); } - return message.wParam; + return (int) message.wParam; } void centre_window(HWND window) { @@ -58,7 +58,7 @@ void centre_window(HWND window) { /* Centre window */ x = (desktop_size.right - size.right) / 2; y = (desktop_size.bottom - size.bottom) / 2; - MoveWindow(window, x, y, size.right, size.bottom, 0); + MoveWindow(window, x, y, size.right - size.left, size.bottom - size.top, 0); } /* Install the service */ @@ -67,7 +67,7 @@ int install(HWND window) { /* Check parameters in the window */ char name[STRING_SIZE]; - char exe[MAX_PATH]; + char exe[EXE_LENGTH]; char flags[STRING_SIZE]; /* Get service name */ @@ -179,7 +179,7 @@ void browse(HWND window) { } /* Install/remove dialogue callback */ -int CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) { +INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) { switch (message) { /* Creating the dialogue */ case WM_INITDIALOG: