Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WM_ACTIVATE question

WM_ACTIVATE question

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++comjsonhelp
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Axonn Echysttas
    wrote on last edited by
    #1

    Hi everybody. I'm wondering if there is a way to work around the WM_ACTIVATE message. I want to disable a window so that when the user clicks on it, it won't come in the foreground. Unfortunately, the DisableWindow() API is not good because when clicking a disabled window you get that annoying sound on some systems (default sound that Windows makes). So is there any other way? I tried messing with the parameters of WM_ACTIVATE before caling the DefWindowProc but it seems to be of no help. Apparently the kernel moves the window to foreground regardless and simply notifies me, the user. I can send it back to the background if I wish, but that causes an annoying visual effect each time the window is clicked... a sort of flicker. -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    M T S 3 Replies Last reply
    0
    • A Axonn Echysttas

      Hi everybody. I'm wondering if there is a way to work around the WM_ACTIVATE message. I want to disable a window so that when the user clicks on it, it won't come in the foreground. Unfortunately, the DisableWindow() API is not good because when clicking a disabled window you get that annoying sound on some systems (default sound that Windows makes). So is there any other way? I tried messing with the parameters of WM_ACTIVATE before caling the DefWindowProc but it seems to be of no help. Apparently the kernel moves the window to foreground regardless and simply notifies me, the user. I can send it back to the background if I wish, but that causes an annoying visual effect each time the window is clicked... a sort of flicker. -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

      M Offline
      M Offline
      Mahesh Kulkarni
      wrote on last edited by
      #2

      If you want to show/hide window. Then why don't you try ShowWindow()API. SW_HIDE - For Hiding window SW_SHOW - For Showing it. The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

      A 1 Reply Last reply
      0
      • A Axonn Echysttas

        Hi everybody. I'm wondering if there is a way to work around the WM_ACTIVATE message. I want to disable a window so that when the user clicks on it, it won't come in the foreground. Unfortunately, the DisableWindow() API is not good because when clicking a disabled window you get that annoying sound on some systems (default sound that Windows makes). So is there any other way? I tried messing with the parameters of WM_ACTIVATE before caling the DefWindowProc but it seems to be of no help. Apparently the kernel moves the window to foreground regardless and simply notifies me, the user. I can send it back to the background if I wish, but that causes an annoying visual effect each time the window is clicked... a sort of flicker. -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        Axonn Echysttas wrote:

        So is there any other way? I tried messing with the parameters of WM_ACTIVATE before caling the DefWindowProc but it seems to be of no help. Apparently the kernel moves the window to foreground regardless and simply notifies me, the user. I can send it back to the background if I wish, but that causes an annoying visual effect each time the window is clicked... a sort of flic

        What about simply returining form Window OnClick message!

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV

        A 1 Reply Last reply
        0
        • M Mahesh Kulkarni

          If you want to show/hide window. Then why don't you try ShowWindow()API. SW_HIDE - For Hiding window SW_SHOW - For Showing it. The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

          A Offline
          A Offline
          Axonn Echysttas
          wrote on last edited by
          #4

          I want to hide it under another, not completely ::- ). -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

          1 Reply Last reply
          0
          • T ThatsAlok

            Axonn Echysttas wrote:

            So is there any other way? I tried messing with the parameters of WM_ACTIVATE before caling the DefWindowProc but it seems to be of no help. Apparently the kernel moves the window to foreground regardless and simply notifies me, the user. I can send it back to the background if I wish, but that causes an annoying visual effect each time the window is clicked... a sort of flic

            What about simply returining form Window OnClick message!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV

            A Offline
            A Offline
            Axonn Echysttas
            wrote on last edited by
            #5

            This is not an MFC application. As for returning from WM_LBUTTONDOWN or WM_LBUTTONUP, it ain't helpin'. When I press the button on the window, it jumps back in the foreground. I want it to stay back, just like it would be disabled. Practically, I want a disabled window, but without that sound that the system makes on usually disabled windows. -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

            1 Reply Last reply
            0
            • A Axonn Echysttas

              Hi everybody. I'm wondering if there is a way to work around the WM_ACTIVATE message. I want to disable a window so that when the user clicks on it, it won't come in the foreground. Unfortunately, the DisableWindow() API is not good because when clicking a disabled window you get that annoying sound on some systems (default sound that Windows makes). So is there any other way? I tried messing with the parameters of WM_ACTIVATE before caling the DefWindowProc but it seems to be of no help. Apparently the kernel moves the window to foreground regardless and simply notifies me, the user. I can send it back to the background if I wish, but that causes an annoying visual effect each time the window is clicked... a sort of flicker. -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

              S Offline
              S Offline
              SimonSays
              wrote on last edited by
              #6

              Does creating it with WS_EX_NOACTIVATE help?

              A 1 Reply Last reply
              0
              • S SimonSays

                Does creating it with WS_EX_NOACTIVATE help?

                A Offline
                A Offline
                Axonn Echysttas
                wrote on last edited by
                #7

                Not really. But thanks anyway. I found the solution. If anybody is interested, here is the answer: On WM_MOUSEACTIVATE return MA_NOACTIVATE; On WM_ACTIVATE return 1. Do not call DefWindowProc (in both cases). -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups