WM_ACTIVATE question
-
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 ^
-
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 ^
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.
-
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 ^
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
-
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.
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 ^
-
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
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 ^
-
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 ^
-
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 ^