• Re: How *not* to get focus when clicking a systray icon ?

    From Jakob Bohm@egenagwemdimtapsar@jbohm.dk to comp.os.ms-windows.programmer.win32,alt.windows7.general on Sun Aug 17 22:48:18 2025
    From Newsgroup: alt.windows7.general

    On 2025-07-06 10:04, R.Wieser wrote:
    JJ,

    I've written a program with a systray icon, and whenever I click
    the systray icon the program currently having focus looses it.
    Is there a way to stop this behaviour ?

    Try not letting the system handle WM_ACTIVATEAPP message if it's
    deactivating the current application window.

    ? Are you suggesting I should try to intercept messages *outside* of my program with its system-tray icon ?


    I believe this meant not passing that message from your assembler window function to the DefWindowProc API.

    Another approach would be to have a different thread own the handles and message queue for your tray icon, thus preventing implicit tray icon
    logic from activating your real main window .

    Enjoy

    Jakob
    --
    Jakob Bohm, MSc.Eng., I speak only for myself, not my company
    This public discussion message is non-binding and may contain errors
    All trademarks and other things belong to their owners, if any.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From R.Wieser@address@is.invalid to comp.os.ms-windows.programmer.win32,alt.windows7.general on Mon Aug 18 08:39:08 2025
    From Newsgroup: alt.windows7.general

    Jakob,

    Try not letting the system handle WM_ACTIVATEAPP message if it's
    deactivating the current application window.

    ? Are you suggesting I should try to intercept messages *outside* of my
    program with its system-tray icon ?

    I believe this meant not passing that message from your assembler window function to the DefWindowProc API.

    That was how I first took it. But as far as I know that means that the app won't respond to any kind of mouse-prodding anymore, not even to (trying to) click its "close" button. :-(

    Regards,
    Rudy Wieser


    --- Synchronet 3.21a-Linux NewsLink 1.2