/* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "apxwin.h"
#include "prunmgr.h"

#define RSTR_PSM        "Commons Daemon Service Manager"
#define RSTR_SCMATS     "Service Manager is attempting to "

IDI_MAINICON         ICON                   "../../resources/procrunw.ico"
IDI_ICONSTOP         ICON                   "../../resources/procruns.ico"
IDI_ICONRUN          ICON                   "../../resources/procrunr.ico"
IDR_LICENSE          RTF                    "../../resources/license.rtf"
BMP_JAKARTA          BITMAP                 "../../resources/commons.bmp"

#if 0
BMP_APMNUHDR         BITMAP                 "../../resources/apmnuhdr.bmp"
#endif

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "prunmgr.manifest"

IDD_ABOUTBOX DIALOGEX 0, 0, 337, 187
STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Apache Service Manager"
FONT 8, "Microsoft Sans Serif", 400, 0, 0x0
BEGIN
    DEFPUSHBUTTON   "&OK",IDOK,285,150,50,14
    CONTROL         "",IDC_LICENSE,"RichEdit20A",ES_MULTILINE |
                    ES_READONLY | WS_BORDER | WS_VSCROLL,0,31,335,115
    CONTROL         "BMP_JAKARTA",IDC_STATIC,"Static",SS_BITMAP|0x00000040L,0,0,337,30
    LTEXT           " ",IDC_ABOUTAPP,2,150,270,12
    LTEXT           "Copyright (c) 2000-2013 The Apache Software Foundation.",IDC_STATIC,2,160,270,12
    LTEXT           "http://commons.apache.org",IDC_STATIC,2,170,270,12
    PUSHBUTTON      "&System Info",IAB_SYSINF,285,170,50,14
END

IDD_PROGRESS DIALOGEX 0, 0, 322, 92
STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP |
    WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOPMOST
CAPTION "Apache Commons Daemon Service Manager"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "Cl&ose",IDOK,261,73,50,14
    PUSHBUTTON      "&Cancel",IDCANCEL,202,73,50,14
    LTEXT           " ",
                    IDDP_HEAD,40,4,250,8
    LTEXT           " ",IDDP_TEXT,40,15,250,44
    CONTROL         "",IDDP_PROGRESS,"msctls_progress32",WS_BORDER,10,50,302,
                    14
    ICON            IDI_MAINICON,IDC_STATIC,10,4,20,20,0,WS_EX_TRANSPARENT
END

IDD_SELUSER DIALOGEX 0, 0, 410, 201
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU |
    WS_THICKFRAME
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Select User"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    LTEXT           "Name:",IDSU_SELNAME,10,183,22,8
    EDITTEXT        IDSU_SELECTED,48,200,213,14,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "OK",IDOK,292,180,50,14,WS_DISABLED
    PUSHBUTTON      "Cancel",IDCANCEL,348,180,50,14
    LTEXT           "Look In:",IDC_STATIC,10,9,27,8
    CONTROL         "",IDSU_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL |
                    LVS_SORTASCENDING | LVS_SHAREIMAGELISTS | LVS_ALIGNLEFT | WS_BORDER |
                    WS_TABSTOP,0,26,410,149,WS_EX_CLIENTEDGE
    CONTROL         "",IDSU_COMBO,"ComboBoxEx32",CBS_DROPDOWNLIST |
                    WS_VSCROLL | WS_TABSTOP,47,6,260,80
END

IDD_PROPPAGE_SGENERAL DIALOGEX 0, 0, 260, 186
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
    LTEXT           "Service Name: ",IDC_STATIC,10,8,52,8
    LTEXT           "  ",IDC_PPSGNAME,70,8,240,8
    LTEXT           "Display &name: ",IDC_STATIC,10,23,50,8
    EDITTEXT        IDC_PPSGDISP,70,22,180,12,ES_AUTOHSCROLL
    LTEXT           "&Description: ",IDC_STATIC,10,41,43,8
    EDITTEXT        IDC_PPSGDESC,70,40,180,12,ES_AUTOHSCROLL
    LTEXT           "Pat&h to executable:",IDC_STATIC,10,63,66,8
    EDITTEXT        IDC_PPSGDEXE,10,75,240,12,ES_AUTOHSCROLL | WS_DISABLED
    LTEXT           "Startup typ&e:",IDC_STATIC,10,94,46,8
    COMBOBOX        IDC_PPSGCMBST,70,93,180,80,CBS_DROPDOWNLIST | WS_VSCROLL |
                    WS_TABSTOP
    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,128,240,1
    LTEXT           "Service Status:",IDC_STATIC,10,138,52,8
    LTEXT           "  ",IDC_PPSGSTATUS,70,138,240,8
    PUSHBUTTON      "&Start",IDC_PPSGSTART,10,160,55,14,WS_DISABLED
    PUSHBUTTON      "S&top",IDC_PPSGSTOP,71,160,55,14,WS_DISABLED
    PUSHBUTTON      "&Pause",IDC_PPSGPAUSE,132,160,55,14,WS_DISABLED
    PUSHBUTTON      "&Restart",IDC_PPSGRESTART,193,160,55,14,WS_DISABLED
END

IDD_PROPPAGE_LOGON DIALOGEX 0, 0, 260, 186
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
    LTEXT           "Log on as:",IDC_STATIC,10,8,51,8
    CONTROL         "&Local System account",IDC_PPSLLS,"Button",
                    BS_AUTORADIOBUTTON,10,23,85,10
    CONTROL         "Allo&w service to interact with desktop",IDC_PPSLID,
                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,37,135,10
    CONTROL         "&This account:",IDC_PPSLUA,"Button",BS_AUTORADIOBUTTON,
                    10,59,61,10
    EDITTEXT        IDC_PPSLUSER,86,58,114,12,ES_AUTOHSCROLL
    PUSHBUTTON      "&Browse...",IDC_PPSLBROWSE,205,57,50,14
    LTEXT           "&Password:",IDL_PPSLPASS,21,76,36,8
    EDITTEXT        IDC_PPSLPASS,86,75,114,12,ES_PASSWORD | ES_AUTOHSCROLL
    LTEXT           "&Confirm Password:",IDL_PPSLCPASS,20,93,63,8
    EDITTEXT        IDC_PPSLCPASS,86,92,114,12,ES_PASSWORD | ES_AUTOHSCROLL
END

IDD_PROPPAGE_LOGGING DIALOGEX 0, 0, 260, 186
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
    LTEXT           "&Level:",IDC_STATIC,10,18,46,8
    COMBOBOX        IDC_PPLGLEVEL,70,17,180,80,CBS_DROPDOWNLIST | WS_VSCROLL |
                    WS_TABSTOP
    LTEXT           "Log &path: ",IDC_STATIC,10,33,50,8
    EDITTEXT        IDC_PPLGPATH,10,45,218,12,ES_AUTOHSCROLL
    PUSHBUTTON      "...",IDC_PPLGBPATH,232,44,18,14
    LTEXT           "Log prefix: ",IDC_STATIC,10,63,50,8
    EDITTEXT        IDC_PPLGPREFIX,70,62,158,12,ES_AUTOHSCROLL

    LTEXT           "Pid file: ",IDC_STATIC,10,81,50,8
    EDITTEXT        IDC_PPLGPIDFILE,70,82,158,12,ES_AUTOHSCROLL

    LTEXT           "Redirect Stdout: ",IDC_STATIC,10,105,80,8
    EDITTEXT        IDC_PPLGSTDOUT,10,117,218,12,ES_AUTOHSCROLL
    PUSHBUTTON      "...",IDC_PPLGBSTDOUT,232,116,18,14
    LTEXT           "Redirect Stderror: ",IDC_STATIC,10,135,80,8
    EDITTEXT        IDC_PPLGSTDERR,10,147,218,12,ES_AUTOHSCROLL
    PUSHBUTTON      "...",IDC_PPLGBSTDERR,232,146,18,14
END

IDD_PROPPAGE_JVM DIALOGEX 0, 0, 260, 186
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
    CONTROL         " Use default",IDC_PPJAUTO,"Button",BS_AUTOCHECKBOX |
                    WS_TABSTOP,10,8,72,12
    LTEXT           "Java Virtual Machine: ",IDC_STATIC,10,23,80,8
    EDITTEXT        IDC_PPJJVM,10,35,218,12,ES_AUTOHSCROLL
    PUSHBUTTON      "...",IDC_PPJBJVM,232,34,18,14
    LTEXT           "Java Classpath:",IDC_STATIC,10,53,66,8
    EDITTEXT        IDC_PPJCLASSPATH,10,65,240,12,ES_AUTOHSCROLL
    LTEXT           "Java Options:",IDC_STATIC,10,83,66,8
    EDITTEXT        IDC_PPJOPTIONS,10,95,240,40,ES_MULTILINE | ES_AUTOHSCROLL |
                    ES_WANTRETURN | WS_VSCROLL
    LTEXT           "Initial memory pool:",IDC_STATIC,10,140,80,8
    EDITTEXT        IDC_PPJMS,90,139,100,12,ES_AUTOHSCROLL | ES_NUMBER
    LTEXT           "MB",IDC_STATIC,195,140,25,8
    LTEXT           "Maximum memory pool:",IDC_STATIC,10,156,80,8
    EDITTEXT        IDC_PPJMX,90,155,100,12,ES_AUTOHSCROLL | ES_NUMBER
    LTEXT           "MB",IDC_STATIC,195,156,25,8
    LTEXT           "Thread stack size:",IDC_STATIC,10,172,80,8
    EDITTEXT        IDC_PPJSS,90,171,100,12,ES_AUTOHSCROLL | ES_NUMBER
    LTEXT           "KB",IDC_STATIC,195,172,25,8
END

IDD_PROPPAGE_START DIALOGEX 0, 0, 260, 186
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
    LTEXT           "&Class: ",IDC_STATIC,10,8,50,8
    EDITTEXT        IDC_PPRCLASS,10,20,240,12,ES_AUTOHSCROLL
    LTEXT           "Image: ",IDC_STATIC,10,38,80,8
    EDITTEXT        IDC_PPRIMAGE,10,50,218,12,ES_AUTOHSCROLL | WS_DISABLED
    PUSHBUTTON      "...",IDC_PPRBIMAGE,232,49,18,14,WS_DISABLED
    LTEXT           "Working Path: ",IDC_STATIC,10,68,80,8
    EDITTEXT        IDC_PPRWPATH,10,80,218,12,ES_AUTOHSCROLL
    PUSHBUTTON      "...",IDC_PPRBWPATH,232,79,18,14
    LTEXT           "&Method: ",IDC_STATIC,10,98,50,8
    EDITTEXT        IDC_PPRMETHOD,70,97,180,12,ES_AUTOHSCROLL
    LTEXT           "&Arguments: ",IDC_STATIC,10,115,50,8
    EDITTEXT        IDC_PPRARGS,70,114,180,30,ES_MULTILINE | ES_AUTOHSCROLL |
                    ES_WANTRETURN | WS_VSCROLL
    LTEXT           "&Timeout: ",IDC_STATIC,10,150,50,8
    EDITTEXT        IDC_PPRTIMEOUT,70,149,100,12,ES_AUTOHSCROLL | WS_DISABLED
    LTEXT           "sec.",IDC_STATIC,175,150,25,8
    LTEXT           "&Mode: ",IDC_STATIC,10,168,50,8
    COMBOBOX        IDC_PPRMODE,70,167,180,80,CBS_DROPDOWNLIST | WS_VSCROLL |
                    WS_TABSTOP
END

IDD_PROPPAGE_STOP DIALOGEX 0, 0, 260, 186
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
    LTEXT           "&Class: ",IDC_STATIC,10,8,50,8
    EDITTEXT        IDC_PPSCLASS,10,20,240,12,ES_AUTOHSCROLL
    LTEXT           "Image: ",IDC_STATIC,10,38,80,8
    EDITTEXT        IDC_PPSIMAGE,10,50,218,12,ES_AUTOHSCROLL | WS_DISABLED
    PUSHBUTTON      "...",IDC_PPSBIMAGE,232,49,18,14,WS_DISABLED
    LTEXT           "Working Path: ",IDC_STATIC,10,68,80,8
    EDITTEXT        IDC_PPSWPATH,10,80,218,12,ES_AUTOHSCROLL
    PUSHBUTTON      "...",IDC_PPSBWPATH,232,79,18,14
    LTEXT           "&Method: ",IDC_STATIC,10,98,50,8
    EDITTEXT        IDC_PPSMETHOD,70,97,180,12,ES_AUTOHSCROLL
    LTEXT           "&Arguments: ",IDC_STATIC,10,115,50,8
    EDITTEXT        IDC_PPSARGS,70,114,180,30,ES_MULTILINE | ES_AUTOHSCROLL |
                    ES_WANTRETURN | WS_VSCROLL
    LTEXT           "&Timeout: ",IDC_STATIC,10,150,50,8
    EDITTEXT        IDC_PPSTIMEOUT,70,149,100,12,ES_AUTOHSCROLL | ES_NUMBER
    LTEXT           "sec.",IDC_STATIC,175,150,25,8
    LTEXT           "&Mode: ",IDC_STATIC,10,168,50,8
    COMBOBOX        IDC_PPSMODE,70,167,180,80,CBS_DROPDOWNLIST | WS_VSCROLL |
                    WS_TABSTOP
END

STRINGTABLE
BEGIN
    IDS_APPLICATION     RSTR_PSM
    IDS_APPVERSION      "Version 1.0.13"
    IDS_APPFULLNAME     RSTR_PSM " Version " PRG_VERSION
    IDS_APPCOPYRIGHT    "Copyright (c) 2000-2013 The Apache Software Foundation"
    IDS_APPDESCRIPTION  "Apache Commons Daemon Service Management Tool"
    IDS_ALREAY_RUNING   "An instance of '%S' application is already running"
    IDS_ERRORCMD        "Unknown command line option '%s'\nSee the manual for command line usage."
    IDS_HSSTART         RSTR_SCMATS "start the following service ..."
    IDS_HSSTOP          RSTR_SCMATS "stop the following service ..."
    IDS_HSRESTART       RSTR_SCMATS "to restart the following service ..."
    IDS_HSPAUSE         RSTR_SCMATS "to pause the following service ..."
    IDS_VALIDPASS       "Please enter a valid password"
    IDS_PPGENERAL       "General"
    IDS_PPLOGON         "Log On"
    IDS_PPLOGGING       "Logging"
    IDS_PPJAVAVM        "Java"
    IDS_PPSTART         "Startup"
    IDS_PPSTOP          "Shutdown"
    IDS_NOTIMPLEMENTED  "Sorry, but this feature is not implemented yet"
    IDS_LGPATHTITLE     "Select Log root folder"
    IDS_ALLFILES        "All Files (*.*)\0*.*\0"
    IDS_DLLFILES        "Dynamic Link Libraries (*.dll)\0*.dll\0"
    IDS_EXEFILES        "Executables (*.exe)\0*.exe\0"
    IDS_LGSTDOUT        "Select Stdoutput filename"
    IDS_LGSTDERR        "Select Stderror filename"
    IDS_PPJBJVM         "Select Java Virtual Machine DLL"
    IDS_PPWPATH         "Select Working path"
    IDS_PPIMAGE         "Select Executable Image"
    IDS_ERRSREG         "Unable to open the service registry key"
END

1 VERSIONINFO
 FILEVERSION 1,0,13,0
 PRODUCTVERSION 1,0,13,0
 FILEFLAGSMASK 0x3fL
#if defined(_DEBUG)
 FILEFLAGS 0x03L
#else
 FILEFLAGS 0x02L
#endif
 FILEOS 0x40004L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904b0"
    BEGIN
      VALUE "Comments", "Commons Daemon Service Management Tool\0"
      VALUE "CompanyName", "Apache Software Foundation\0"
      VALUE "FileDescription", RSTR_PSM "\0"
      VALUE "FileVersion", PRG_VERSION
      VALUE "InternalName", RSTR_PSM "\0"
      VALUE "LegalCopyright", "Copyright (c) 2000-2013 The Apache Software Foundation.\0"
      VALUE "OriginalFilename", "prunmgr.exe\0"
      VALUE "ProductName", RSTR_PSM "\0"
      VALUE "ProductVersion", PRG_VERSION
    END
  END
  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x409, 1200
  END
END

