Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - Problems with WM_UPDATEUISTATE
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problems with WM_UPDATEUISTATE

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 891
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Problems with WM_UPDATEUISTATE
    Posted: 05 December 2012 at 3:02pm
For a long time I have struggled with MFC dialog boxes that we insert into a task panel group that has buttons on it. We use the CXTButton class and the issue I have is with the focus rectangle not drawing or with inconsistent drawing.

I have found that previously that the UISF_HIDEFOCUS flag gets cleared and so my "fix" is to try and isolate a good code location to send the WM_UPDATEUISTATE message to the button using MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS) and a 0 LPARAM. That clears the bit. This has mostly worked but now with the version 15.1.3, I am having the issue again.

So in my OnEraseBkgnd handler, I do this:

SendMessage(WM_UPDATEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0);

TO make matters worse, I have previously found that on some machines, when I do that, another display is immediately initiated so I wrapped the code up to stop the display chain:

                    static int s_UpdatingUIState = 0;

                    if( 0 == s_UpdatingUIState )
                    {
                         s_UpdatingUIState = 1;
                         SendMessage(WM_UPDATEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0);
                         s_UpdatingUIState = 0;
                    }

That was working but now it is not working. Again I am in a constant state of displays unless I remove that code.

So I searched the CJ code base we have an I see that CodeJock now has two XTButton.cpp files. One is in Controls\Deprecated\XTButton.cpp and the other in Controls\Button\XTPButton.cpp.

I set a break in both and I see that we are using the "deprecated" one. Also, in the deprecated code, I see CJ calling Inalidate(FALSE) while in the other file (non-deprecated) I see CJ calling RedrawButton.

So, I have a some questions for the CodeJock developers.

Why did you change the CXTButton:LOnUpdateUIState code to call RedrawButton when this message handler is called?

Should I be doing something to make sure I am not using the "deprecated" source file?

How might the focus rect display keep getting turned off?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.