TaskBar at Window?

Hello,

I know there exists a msg called ABN_STATECHANE to allow us to notify the taskbar's autohide or always-on-top state has been changed.

However, I don't know to how to catch this msg in my application. Until now, I have tried to catch this msg at the function PreTranslateMessage()  but it is not successfully.

I have read some articles which have pointed out that I can catch this msg at the window proc. What is window Procedure? How can I use this function?

Thanks!
cplauAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vinayak KumbarSr Program ManagerCommented:
Hi,

I dont know how exactly u can map that message :-(

But U can put the following code to check the state of the task bar. U can put it in timer or thread to continously monitor the state.

APPBARDATA appbardata;      
appbardata.cbSize = sizeof(APPBARDATA);

UINT state = (UINT)SHAppBarMessage(ABM_GETSTATE , &appbardata);

if(state == ABS_ALWAYSONTOP)
      AfxMessageBox("ABS_ALWAYSONTOP");
else if(state == ABS_AUTOHIDE )
      AfxMessageBox("ABS_AUTOHIDE");
else if(state == 3 )
      AfxMessageBox("ABS_AUTOHIDE and ABS_ALWAYSONTOP");

Try it out.
0
captainkirkCommented:
The Window procedure is defined like this:

LRESULT CYourClass::WindowProc(UINT message, WPARAM wParam, LPARAM lParam;

Just override WindowProc and then you can check the message parameter for ABN_STATECHANGE...

let me know if that works for you...
0
chensuCommented:
ABN_STATECHANE is a notification message only sent to an appbar. When using ABM_NEW to register a new appbar, you specify the message identifier that the system should use to send the notification messages, of which the wParam parameter is the notification code, such as ABN_STATECHANGE. You may use Spy++ on a top-level window to verify it. When the Auto hide state of the taskbar is changed, only a WM_SETTINGCHANGE message with SPI_SETWORKAREA is sent.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
captainkirkCommented:
That's true - I should have been more clear - the application window can't be any old window - it has to be an appbar. the WM_SETTINGCHANGE message is sent to all top level windows when a system setting has changed - you can't just send this message directly to any window, either.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.