What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Skinning » Random UIFILE trick - dfc dtb functions

Random UIFILE trick - dfc dtb functions
Author: Message:
TheSteve
Full Member
***

Avatar
The Man from Japan

Posts: 179
Reputation: 23
40 / Male / Flag
Joined: Aug 2005
O.P. Random UIFILE trick - dfc dtb functions
So I was in a debugging session today, and I noticed a couple functions I hadn't seen before and could find online documentation for.

So I worked them out and here are the results:

dfc stands for DrawFrameControl which is a Windows API function that some of you may be familiar with. For those that aren't familier, this function allows you to easily draw basic windows controls. The function prototype looks like this:

code:
dfc(nType, nState) - DrawFrameControl
nType:
1 - Title bar
2 - Menu bar
3 - Scroll bar
4 - Standard button
5 - Popup menu item.
nState:
These values change based on the control type. For valid values you'll need to look at the documentation and winuser.h to get the number values

Now if you try this dfc function you may notice that it draws really old looking controls.  This is because this function draws the "Windows Classic" style controls.  Ok so this is kind of pointless isn't it.

This brings us to the dtb function. dtb stands for DrawThemeBackground. This function controls all of the painting for the Windows XP and Windows Vista themes support.  So with this function you can get all of the Windows XP/Vista style controls. These controls will match the currently selected windows theme as long as you're not in Windows Classic mode.
The function looks like this
code:
dtb(nControlType, nPart, nStyle, 0) - DrawThemeBackground
controltype:
0 - ScrollBar
1 - Toolbar
2 - Clock
3 - Combobox
4 - Edit
5 - Explorer
6 - Globals
7 - Header
8 - ListView
9 - MENU
10 - MenuBand
11 - Pager
12 - Progress
13 - Rebar
14 - Spin
15 - StartPanel
16 - Status
17 - Tab
18 - TaskBand
19 - TaskBandVert
20 - TaskBandGroupMenu
21 - Taskbar
22 - TaskVert
23 - Tooltip
24 - TrackBar
25 - TrayNotify
26 - TreeView
27 - Window
28 - Static
29 - Button
30 - Button-OK
31 - Button-CANCEL
32 - Button-ABORT
33 - Button-RETRY
34 - Button-IGNORE
35 - Button-YES
36 - Button-NO
37 - Button-CLOSE
38 - Button-HELP
39 - Button-TRYAGAIN
40 - Button-CONTINUE
41 - Button-APPLY
nPart and nStyle:
There are a lot of these.  Please check the documentation for DrawThemeBackground and TmSchema.h for correct values for specific control types
0:
I am currently not aware of the purpose of the last parameter. Setting it to 0 seems the safest thing to do. ( setting it to a rect seemed to lock up messenger)


Because you need the header files in order to get the correct numbers, you will either need to download the Windows SDK (it's free) or ask one of your programmer buddies to send the header.  If I get some time I'll put together a whole list of values and put it here.

Note: In case you got the wrong idea, this cannot achieve glass in Windows Vista.

EDIT: I found an online copy of TmSchema.h in the wine project. You can find it here: http://source.winehq.org/source/include/tmschema.h

This post was edited on 12-20-2007 at 01:07 PM by TheSteve.
12-20-2007 08:06 AM
Profile PM Web Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Random UIFILE trick - dfc dtb functions
Thanks for the info :).

I'll really have to get started on the tutorials section of the web site...
[Image: signature2.gif]
12-20-2007 05:50 PM
Profile PM Web Find Quote Report
davidpolitis
Full Member
***


Posts: 371
Reputation: 16
Joined: Aug 2006
RE: Random UIFILE trick - dfc dtb functions
A shame that MP!L cannot handle controls :(
12-21-2007 01:06 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Random UIFILE trick - dfc dtb functions
what do you mean?
[Image: signature2.gif]
12-21-2007 05:21 AM
Profile PM Web Find Quote Report
davidpolitis
Full Member
***


Posts: 371
Reputation: 16
Joined: Aug 2006
RE: Random UIFILE trick - dfc dtb functions
Well, say that you want to add your own menu, you have to edit an existing menu such as the background chooser and then get the button to just use a cmdid, so that backgrounds are still accessible, because messenger handles menus and drop downs. Hence new ones cannot be added.

This post was edited on 12-21-2007 at 05:47 AM by davidpolitis.
12-21-2007 05:43 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Random UIFILE trick - dfc dtb functions
oh I see. Well, that's definitively the kind of request I can accept. I'll keep that suggestion for the next updates (I wanted to do somethign for menus anyway).
[Image: signature2.gif]
12-21-2007 05:46 AM
Profile PM Web Find Quote Report
TheBlasphemer
Senior Member
****

Avatar

Posts: 714
Reputation: 47
36 / – / –
Joined: Mar 2004
RE: Random UIFILE trick - dfc dtb functions
Quick addition to Steve's post:
the last argument to DTB is a default: if the theme handle can not be found, this value is used instead. Should probably be a graphic or an RLE.
[Image: theblasp.png]
01-19-2009 12:16 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On