From: Charles Wilson Date: Sat, 14 Feb 2004 23:34:57 +0000 (+0000) Subject: Add -s option to mkshortcut X-Git-Tag: v1_2_6~2 X-Git-Url: https://cygwin.com/git/?a=commitdiff_plain;ds=sidebyside;h=6d007d609af40b520f070b18e8435a953e0a106e;hp=d653a3883afda7bf6eb5a0c74971d0ad0fc216a3;p=cygwin-apps%2Fcygutils.git Add -s option to mkshortcut --- diff --git a/ChangeLog b/ChangeLog index 193f011..05177e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-02-14 Dick Repansky + Joshua Danial Franklin + + * src/mkshortcut/mkshortcut.c: add -s option + to control normal|minimized|maximized state + of the launched application. + * src/mkshortcut/mkshortcut.1: document it. + * NEWS: document it + 2004-01-31 Charles Wilson bump version number diff --git a/NEWS b/NEWS index 7d7a8dc..d1794fc 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,20 @@ -1.2.3: - Bugfix for lpr - Bugfix for ipck +1.2.5: + Add new -s (startup norm|max|min mode) option for + mkshortcut + + +1.2.4: Remove ipcs, ipcrm which are now provided by cygwin itself Remove support for building ipc tools against cygipc; build only against cygserver. CygIPC versions are now (again) provided by the cygipc package itself. +1.2.3 (unreleased): + Bugfix for lpr + Bugfix for ipck + Adapt ipck for cygserver compatibility + Fix docs for mkshortcut to reflect new -w/--workingdir option + 1.2.2: Add readshortcut (Rob Siklos) Actually implement the --dos/--unix options to putclip diff --git a/configure.ac b/configure.ac index 3cbafe7..86cf06a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. -AC_PREREQ(2.57) -AC_INIT(cygutils, 1.2.3, cwilson@ece.gatech.edu) +AC_PREREQ(2.59) +AC_INIT(cygutils, 1.2.4, cwilson@ece.gatech.edu) AC_CONFIG_SRCDIR([config.h.in]) AM_INIT_AUTOMAKE AM_CONFIG_HEADER([config.h]) diff --git a/src/mkshortcut/mkshortcut.1 b/src/mkshortcut/mkshortcut.1 index 159ea09..0a76e0e 100644 --- a/src/mkshortcut/mkshortcut.1 +++ b/src/mkshortcut/mkshortcut.1 @@ -12,6 +12,7 @@ mkshortcut \- create a Windows shortcut .RB "[\-\fBa\fP \fIARGS\fP]" .RB "[\-\fBi\fP \fIiconfile\fP [\-\fBj\fP \fIINT\fP] ]" .RB "[\-\fBn\fP \fINAME\fP ]" +.RB "[\-\fBs\fP \fInorm|min|max\fP ]" .RB "[\-\fBw\fP \fIPATH\fP ]" .RB "[\-A] [\-D|\-P] \fITARGET\fP" .br @@ -44,6 +45,15 @@ Name to use for the shortcut file. Note that \fI"NAME"\fP can contain spaces, bu that case must be enclosed in quotes. The Windows extention \fB.lnk\fP is automatically appended to \fI"NAME"\fP if not present. +.TP +\fB\-s\fR, \fB\-\-show\fR=\fInorm|min|max\fP +For norm, min, and max the new window will be normal, minimized, and +maximized, respectively. Note that if you use the properties dialog to +inspect properties of shortcuts for which you request minimized windows +the dialog may indicate that normal windows will be displayed. Fortunately, +that indicator is often wrong. + + .TP \fB\-w\fR, \fB\-\-workingdir\fR=\fI"PATH"\fP PATH to use for the working directory (defaults to directory path of TARGET). diff --git a/src/mkshortcut/mkshortcut.c b/src/mkshortcut/mkshortcut.c index e7459a5..428a132 100644 --- a/src/mkshortcut/mkshortcut.c +++ b/src/mkshortcut/mkshortcut.c @@ -58,6 +58,7 @@ typedef struct optvals_s { int allusers_flag; int desktop_flag; int smprograms_flag; + int show_flag; int offset; char * name_arg; char * dir_name_arg; @@ -112,6 +113,8 @@ main (int argc, const char **argv) "offset of icon in icon file (default is 0)", NULL}, { "name", 'n', POPT_ARG_STRING, NULL, 'n', \ "name for link (defaults to TARGET)", "NAME"}, + { "show", 's', POPT_ARG_STRING, NULL, 's', \ + "window to show: normal, minimized, maximized", "norm|min|max"}, { "workingdir", 'w', POPT_ARG_STRING, NULL, 'w', \ "set working directory (defaults to directory path of TARGET)", "PATH"}, { "allusers", 'A', POPT_ARG_VAL, &(opts.allusers_flag), 1, \ @@ -154,6 +157,7 @@ main (int argc, const char **argv) opts.allusers_flag = 0; opts.desktop_flag = 0; opts.smprograms_flag = 0; + opts.show_flag = SW_SHOWNORMAL; opts.target_arg = NULL; opts.argument_arg = NULL; opts.name_arg = NULL; @@ -193,6 +197,21 @@ main (int argc, const char **argv) } } break; + case 's': if (arg = poptGetOptArg(optCon)) { + if (strcmp(arg, "min") == 0) { + opts.show_flag = SW_SHOWMINNOACTIVE; + } else if (strcmp(arg, "max") == 0) { + opts.show_flag = SW_SHOWMAXIMIZED; + } else if (strcmp(arg, "norm") == 0) { + opts.show_flag = SW_SHOWNORMAL; + } else { + fprintf(stderr, "%s: %s not valid for show window\n", + program_name, arg); + ec=2; + goto exit; + } + } + break; case 'w': if (arg = poptGetOptArg(optCon)) { if ((opts.dir_name_arg = strdup(arg)) == NULL ) { fprintf(stderr, "%s: memory allocation error\n", program_name); @@ -460,6 +479,9 @@ int mkshortcut(optvals opts, poptContext optCon) if (opts.icon_flag) shell_link->lpVtbl->SetIconLocation (shell_link, opts.icon_name_arg, opts.offset); + if (opts.show_flag != SW_SHOWNORMAL) + shell_link->lpVtbl->SetShowCmd(shell_link, opts.show_flag); + /* Make link name Unicode-compliant */ hres =