updated for version 7.0c
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 12d6071..b25f50d 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -297,6 +297,10 @@
 static int get_toolbar_bitmap(vimmenu_T *menu);
 #endif
 
+#ifdef FEAT_GUI_TABLINE
+static void initialise_tabline(void);
+#endif
+
 #ifdef FEAT_MBYTE_IME
 static LRESULT _OnImeComposition(HWND hwnd, WPARAM dbcs, LPARAM param);
 static char_u *GetResultStr(HWND hwnd, int GCS, int *lenp);
@@ -760,10 +764,11 @@
     case WM_SETTINGCHANGE:
 	return _OnSettingChange((UINT)wParam);
 
-#ifdef FEAT_TOOLBAR
+#if defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)
     case WM_NOTIFY:
 	switch (((LPNMHDR) lParam)->code)
 	{
+# ifdef FEAT_TOOLBAR
 	    case TTN_NEEDTEXT:
 		{
 		    LPTOOLTIPTEXT	lpttt;
@@ -785,7 +790,20 @@
 		    }
 		}
 		break;
+# endif
+# ifdef FEAT_GUI_TABLINE
+	    case TCN_SELCHANGE:
+		if (gui_mch_showing_tabline()
+				  && ((LPNMHDR)lParam)->hwndFrom == s_tabhwnd)
+		    send_tabline_event(TabCtrl_GetCurSel(s_tabhwnd) + 1);
+		break;
+# endif
 	    default:
+# ifdef FEAT_GUI_TABLINE
+		if (gui_mch_showing_tabline()
+				  && ((LPNMHDR)lParam)->hwndFrom == s_tabhwnd)
+		    return MyWindowProc(hwnd, uMsg, wParam, lParam);
+# endif
 		break;
 	}
 	break;
@@ -831,6 +849,19 @@
 	    result = MyWindowProc(hwnd, uMsg, wParam, lParam);
 	    if (result == HTCLIENT)
 	    {
+#ifdef FEAT_GUI_TABLINE
+		if (gui_mch_showing_tabline())
+		{
+		    int  yPos = GET_Y_LPARAM(lParam);
+		    RECT rct;
+
+		    /* If the cursor is on the GUI tabline, don't process this
+		     * event */
+		    GetWindowRect(s_textArea, &rct);
+		    if (yPos < rct.top)
+			return result;
+		}
+#endif
 		gui_mch_get_winpos(&x, &y);
 		xPos -= x;
 
@@ -1280,6 +1311,12 @@
      */
     initialise_toolbar();
 #endif
+#ifdef FEAT_GUI_TABLINE
+    /*
+     * Create the tabline
+     */
+    initialise_tabline();
+#endif
 #ifdef MSWIN_FIND_REPLACE
     /*
      * Initialise the dialog box stuff
@@ -3884,6 +3921,18 @@
 }
 #endif
 
+#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
+    static void
+initialise_tabline(void)
+{
+    InitCommonControls();
+
+    s_tabhwnd = CreateWindow(WC_TABCONTROL, "", WS_CHILD|TCS_FOCUSNEVER,
+	    CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+	    CW_USEDEFAULT, s_hwnd, NULL, s_hinst, NULL);
+}
+#endif
+
 #if defined(FEAT_OLE) || defined(FEAT_EVAL) || defined(PROTO)
 /*
  * Make the GUI window come to the foreground.