none
Tracking Rectangle doesn't draw correctly when moving toolbar in Windows 7.

    Question

  • I have a dockable toolbar. When moving the floating toolbar, a gray tracking rectangle shows the user where the window will be positioned when the left mouse button is released.  I have overridden the drawing of the CDockBar's background color via 

    BOOL CMyDockBar::OnEraseBkgnd(CDC* pDC)

    (For more information, see this thread.)

    Everything works correctly on Windows 8. However, on Windows 7, the gray tracking rectangle leaves many artifacts when dragging the window. It looks like the tracking rectangle isn't being invalidated correctly (it doesn't erase) on Windows 7 but I'm not sure where to look/how to correct this.

    How can force this tracking rectangle to invalidate when dragging the toolbar window?

    Wednesday, September 23, 2015 3:47 PM

All replies

  • Everything works correctly on Windows 8. However, on Windows 7, the gray tracking rectangle leaves many artifacts when dragging the window. It looks like the tracking rectangle isn't being invalidated correctly (it doesn't erase) on Windows 7 but I'm not sure where to look/how to correct this.

    How can force this tracking rectangle to invalidate when dragging the toolbar window?

    On my side, my test sample has the same gray  tracking rectangle both in windows 8.1 and windows 7. It would better that you have a sample to reproduce this issue, you could share the sample in some public place like OneDrive.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, September 24, 2015 5:50 AM
  • Make sure you are using Window basic theme in case of window 7 ,may be your are using some other theme which are creating issue here .

    Thanks


    Rupesh Shukla

    Thursday, September 24, 2015 2:55 PM
  • Thanks for your time and for the reply.

    I wish I could post some sample code reproducing the problem. As it stands,  the legacy application in question was written in the late 90's when custom control bars were all the rage. The control bars are heavily subclassed and I would need to post a vast amount of code just to reproduce the problem.

    There is no question the cause of this tracker issue lies in the custom control bar code.

    Taking a step back -- I have a question about the gray tracking rectangle (is that the proper term?).  If I want to control that rectangle, (e.g. change its color, make it blink, etc.) where would I look? What class would I override?

    If I can grab control of that tracking rectangle, I think I could easily track down the issue.  For now, I'm really not sure where to look as I don't know the technical term for it. Thanks.

    Thursday, September 24, 2015 10:29 PM
  • You need to narrow down this issue by making some test.  For example, try to exclude Windows theme factor, make a sample without subclassed and check if this issue persist. If not, this issue should caused by other part code, then do a further test to narrow the scope.

    I cannot find there is a function can overrided and control the gray tracking rectangle. Usually this should depend on how system handle windows move. For example, a common windows can show windows content when dragging if  you use SystemParametersInfo with SPI_SETDRAGFULLWINDOWS (control panel-> display->system properties->performance setting->check show windows content when dragging).


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Shu 2017 Friday, September 25, 2015 8:13 AM
    Friday, September 25, 2015 8:12 AM