]> cygwin.com Git - cygwin-apps/cygutils.git/commitdiff
Add -s option to mkshortcut
authorCharles Wilson <cygwin@cwilson.fastmail.fm>
Sat, 14 Feb 2004 23:34:57 +0000 (23:34 +0000)
committerCharles Wilson <cygwin@cwilson.fastmail.fm>
Sat, 14 Feb 2004 23:34:57 +0000 (23:34 +0000)
ChangeLog
NEWS
configure.ac
src/mkshortcut/mkshortcut.1
src/mkshortcut/mkshortcut.c

index 193f0115a537270113031c3147422db7383605cd..05177e21c1c0a0e79c73922916fb815b908a41e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-02-14  Dick Repansky  <rrepasky@....>
+            Joshua Danial Franklin  <joshuadfranklin@....>
+
+       * 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  <cwilson@....>
 
        bump version number
diff --git a/NEWS b/NEWS
index 7d7a8dc3b0294cb41b428dccf3004c54b5f90258..d1794fc362b5f10acc36cf9701432fdfa3286b8f 100644 (file)
--- 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
index 3cbafe76af7337f5d71e02aceecbeba2682cacb7..86cf06afed1905df1559be5a63c7b0ba2d95f008 100644 (file)
@@ -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])
index 159ea0933201b381374d8711345d5c470df75623..0a76e0e94ef7de617ef61e4936a157303596dc92 100644 (file)
@@ -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).
index e7459a5500432fadc5cda0f2c64b6aa3a04db410..428a132376864c60f74fe40a6244abfaecc4fe56 100644 (file)
@@ -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 =
This page took 0.034318 seconds and 5 git commands to generate.