[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim-dev
Subject:    Patch 6.3b.009 (extra)
From:       Bram Moolenaar <Bram () moolenaar ! net>
Date:       2004-05-28 19:48:13
Message-ID: 200405281948.i4SJmDod013477 () moolenaar ! net
[Download RAW message or body]


Patch 6.3b.009 (extra)
Problem:    Win32: When the -P argument is not found in a window title, there
	    is no error message.
Solution:   When the window can't be found give an error message and exit.
	    Also use try/except to catch failing to open the MDI window.
	    (Michael Wookey)
Files:	    src/gui_w32.c


*** ../vim-6.3b.008/src/gui_w32.c	Sun May 16 22:38:42 2004
--- src/gui_w32.c	Fri May 28 21:46:57 2004
***************
*** 834,839 ****
--- 834,844 ----
  gui_mch_set_parent(char *title)
  {
      EnumWindows(FindWindowTitle, (LPARAM)title);
+     if (vim_parent_hwnd == NULL)
+     {
+ 	EMSG2(_("E671: Cannot find window title \"%s\""), title);
+ 	mch_exit(2);
+     }
  }
  
      static void
***************
*** 1065,1081 ****
      }
  
      if (vim_parent_hwnd != NULL)
! 	/* Open inside the specified parent window. */
! 	s_hwnd = CreateWindowEx(
! 	    WS_EX_MDICHILD,
! 	    szVimWndClass, "Vim MSWindows GUI",
! 	    WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS | 0xC000,
! 	    gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
! 	    gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
! 	    100,				/* Any value will do */
! 	    100,				/* Any value will do */
! 	    vim_parent_hwnd, NULL,
! 	    s_hinst, NULL);
      else
  	/* Open toplevel window. */
  	s_hwnd = CreateWindow(
--- 1070,1106 ----
      }
  
      if (vim_parent_hwnd != NULL)
!     {
! #ifdef HAVE_TRY_EXCEPT
! 	__try
! 	{
! #endif
! 	    /* Open inside the specified parent window.
! 	     * TODO: last argument should point to a CLIENTCREATESTRUCT
! 	     * structure. */
! 	    s_hwnd = CreateWindowEx(
! 		WS_EX_MDICHILD,
! 		szVimWndClass, "Vim MSWindows GUI",
! 		WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS | 0xC000,
! 		gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
! 		gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
! 		100,				/* Any value will do */
! 		100,				/* Any value will do */
! 		vim_parent_hwnd, NULL,
! 		s_hinst, NULL);
! #ifdef HAVE_TRY_EXCEPT
! 	}
! 	__except(EXCEPTION_EXECUTE_HANDLER)
! 	{
! 	    /* NOP */
! 	}
! #endif
! 	if (s_hwnd == NULL)
! 	{
! 	    EMSG(_("E672: Unable to open window inside MDI application"));
! 	    mch_exit(2);
! 	}
!     }
      else
  	/* Open toplevel window. */
  	s_hwnd = CreateWindow(
*** ../vim-6.3b.008/src/version.c	Fri May 28 21:41:20 2004
--- src/version.c	Fri May 28 21:42:56 2004
***************
*** 643,644 ****
--- 643,646 ----
  {   /* Add new patch number below this line */
+ /**/
+     9,
  /**/

-- 
It's totally unfair to suggest - as many have - that engineers are socially
inept.  Engineers simply have different objectives when it comes to social
interaction.
				(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic