News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

tabs vs xp style

Started by 0x58, February 17, 2011, 01:43:08 AM

Previous topic - Next topic

0x58

hey guys :) can someone tell me why when i use manifest of xp style the forms inside tabs looks like this?



???


Tedd

Never had that problem, but it's because the 'form' is using the default dialog background brush, instead of the same background brush of its parent.

I'll guess it's down to a missing/wrong style setting, or not using the extended version of one of the structures (e.g. DIALOGEX)

Attach your project for more help :wink
No snowflake in an avalanche feels responsible.

0x58

ok here is the source of the project

dedndave

<assemblyIdentity
    processorArchitecture="x86"
    version="5.1.0.0"
    type="win32"
    name="dlgbox2.exe"/>
    <description>Mx XP Program</description>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity
         type="win32"
         name="Microsoft.Windows.Common-Controls"
         version="6.0.0.0"
         publicKeyToken="6595b64144ccf1df"
         language="*"
         processorArchitecture="x86"/>
    </dependentAssembly>
    </dependency>
</assembly>

isn't that vista common controls and xp os ?

dedndave

i guess not - lol
this is how Hutch defines his manifest to get rebar working

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>Windows Application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>


also - he uses InitCommonControlsEx with ICC_COOL_CLASSES
you could probably OR that with ICC_WIN95_CLASSES

0x58

if someone could post an exemple of that it would be appreciated  :bg

dedndave

i see that you do not need cool classes - you do need bar classes

i would do it this way...
        .DATA

icc INITCOMMONCONTROLSEX <sizeof INITCOMMONCONTROLSEX,ICC_WIN95_CLASSES or ICC_BAR_CLASSES>
; dwSize           dd ?
; dwICC            dd ?

        .CODE

        INVOKE  InitCommonControlsEx,offset icc

you could also put the structure in the uninitialized data section (or local) and initialize it in code - i think my way is smaller   :P

i dunno - let's see....
        push    ICC_WIN95_CLASSES or ICC_BAR_CLASSES
        push    sizeof INITCOMMONCONTROLSEX
        INVOKE  InitCommonControlsEx,esp
        pop     ecx
        pop     edx

that's pretty small, too
1 byte bigger, i guess

sorry - you don't need bar classes - i was thinking of another thread - lol

dedndave

if you don't need more than ICC_WIN95_CLASSES, i think InitCommonControls is good enough
i read someplace, that for win2000 or higher, you don't need it at all if you don't need more bits set
i think i would put it in there, anyways

0x58

i also used this

Quote.data?
iccex            INITCOMMONCONTROLSEX <?>
.code
invoke InitCommonControls
mov      iccex.dwSize,sizeof INITCOMMONCONTROLSEX    ;prepare common control structure
mov      iccex.dwICC,ICC_WIN95_CLASSES
invoke InitCommonControlsEx,addr iccex

but i still get the same problem :dazzled:

Tedd

InitCommonControls with a version 6 manifest is correct and all that's needed for correct theming. (There's no need for INITCOMMONCONTROLSEX)

The problem lies elsewhere, and there doesn't seem to be a choose-the-correct-settings type fix.

The only sensible solution I've found involves giving the tab control the TCS_OWNERDRAWFIXED style, and then handling WM_DRAWITEM -- details at http://support.microsoft.com/kb/179909
Unfortunately, whichever colour brush you choose won't quite look right, because the tab control's background is a gradient. So the first thing I'd try is using the NULL_BRUSH (as returned by GetStockObject) in the call to SetBkColor.
No snowflake in an avalanche feels responsible.

0x58

ouh i see  :( so i'll use the sizing solution x) dialogs size is like tab size  :cheekygreen:

Slugsnack

Sorry I don't have time to read your code but when I encountered this problem it was because I had forgotten to set the clip children attribute on my dialog window.

0x58

ok to all those who still got that problem it's solved in winasm board by Jupiter use the api EnableThemeDialogTexture in the uxtheme lib

HRESULT EnableThemeDialogTexture(
__in  HWND hwnd,
__in  DWORD dwFlags
);


Credits: Jupiter

have fun :D and thank's to all those who helped :green2