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
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Random UIFILE trick - dfc dtb functions - by TheSteve on 12-20-2007 at 08:06 AM
RE: Random UIFILE trick - dfc dtb functions - by Patchou on 12-20-2007 at 05:50 PM
RE: Random UIFILE trick - dfc dtb functions - by davidpolitis on 12-21-2007 at 01:06 AM
RE: Random UIFILE trick - dfc dtb functions - by Patchou on 12-21-2007 at 05:21 AM
RE: Random UIFILE trick - dfc dtb functions - by davidpolitis on 12-21-2007 at 05:43 AM
RE: Random UIFILE trick - dfc dtb functions - by Patchou on 12-21-2007 at 05:46 AM
RE: Random UIFILE trick - dfc dtb functions - by TheBlasphemer on 01-19-2009 at 12:16 PM


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