Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8195583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:11:10+00:00 2026-06-07T05:11:10+00:00

I want to extend the default Speakers notificon’s (tray icon) right-click context menu with

  • 0

I want to extend the default Speakers notificon’s (tray icon) right-click context menu with a new item. Also, I want to handle the mouseclick using C++.

Illustration

enter image description here

What I know so far

I learned how to dll-inject using CreateRemoteThread(), because I think that’s the way to go. My problem is: what to do inside the injected dll? For example, how to access the NotifyIcon object?

Maybe it is possible with a simple Windows API call, but I’m not familiar with it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:11:11+00:00Added an answer on June 7, 2026 at 5:11 am

    Thanks Luke for the hint. I got it working using EasyHook. I chose it, because it also supports 64-bit dll-inject.

    DLL to inject:

    using System;
    using System.IO;
    using System.Runtime.InteropServices;
    using System.Threading;
    using EasyHook;
    namespace InjectDLL
        {
        public class Main : EasyHook.IEntryPoint
        {
            LocalHook CreateTrackPopupMenuExHook;
            public Main(RemoteHooking.IContext InContext){}
            public void Run(RemoteHooking.IContext InContext)
            {
                try
                {
                    CreateTrackPopupMenuExHook = LocalHook.Create(
                        LocalHook.GetProcAddress("user32.dll", "TrackPopupMenuEx"),
                        new DTrackPopupMenuEx(TrackPopupMenuEx_Hooked),
                        this);
                    CreateTrackPopupMenuExHook.ThreadACL.SetExclusiveACL(new Int32[] { 0 });
                }
                catch
                {
                    return;
                }
                while (true)
                {
                    Thread.Sleep(500);
                }
            }
    
            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern bool AppendMenu(IntPtr hMenu, long uFlags, int uIDNewItem, string lpNewItem);
    
            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
            static extern IntPtr TrackPopupMenuEx(
                IntPtr hMenu,
                uint fuFlags,
                int x,
                int y,
                IntPtr hwnd,
                IntPtr lptpm);
    
            [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Auto, SetLastError = true)]
            delegate IntPtr DTrackPopupMenuEx(
                IntPtr hMenu,
                uint fuFlags,
                int x,
                int y,
                IntPtr hwnd,
                IntPtr lptpm);
    
            const long MF_STRING = 0x00000000L;
            const long MF_SEPARATOR = 0x00000800L;
    
            static IntPtr TrackPopupMenuEx_Hooked(
                IntPtr hMenu,
                uint fuFlags,
                int x,
                int y,
                IntPtr hwnd,
                IntPtr lptpm)
            {
                IntPtr returnValue = IntPtr.Zero;
                try
                {
                        //Separator
                        AppendMenu(hMenu, MF_SEPARATOR, 0, null);
                        //New menu item
                        AppendMenu(hMenu, MF_STRING, 40010, "TestMenuItem");
                        //call the default procedure
                        returnValue = TrackPopupMenuEx(hMenu, fuFlags, x, y, hwnd, lptpm);
                        //our menu item is selected
                        if (returnValue == (IntPtr)40010)
                        {
                            /* CODE HERE */
                            returnValue = IntPtr.Zero;
                        }
                        return returnValue;
                }
                catch
                {
                    return;
                }
                return returnValue;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to extend the default model binding to be more smart when dealing
I created a subclass of UITextView and now I want to extend the default
I want to extend the default behavior of the jquery accordion and add a
If I create a class that extends UserControl and want to set a default
I want to extend RuntimeException to create this specific exception: class CompileLinkException extends RuntimeException
I want to extend Ion Auth to only allow certain email addresses to register.
I want to extend a web server which is only able to handle RPC
I want to extend the IEnumerable class but only for types that can be
I want to extend the functionality of a part of a program that I'm
I have a class PlaylistTrack that I want to extend class Song. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.