Windows 8 title bars inconsistent in embedded dialogs
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Windows 8 title bars inconsistent in embedded dialogs

  1. #1
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,228

    Windows 8 title bars inconsistent in embedded dialogs

    I have an SDI app created with VC2012. Main view is a CFormView and it's the parent to four embedded dialogs. All four dialogs have title bars. On three of them, the title bars looks as I'd expect. Normal size, text left justified. On the fourth, the title bar is noticeably thicker and the text is centered. All styles are the same as far as I can tell. The main difference is the one that's acting up has a browser control on it, the others just standard controls. It looks normal on Windows 7. Anybody know how to make the fourth look like the others.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,473

    Re: Windows 8 title bars inconsistent in embedded dialogs

    Can you temporarily remove the browser control and retry?

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,473

    Re: Windows 8 title bars inconsistent in embedded dialogs

    Also, can you check the styles at runtime with Spy++ to make sure they haven't been dynamically changed?

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,228

    Re: Windows 8 title bars inconsistent in embedded dialogs

    I found that adding WS_EX_LEFT to the dialog with the browser made it behave properly. Not sure why that was necessary, but it fixed it.

  5. #5
    Join Date
    Nov 2013
    Posts
    2

    Re: Windows 8 title bars inconsistent in embedded dialogs

    I had the same strange issue a few weeks back

  6. #6
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,059

    Re: Windows 8 title bars inconsistent in embedded dialogs

    Quote Originally Posted by GCDEF View Post
    I found that adding WS_EX_LEFT to the dialog with the browser made it behave properly. Not sure why that was necessary, but it fixed it.
    I'm wondering how can it fix the problem, as long as WS_EX_LEFT has the value 0x00000000L (zero).
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,228

    Re: Windows 8 title bars inconsistent in embedded dialogs

    Quote Originally Posted by ovidiucucu View Post
    I'm wondering how can it fix the problem, as long as WS_EX_LEFT has the value 0x00000000L (zero).
    I have no clue, but it's working now so I didn't dwell on it.

  8. #8
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,842

    Re: Windows 8 title bars inconsistent in embedded dialogs

    As WS_EX_LEFT indeed has a value of 0, then or'ing it into the dialog style along with the other required styles will have no logical effect. However, as you are experiencing some effect (ie the problem 'disppears') IMO the only possibilities are
    1) on your system/compiler/version WS_EX_LEFT is not 0
    2) without it the compiler is generating 'wrong code' which is fixed when or'ing in the constant
    3) you have a memory corruption problem which is being 'masked' by the extra instructions generated for the constant or'ing

    As other gurus have stated on these forums, just changing some code to 'make the problem go away' is no solution until the reason why the code change works is understood.
    Last edited by 2kaud; November 19th, 2013 at 09:01 AM.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,228

    Re: Windows 8 title bars inconsistent in embedded dialogs

    Quote Originally Posted by 2kaud View Post
    As WS_EX_LEFT indeed has a value of 0, then or'ing it into the dialog style along with the other required styles will have no logical effect. However, as you are experiencing some effect (ie the problem 'disppears') IMO the only possibilities are
    1) on your system/compiler/version WS_EX_LEFT is not 0
    2) without it the compiler is generating 'wrong code' which is fixed when or'ing in the constant
    3) you have a memory corruption problem which is being 'masked' by the extra instructions generated for the constant or'ing

    As other gurus have stated on these forums, just changing some code to 'make the problem go away' is no solution until the reason why the code change works is understood.
    I don't believe it's #3. It was only on one Windows 8 computer. I was trying a lot of style stuff to make it go away. It's possible I did something else too, but at this point I don't really care. Sometimes it's nice to know why something was fixed, other times it's not worth the effort. I'm going with the latter in this case. The actual dialog itself does almost nothing. It's just window to hold the browser control.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center