mturk 2003/04/28 10:17:46
Modified: daemon/src/native/nt/procrun procgui.c procrun.c
Log:
Added //ES// mode for editing service params.
Revision Changes Path
1.11 +16 -6 jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c
Index: procgui.c
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- procgui.c 28 Apr 2003 12:56:43 -0000 1.10
+++ procgui.c 28 Apr 2003 17:17:45 -0000 1.11
@@ -110,6 +110,7 @@
int ac_use_dlg = 0;
int ac_use_show = 0;
int ac_use_splash = 0;
+int ac_use_props = 0;
HINSTANCE ac_instance;
static procrun_t *ac_env = NULL;
static HICON ac_main_icon;
@@ -590,7 +591,8 @@
g_env->m->java.stop_method,
g_env->m->java.stop_param);
SetDlgItemText(hdlg, RC_TXT_EC, txt);
- if (!strcmp(g_env->m->java.display, "auto"))
+ if (g_env->m->java.display &&
+ !strcmp(g_env->m->java.display, "auto"))
CheckDlgButton(hdlg, RC_CHK_JVM, BST_CHECKED);
strcpy(txt, g_env->m->java.opts);
@@ -760,7 +762,7 @@
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK | PSH_NOCONTEXTHELP;
psh.hwndParent = owner;
psh.hInstance = ac_instance;
- psh.pszIcon = MAKEINTRESOURCE(IDI_ICOCONTRY);
+ psh.pszIcon = MAKEINTRESOURCE(IDI_ICOCONWRAP);
psh.pszbmHeader = MAKEINTRESOURCE(IDB_BMPJAKARTA);
psh.pszCaption = TEXT("Service Options");
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
@@ -783,7 +785,13 @@
switch (message) {
case WM_CREATE:
ac_main_hwnd = hwnd;
- ac_show_try_icon(hwnd, NIM_ADD, ac_cmdname, 1);
+ if (ac_use_props) {
+ PostMessage(hwnd, WM_COMMAND, IDM_OPTIONS, 0);
+ return FALSE;
+ }
+
+ if (ac_use_try)
+ ac_show_try_icon(hwnd, NIM_ADD, ac_cmdname, 1);
/* add the 20 s timer for startup to avoid zombie spash
* if something goes wrong.
*/
@@ -810,7 +818,8 @@
break;
case WM_DESTROY:
case WM_QUIT:
- ac_show_try_icon(hwnd, NIM_DELETE, NULL, 0);
+ if (ac_use_try);
+ ac_show_try_icon(hwnd, NIM_DELETE, NULL, 0);
SetEvent(g_env->m->events[0]);
break;
case WM_TRAYMESSAGE:
@@ -842,7 +851,9 @@
hwnd, (DLGPROC)ac_about_dlg_proc);
break;
case IDM_OPTIONS:
- ac_show_properties(hwnd);
+ ac_show_properties(hwnd);
+ if (ac_use_props)
+ PostMessage(hwnd, WM_QUIT, 0, 0);
break;
}
@@ -914,7 +925,6 @@
env->m->service.name);
InitCommonControls();
-
if (ac_main_hwnd) {
if (ac_use_try)
ac_taskbar_created = RegisterWindowMessage("TaskbarCreated");
1.17 +15 -0 jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.c
Index: procrun.c
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- procrun.c 28 Apr 2003 12:55:17 -0000 1.16
+++ procrun.c 28 Apr 2003 17:17:45 -0000 1.17
@@ -116,6 +116,7 @@
extern int ac_use_try;
extern int ac_use_dlg;
extern int ac_use_show;
+extern int ac_use_props;
extern RECT ac_winpos;
extern HINSTANCE ac_instance;
extern HWND ac_main_hwnd;
@@ -487,6 +488,13 @@
ac_use_dlg = 1;
ac_use_show = 1;
}
+ else if (STRN_COMPARE(arg, PROC_ARG_EDIT_SERVICE)) {
+ proc->service.name = pool_strdup(proc->pool, arg +
+ STRN_SIZE(PROC_ARG_EDIT_SERVICE));
+
+ mode = PROCRUN_CMD_EDIT_SERVICE;
+ ac_use_props = 1;
+ }
#endif
else if (STRN_COMPARE(arg, PROC_ARG_STOP_SERVICE)) {
proc->service.name = pool_strdup(proc->pool, arg +
@@ -917,6 +925,7 @@
case PROCRUN_CMD_TEST_SERVICE:
case PROCRUN_CMD_GUIT_SERVICE:
case PROCRUN_CMD_GUID_SERVICE:
+ case PROCRUN_CMD_EDIT_SERVICE:
{
HKEY key;
char skey[256];
@@ -2414,6 +2423,12 @@
#endif
service_main(argc, argv);
break;
+#ifdef PROCRUN_WINAPP
+ case PROCRUN_CMD_EDIT_SERVICE:
+ LoadLibrary("riched32.dll");
+ gui_thread(g_env);
+ break;
+#endif
case PROCRUN_CMD_INSTALL_SERVICE:
if (g_is_windows_nt)
rv = procrun_install_service(env->m, argc, argv);
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
|