summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui_w32.c8
-rw-r--r--src/os_mswin.c27
-rw-r--r--src/os_win32.c3
-rw-r--r--src/proto/os_mswin.pro1
-rw-r--r--src/version.c2
5 files changed, 40 insertions, 1 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 6948ab551..5e18e8517 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1662,6 +1662,14 @@ gui_mch_init(void)
if (s_textArea == NULL)
return FAIL;
+ /* Try loading an icon from $RUNTIMEPATH/bitmaps/vim.ico. */
+ {
+ HANDLE hIcon = NULL;
+
+ if (mch_icon_load(&hIcon) == OK && hIcon != NULL)
+ SendMessage(s_hwnd, WM_SETICON, ICON_SMALL, hIcon);
+ }
+
#ifdef FEAT_MENU
s_menuBar = CreateMenu();
#endif
diff --git a/src/os_mswin.c b/src/os_mswin.c
index b5786800e..8ad3695bd 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -928,6 +928,33 @@ check_str_len(char_u *str)
}
# endif
+/*
+ * Passed to do_in_runtimepath() to load a vim.ico file.
+ */
+ static void
+mch_icon_load_cb(char_u *fname, void *cookie)
+{
+ HANDLE *h = (HANDLE *)cookie;
+
+ *h = LoadImage(NULL,
+ fname,
+ IMAGE_ICON,
+ 64,
+ 64,
+ LR_LOADFROMFILE | LR_LOADMAP3DCOLORS);
+}
+
+/*
+ * Try loading an icon file from 'runtimepath'.
+ */
+ int
+mch_icon_load(iconp)
+ HANDLE *iconp;
+{
+ return do_in_runtimepath((char_u *)"bitmaps/vim.ico",
+ FALSE, mch_icon_load_cb, iconp);
+}
+
int
mch_libcall(
char_u *libname,
diff --git a/src/os_win32.c b/src/os_win32.c
index 7192c51a0..21c3ee9f4 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2446,7 +2446,8 @@ SaveConsoleTitleAndIcon(void)
return;
/* Extract the first icon contained in the Vim executable. */
- g_hVimIcon = ExtractIcon(NULL, exe_name, 0);
+ if (mch_icon_load((HANDLE *)&g_hVimIcon) == FAIL || g_hVimIcon == NULL)
+ g_hVimIcon = ExtractIcon(NULL, exe_name, 0);
if (g_hVimIcon != NULL)
g_fCanChangeIcon = TRUE;
}
diff --git a/src/proto/os_mswin.pro b/src/proto/os_mswin.pro
index 0d29979cf..b56ee5656 100644
--- a/src/proto/os_mswin.pro
+++ b/src/proto/os_mswin.pro
@@ -21,6 +21,7 @@ int mch_has_wildcard __ARGS((char_u *p));
int mch_chdir __ARGS((char *path));
int can_end_termcap_mode __ARGS((int give_msg));
int mch_screenmode __ARGS((char_u *arg));
+int mch_icon_load __ARGS((HANDLE *iconp));
int mch_libcall __ARGS((char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result));
void DumpPutS __ARGS((const char *psz));
int mch_get_winpos __ARGS((int *x, int *y));
diff --git a/src/version.c b/src/version.c
index 867aa7c3f..a9f83a203 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 459,
+/**/
458,
/**/
457,