aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 209e86edc8b..c3cfc341169 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -138,7 +138,7 @@ typedef struct tagGLYPHSET
138#endif 138#endif
139 139
140/* Dynamic linking to SetLayeredWindowAttribute (only since 2000). */ 140/* Dynamic linking to SetLayeredWindowAttribute (only since 2000). */
141BOOL (PASCAL *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD); 141BOOL (WINAPI *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
142 142
143#ifndef LWA_ALPHA 143#ifndef LWA_ALPHA
144#define LWA_ALPHA 0x02 144#define LWA_ALPHA 0x02
@@ -6340,6 +6340,9 @@ DWORD WINAPI w32_msg_worker (void * arg);
6340static void 6340static void
6341w32_initialize () 6341w32_initialize ()
6342{ 6342{
6343 HANDLE shell;
6344 HRESULT (WINAPI * set_user_model) (PCWSTR);
6345
6343 baud_rate = 19200; 6346 baud_rate = 19200;
6344 6347
6345 w32_system_caret_hwnd = NULL; 6348 w32_system_caret_hwnd = NULL;
@@ -6347,6 +6350,25 @@ w32_initialize ()
6347 w32_system_caret_x = 0; 6350 w32_system_caret_x = 0;
6348 w32_system_caret_y = 0; 6351 w32_system_caret_y = 0;
6349 6352
6353 /* On Windows 7 and later, we need to set the user model ID
6354 to associate emacsclient launched files with Emacs frames
6355 in the UI. */
6356 shell = GetModuleHandle ("shell32.dll");
6357 if (shell)
6358 {
6359 set_user_model
6360 = (void *) GetProcAddress (shell,
6361 "SetCurrentProcessExplicitAppUserModelID");
6362
6363 /* If the function is defined, then we are running on Windows 7
6364 or newer, and the UI uses this to group related windows
6365 together. Since emacs, runemacs, emacsclient are related, we
6366 want them grouped even though the executables are different,
6367 so we need to set a consistent ID between them. */
6368 if (set_user_model)
6369 set_user_model (L"GNU.Emacs");
6370 }
6371
6350 /* Initialize w32_use_visible_system_caret based on whether a screen 6372 /* Initialize w32_use_visible_system_caret based on whether a screen
6351 reader is in use. */ 6373 reader is in use. */
6352 if (!SystemParametersInfo (SPI_GETSCREENREADER, 0, 6374 if (!SystemParametersInfo (SPI_GETSCREENREADER, 0,
@@ -6400,7 +6422,7 @@ w32_initialize ()
6400 6422
6401 /* Dynamically link to optional system components. */ 6423 /* Dynamically link to optional system components. */
6402 { 6424 {
6403 HANDLE user_lib = LoadLibrary ("user32.dll"); 6425 HMODULE user_lib = GetModuleHandle ("user32.dll");
6404 6426
6405#define LOAD_PROC(lib, fn) pfn##fn = (void *) GetProcAddress (lib, #fn) 6427#define LOAD_PROC(lib, fn) pfn##fn = (void *) GetProcAddress (lib, #fn)
6406 6428
@@ -6408,8 +6430,6 @@ w32_initialize ()
6408 6430
6409#undef LOAD_PROC 6431#undef LOAD_PROC
6410 6432
6411 FreeLibrary (user_lib);
6412
6413 /* Ensure scrollbar handle is at least 5 pixels. */ 6433 /* Ensure scrollbar handle is at least 5 pixels. */
6414 vertical_scroll_bar_min_handle = 5; 6434 vertical_scroll_bar_min_handle = 5;
6415 6435