diff options
author | Bram Moolenaar <Bram@vim.org> | 2007-08-30 10:26:19 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2007-08-30 10:26:19 +0000 |
commit | 78e1762c4888f5faf3920f01bcc94d8c1b8adb3a (patch) | |
tree | 155463ad46bcc256f96a9c8a839ff287868eff51 /src/gui_w32.c | |
parent | 1a3d086c84dad1f52b623cda1bfe36d88d8cfd9a (diff) | |
download | vim-git-78e1762c4888f5faf3920f01bcc94d8c1b8adb3a.tar.gz |
updated for version 7.1-091v7.1.091
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r-- | src/gui_w32.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c index 092d8d516..bcc1524a9 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -23,6 +23,8 @@ * e.g., replace LONG with LONG_PTR, etc. */ +#include "vim.h" + /* * These are new in Windows ME/XP, only defined in recent compilers. */ @@ -1432,16 +1434,29 @@ gui_mch_init(void) } } else - /* Open toplevel window. */ + { + /* If the provided windowid is not valid reset it to zero, so that it + * is ignored and we open our own window. */ + if (IsWindow((HWND)win_socket_id) <= 0) + win_socket_id = 0; + + /* Create a window. If win_socket_id is not zero without border and + * titlebar, it will be reparented below. */ s_hwnd = CreateWindow( - szVimWndClass, "Vim MSWindows GUI", - WS_OVERLAPPEDWINDOW, - 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 */ - NULL, NULL, - s_hinst, NULL); + szVimWndClass, "Vim MSWindows GUI", + win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP, + 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 */ + NULL, NULL, + s_hinst, NULL); + if (s_hwnd != NULL && win_socket_id != 0) + { + SetParent(s_hwnd, (HWND)win_socket_id); + ShowWindow(s_hwnd, SW_SHOWMAXIMIZED); + } + } if (s_hwnd == NULL) return FAIL; |