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.
Re: Windows 8 title bars inconsistent in embedded dialogs
Can you temporarily remove the browser control and retry?
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?
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.
Re: Windows 8 title bars inconsistent in embedded dialogs
I had the same strange issue a few weeks back
Re: Windows 8 title bars inconsistent in embedded dialogs
Quote:
Originally Posted by
GCDEF
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). :)
Re: Windows 8 title bars inconsistent in embedded dialogs
Quote:
Originally Posted by
ovidiucucu
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.
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.
Re: Windows 8 title bars inconsistent in embedded dialogs
Quote:
Originally Posted by
2kaud
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.