Changed arguments to nssm_gui().
[nssm.git] / gui.cpp
diff --git a/gui.cpp b/gui.cpp
index 80d74ef..94da622 100644 (file)
--- a/gui.cpp
+++ b/gui.cpp
@@ -4,9 +4,9 @@ static enum { NSSM_TAB_APPLICATION, NSSM_TAB_DETAILS, NSSM_TAB_LOGON, NSSM_TAB_S
 static HWND tablist[NSSM_NUM_TABS];\r
 static int selected_tab;\r
 \r
-int nssm_gui(int resource, TCHAR *name) {\r
+int nssm_gui(int resource, nssm_service_t *service) {\r
   /* Create window */\r
-  HWND dlg = CreateDialog(0, MAKEINTRESOURCE(resource), 0, install_dlg);\r
+  HWND dlg = CreateDialogParam(0, MAKEINTRESOURCE(resource), 0, nssm_dlg, (LPARAM) service);\r
   if (! dlg) {\r
     popup_message(MB_OK, NSSM_GUI_CREATEDIALOG_FAILED, error_string(GetLastError()));\r
     return 1;\r
@@ -17,8 +17,8 @@ int nssm_gui(int resource, TCHAR *name) {
   ShowWindow(dlg, SW_SHOW);\r
 \r
   /* Set service name if given */\r
-  if (name) {\r
-    SetDlgItemText(dlg, IDC_NAME, name);\r
+  if (service->name[0]) {\r
+    SetDlgItemText(dlg, IDC_NAME, service->name);\r
     /* No point making user click remove if the name is already entered */\r
     if (resource == IDD_REMOVE) {\r
       HWND button = GetDlgItem(dlg, IDC_REMOVE);\r
@@ -604,7 +604,7 @@ INT_PTR CALLBACK tab_dlg(HWND tab, UINT message, WPARAM w, LPARAM l) {
 }\r
 \r
 /* Install/remove dialogue callback */\r
-INT_PTR CALLBACK install_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {\r
+INT_PTR CALLBACK nssm_dlg(HWND window, UINT message, WPARAM w, LPARAM l) {\r
   switch (message) {\r
     /* Creating the dialogue */\r
     case WM_INITDIALOG:\r