Keep Window Looking Active?

You don't say what language you are working in or whether this is managed or unmanaged code For C++ unmanaged code, you just handle the WM_NCACTIVATE message and force it to always seem active, like this: case WM_NCACTIVATE: { // wParam tells us whether we are active or inactive, but we are going to ignore // that and always pass active down to DefWindowProc so it will draw us active. DefWindowProc(hwnd, uMsg, TRUE, lParam); //return FALSE; // returning false here prevents actual deactivation return TRUE; // return true allows deactivation (even though we draw as active) } break edit: the solution in delphi code (moved from comment to make it more readable) procedure TForm1. WndProc(var Message: TMessage); begin inherited; if (Message.

Msg = WM_NCACTIVATE) then begin DefWindowProc(handle, Message. Msg, 1, Message. LParam ); Message.

Result := 1; end; end.

You don't say what language you are working in or whether this is managed or unmanaged code. For C++ unmanaged code, you just handle the WM_NCACTIVATE message and force it to always seem active, like this: case WM_NCACTIVATE: { // wParam tells us whether we are active or inactive, but we are going to ignore // that and always pass active down to DefWindowProc so it will draw us active. DefWindowProc(hwnd, uMsg, TRUE, lParam); //return FALSE; // returning false here prevents actual deactivation return TRUE; // return true allows deactivation (even though we draw as active) } break; edit: the solution in delphi code (moved from comment to make it more readable) procedure TForm1.

WndProc(var Message: TMessage); begin inherited; if (Message. Msg = WM_NCACTIVATE) then begin DefWindowProc(handle, Message. Msg, 1, Message.

LParam ); Message. Result := 1; end; end.

THANK YOU. I've spent hours trying to solve this. I knew it would probably be something simple like a msg intercept, but I was going in circles.It's delphi code.

The key was the DefWindowProc part. Here's the fixed code: procedure TForm1. WndProc(var Message: TMessage); begin inherited; if (Message.

Msg = WM_NCACTIVATE) then begin DefWindowProc(handle, Message. Msg, 1, Message. LParam ); Message.

Result := 1; end; end; – user236291 Dec 21 '09 at 22:16 Yeah, you really REALLY don't want to get in the buisiness of drawing your own non-client area. – John Knoeller Dec 21 '09 at 22:20.

What I want to do is to have my taskbar window to always appear focused/activated. It does not need to actually be focused or activated, I just want it to look that way. You can see the effect I'm after by just putting a setforgroundwindow call in the app idle.

But I can't use that as I don't really want it grabbing the focus like that. I just want it to always look the way it does when it does have focus. I've tried all sorts of WM_XXX message calls, both trapping and sending, I've tried setwindowpos calls, and on and on.

The only thing that has worked is calling Mouse_Event(MOUSEEVENTF_LEFTDOWN and then Mouse_Event(MOUSEEVENTF_LEFTUP. I don't like this solution though as it's a really cheesy hack/workaround to what I want to do.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions