
 NT Emacs Utility Program - EMWINMSG.EXE

 Author:      Theodore A. Jump (tjump@spgs.com)

 Revision:    1.0 (8/5/97)
              1.1 (8/6/97) - takes window handle as decimal string
                             argument, emwinmsg.el created, Cygnus
                             GNU-Win32+MinGW32 build included.

 Usage (hard):(shell-command (format "%s/emwinmsg.exe SHOW maximize"
                              (getenv "emacs_dir")
                             ))

 Usage (easy):(win32-maximize-frame)
                <or>
              (win32-minimize-frame)
                <or>
              (win32-restore-frame)

 Install:     Put EMWINMSG.EXE in your %EMACS_DIR%/bin directory.
              Put EMWINMSG.ELC in your load path.
              add a "(load "emwinmsg")" to your .emacs

 Building:    You will need a Microsoft NMAKE driven compiler for
              Win32, it should work with either MSVC 4.x or 5.x. The
              only thing you should have to do is the following
              (assuming you have the proper environment variables
              set for using the compiler from the command line):

              nmake /f nmake.mak

              You may also use the Cygnus gnu-win32 compiler. I've
              included a batch file "gmake.bat" which does just that
              with the B18 version of Cygnus Gnu-Win32. I also have
              Colin Peters' MinGw32 installed and am using that to
              make possible nice, tiny, executables. ;-)

 Description: Expose the Win32 "ShowWindow" API to the elisp
              programmer.  This program currently allows elisp
              code to call upon this api to interactively operate
              on the currently visible emacs frame.

              I built this so that I could call if near the end of
              my .emacs file to maximize my NTemacs frame. ;-)

              The currently supported options are:

                  hide            SW_HIDE
                  maximize        SW_MAXIMIZE
                  minimize        SW_MINIMIZE
                  restore         SW_RESTORE
                  show            SW_SHOW
                  showdefault     SW_SHOWDEFAULT
                  showmaximized   SW_SHOWMAXIMIZED
                  showminimized   SW_SHOWMINIMIZED
                  showminnoactive SW_SHOWMINNOACTIVE
                  showna          SW_SHOWNA
                  shownoactivate  SW_SHOWNOACTIVATE
                  normal          SW_SHOWNORMAL

 Limitations: I have no idea what will happen when you have multiple
              frames on display, I'm guessing that emwinmsg will get
              the first that was created but there's no guarantee.

              The above is only pertinent if EMWINMSG.EXE has to do
              a FindWindow(), if you pass it an explicit frame HWND
              then you should be okay. The three functions in
              EMWINMSG.EL operate on the currently selected frame.

              It's an obvious future extension (to me) to add
              optional parameters to the functions in EMWINMSG.EL,
              but since it does what I need right now I won't be
              doing that immediately.

 Other Notes: IF there was a way for elisp code to change the Win32
              window caption to something specific, it would then be
              trivial to modify emwinmsg to search for a window with
              a specific name with which to interact. Currently it
              locates a window of class "Emacs" just like the ehelp
              utility previously published.

              Addendum: The preferred method, which is used in
              EMWINMSG.EL, is to identify the target frame by
              window handle value.  Modifying EMWINMSG.C to take
              a title STILL wouldn't be hard, but I've no need of
              it at ALL now so you'll have to sell me a good case
              to get me to do it. Sorry. ;-)

              I've included built executables made with both
              Microsoft VC 5 and the Cygnus GNU-Win32 port (with
              Colin Peters' addition of mingw32).  Why? I'm working
              slowly on doing more things with the gnu toolset. Why
              the mingw32 rev? So cygwin.dll isn't required.  The
              upshot of this is that the gnu version is smaller and
              does not require anything outside of the core Win32
              OS DLLs for support.  The VC 5 build is for those
              who don't want to use an exe built by a non-beta
              compiler.  Don't know why you'd care if you're into
              emacs to begin with, but WTH.  I'm using the gnu
              build myself ...

 Elisp code to put into your .emacs ... ;-)

              ... moved into EMWINMSG.EL.

 Thanks To:   Andrew Innes <andrewi@harlequin.co.uk> - for code on
              how to get the HWND via elisp.







