From: Ben Straub <ben@straubnet.net>
To: emacs-devel@gnu.org
Subject: Re: Windows 7 Application Identifier
Date: Sun, 24 May 2009 13:42:01 -0700 [thread overview]
Message-ID: <678df55a0905241342x31b9d3ecx4066e9b0f43a7701@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 480 bytes --]
Apologies for the poor formatting of my last message, and also for the
dirty patch. Please review this patch instead, it's cleaner.
Also, it should be noted that this patch isn't a complete solution;
the real problem is that the start-menu shortcut that's pinned to the
taskbar doesn't have the correct AppID embedded. But this patch will
ensure that emacs and emacsclient(w) will stack while they're running,
and gives us a string to match when modifying that shortcut.
-- Ben
[-- Attachment #2: win7appid.patch --]
[-- Type: application/octet-stream, Size: 2405 bytes --]
From f235d4d6d08795c69778390887a80f479d717495 Mon Sep 17 00:00:00 2001
From: unknown <Ben@.(none)>
Date: Sun, 24 May 2009 13:38:48 -0700
Subject: [PATCH] Now setting AppID on Windows 7.
---
lib-src/emacsclient.c | 16 ++++++++++++++++
src/w32term.c | 18 ++++++++++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index a451c1b..33b5602 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -39,6 +39,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# define CLOSE_SOCKET closesocket
# define INITIALIZE() (initialize_sockets ())
+/* Setting AppID for Windows 7 */
+HRESULT (*pfnSetAppID)(PCWSTR);
+
#else /* !WINDOWSNT */
# include "syswait.h"
@@ -1498,6 +1501,19 @@ main (argc, argv)
char string[BUFSIZ+1];
int null_socket_name, null_server_file, start_daemon_if_needed;
+ /* Set AppID so our icons stack on emacsclient's on Windows 7 */
+ {
+ /* HRESULT SetCurrentProcessExplicitAppUserModelID(PCWSTR AppID); */
+ HANDLE shell_lib = LoadLibrary ("shell32.dll");
+ pfnSetAppID = (void*)
+ GetProcAddress(shell_lib, "SetCurrentProcessExplicitAppUserModelID");
+ if (pfnSetAppID)
+ {
+ pfnSetAppID(L"GNU.Emacs");
+ }
+ FreeLibrary(shell_lib);
+ }
+
main_argv = argv;
progname = argv[0];
diff --git a/src/w32term.c b/src/w32term.c
index f38895b..b2bf698 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -140,6 +140,10 @@ typedef struct tagGLYPHSET
/* Dynamic linking to SetLayeredWindowAttribute (only since 2000). */
BOOL (PASCAL *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
+/* Setting AppID for Windows 7 */
+HRESULT (*pfnSetAppID)(PCWSTR);
+
+
#ifndef LWA_ALPHA
#define LWA_ALPHA 0x02
#endif
@@ -6399,6 +6403,20 @@ w32_initialize ()
vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border
= GetSystemMetrics (SM_CYVSCROLL);
}
+
+ /* Set AppID so our icons stack on emacsclient's on Windows 7 */
+ {
+ /* HRESULT SetCurrentProcessExplicitAppUserModelID(PCWSTR AppID); */
+ HANDLE shell_lib = LoadLibrary ("shell32.dll");
+ pfnSetAppID = (void*)
+ GetProcAddress(shell_lib, "SetCurrentProcessExplicitAppUserModelID");
+ if (pfnSetAppID)
+ {
+ pfnSetAppID(L"GNU.Emacs");
+ }
+ FreeLibrary(shell_lib);
+ }
+
}
void
--
1.6.3.msysgit.0
next reply other threads:[~2009-05-24 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-24 20:42 Ben Straub [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-05-24 16:01 Windows 7 Application Identifier Ben Straub
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=678df55a0905241342x31b9d3ecx4066e9b0f43a7701@mail.gmail.com \
--to=ben@straubnet.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.