CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    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 / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    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 / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    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,635

    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
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    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
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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

    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
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    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. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

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

    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
  •  





Click Here to Expand Forum to Full Width

Featured