473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Uxtheme.dll skinning

Hello everybody...
I am trying to apply some parts of the WinXP skins in panel controls. I am
using the Uxtheme wrapper which you can download from www.codeproject.com
and it is good.
If I want to do what I explained, I have to pass a string to a function
which makes the drawing. The string refers to the part of the skin.
I have made this very well, but I can't find what string is the correct to
draw the StartButton and the task buttons of the Taskbar.
Please help me with this since I need it too much.

Thank you very much...

Martín Heras
Nov 22 '05 #1
5 6331
The Startbutton and Taskbar do not have names associated with them for use
in themeing. If you want to draw those parts then you must extract the
bitmaps from the current themes resource file. You can use
GetCurrentThemeName to get the ColorName of the current theme and then
append that string with "_TASKBARBACKGROUND_BMP" or "_STARTBUTTON_BMP" for
the appropriate bitmaps. GetCurrentThemeName also returns the name of the
resource file to extract the bitmaps from.

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi1...nate/home.html
"Martín Heras" <mh****@fibertel.com.ar> wrote in message
news:uz**************@TK2MSFTNGP12.phx.gbl...
Hello everybody...
I am trying to apply some parts of the WinXP skins in panel controls. I am
using the Uxtheme wrapper which you can download from www.codeproject.com
and it is good.
If I want to do what I explained, I have to pass a string to a function
which makes the drawing. The string refers to the part of the skin.
I have made this very well, but I can't find what string is the correct to
draw the StartButton and the task buttons of the Taskbar.
Please help me with this since I need it too much.

Thank you very much...

Martín Heras

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Nov 22 '05 #2
Mmmmm... And how can I open an unmanaged resource from a file using VB.NET?

Thank you...

"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:eW**************@TK2MSFTNGP11.phx.gbl...
The Startbutton and Taskbar do not have names associated with them for use
in themeing. If you want to draw those parts then you must extract the
bitmaps from the current themes resource file. You can use
GetCurrentThemeName to get the ColorName of the current theme and then
append that string with "_TASKBARBACKGROUND_BMP" or "_STARTBUTTON_BMP" for
the appropriate bitmaps. GetCurrentThemeName also returns the name of the
resource file to extract the bitmaps from.

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi1...nate/home.html
"Martín Heras" <mh****@fibertel.com.ar> wrote in message
news:uz**************@TK2MSFTNGP12.phx.gbl...
Hello everybody...
I am trying to apply some parts of the WinXP skins in panel controls. I am using the Uxtheme wrapper which you can download from www.codeproject.com and it is good.
If I want to do what I explained, I have to pass a string to a function
which makes the drawing. The string refers to the part of the skin.
I have made this very well, but I can't find what string is the correct to draw the StartButton and the task buttons of the Taskbar.
Please help me with this since I need it too much.

Thank you very much...

Martín Heras

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004

Nov 22 '05 #3
I knew this was coming...
Heres one I prepared earlier:

\\\\
Imports System.Runtime.InteropServices
Imports System.Text

#Region " Dll Imports "

<DllImport("kernel32", CallingConvention:=CallingConvention.Cdecl)> _
Private Shared Function LoadLibrary( _
ByVal lpFileName As String) As IntPtr
End Function
<DllImport("kernel32", CallingConvention:=CallingConvention.Cdecl)> _
Private Shared Function FreeLibrary( _
ByVal hModule As IntPtr) As Boolean
End Function

<DllImport("UxTheme", CharSet:=CharSet.Unicode, _
CallingConvention:=CallingConvention.Cdecl)> _
Friend Shared Function GetCurrentThemeName _
(ByVal pszThemeFileName As StringBuilder, _
ByVal cchMaxNameChars As Integer, _
ByVal pszColorBuff As StringBuilder, _
ByVal cchMaxColorChars As Integer, _
ByVal pszSizeBuff As StringBuilder, _
ByVal cchMaxSizeChars As Integer) As Integer
End Function

#End Region

Private Function ExtractBitmap(ByVal sFilename As String, _
ByVal sBitmapName As String) As Bitmap
Dim hInst As IntPtr = LoadLibrary(sFilename)
Dim BMP As Bitmap = Bitmap.FromResource(hInst, sBitmapName)
FreeLibrary(hInst)
Return BMP
End Function

Dim TaskBarBmp As Bitmap
Dim StartButtonBmp As Bitmap

Private Sub SetBitmaps()
Dim ThemeName As StringBuilder = New StringBuilder(256)
Dim ColorName As StringBuilder = New StringBuilder(256)
Dim ThemeSize As StringBuilder = New StringBuilder(256)
GetCurrentThemeName(ThemeName, 256, ColorName, 256, ThemeSize, 256)
TaskbarBmp = ExtractBitmap(ThemeName.ToString, _
ColorName.ToString + "_TASKBARBACKGROUND_BMP")
StartButtonBmp = ExtractBitmap(ThemeName.ToString, _
ColorName.ToString + "_STARTBUTTON_BMP")
End Sub
////

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi1...nate/home.html
"Martín Heras" <mh****@fibertel.com.ar> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Mmmmm... And how can I open an unmanaged resource from a file using VB.NET?
Thank you...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Nov 22 '05 #4
Mmmmm... And how can I open an unmanaged resource from a file using VB.NET?

Thank you...

"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:eW**************@TK2MSFTNGP11.phx.gbl...
The Startbutton and Taskbar do not have names associated with them for use
in themeing. If you want to draw those parts then you must extract the
bitmaps from the current themes resource file. You can use
GetCurrentThemeName to get the ColorName of the current theme and then
append that string with "_TASKBARBACKGROUND_BMP" or "_STARTBUTTON_BMP" for
the appropriate bitmaps. GetCurrentThemeName also returns the name of the
resource file to extract the bitmaps from.

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi1...nate/home.html
"Martín Heras" <mh****@fibertel.com.ar> wrote in message
news:uz**************@TK2MSFTNGP12.phx.gbl...
Hello everybody...
I am trying to apply some parts of the WinXP skins in panel controls. I am using the Uxtheme wrapper which you can download from www.codeproject.com and it is good.
If I want to do what I explained, I have to pass a string to a function
which makes the drawing. The string refers to the part of the skin.
I have made this very well, but I can't find what string is the correct to draw the StartButton and the task buttons of the Taskbar.
Please help me with this since I need it too much.

Thank you very much...

Martín Heras

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004

Nov 22 '05 #5
I knew this was coming...
Heres one I prepared earlier:

\\\\
Imports System.Runtime.InteropServices
Imports System.Text

#Region " Dll Imports "

<DllImport("kernel32", CallingConvention:=CallingConvention.Cdecl)> _
Private Shared Function LoadLibrary( _
ByVal lpFileName As String) As IntPtr
End Function
<DllImport("kernel32", CallingConvention:=CallingConvention.Cdecl)> _
Private Shared Function FreeLibrary( _
ByVal hModule As IntPtr) As Boolean
End Function

<DllImport("UxTheme", CharSet:=CharSet.Unicode, _
CallingConvention:=CallingConvention.Cdecl)> _
Friend Shared Function GetCurrentThemeName _
(ByVal pszThemeFileName As StringBuilder, _
ByVal cchMaxNameChars As Integer, _
ByVal pszColorBuff As StringBuilder, _
ByVal cchMaxColorChars As Integer, _
ByVal pszSizeBuff As StringBuilder, _
ByVal cchMaxSizeChars As Integer) As Integer
End Function

#End Region

Private Function ExtractBitmap(ByVal sFilename As String, _
ByVal sBitmapName As String) As Bitmap
Dim hInst As IntPtr = LoadLibrary(sFilename)
Dim BMP As Bitmap = Bitmap.FromResource(hInst, sBitmapName)
FreeLibrary(hInst)
Return BMP
End Function

Dim TaskBarBmp As Bitmap
Dim StartButtonBmp As Bitmap

Private Sub SetBitmaps()
Dim ThemeName As StringBuilder = New StringBuilder(256)
Dim ColorName As StringBuilder = New StringBuilder(256)
Dim ThemeSize As StringBuilder = New StringBuilder(256)
GetCurrentThemeName(ThemeName, 256, ColorName, 256, ThemeSize, 256)
TaskbarBmp = ExtractBitmap(ThemeName.ToString, _
ColorName.ToString + "_TASKBARBACKGROUND_BMP")
StartButtonBmp = ExtractBitmap(ThemeName.ToString, _
ColorName.ToString + "_STARTBUTTON_BMP")
End Sub
////

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi1...nate/home.html
"Martín Heras" <mh****@fibertel.com.ar> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Mmmmm... And how can I open an unmanaged resource from a file using VB.NET?
Thank you...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Nov 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Martín Heras | last post by:
Hello everybody... I am trying to apply some parts of the WinXP skins in panel controls. I am using the Uxtheme wrapper which you can download from www.codeproject.com and it is good. If I want...
1
by: Paul Hartness | last post by:
I want to be able to skin my application producing non-standard form shapes such as WinAmp & Windows Media Player. I have reviewed toolkits such as DirectSkin, SkinCrafter, SkinBoxer, SkinMagic...
3
by: AtlasApollo | last post by:
Greetings! We are working on a project that has a bunch of TrackBars spec'ed as graphic controls. In other words, they are slick looking and green. In the design phase, these controls look...
2
by: meyer_phillip | last post by:
I am looking for an application skinning engine that supports colour themes. Winamp is an example of an app supporting colour themes. For example in Winamp I can pick the "Winamp Modern" skin and...
6
by: elziko | last post by:
Every time I use to run my project it was fine. I jave just added three lines of code: If Not drSeries.IsDBNull(2) Then strUnits = drSeries.GetString(2) End If and now when I run it I get...
2
by: CJ Taylor | last post by:
I've been googling this for awhile, but can't seem to find anything really solid on skinning a windows forms app. I know how to skin the internal stuff but would like to see an example of stuff...
1
by: Martín Heras | last post by:
Hello everybody... I am trying to apply some parts of the WinXP skins in panel controls. I am using the Uxtheme wrapper which you can download from www.codeproject.com and it is good. If I want...
2
by: JJ | last post by:
I'm using Themes with asp.net 2.0 and i have a command field(in a gridview) like this: <asp:CommandField ButtonType=Image ShowDeleteButton= true...
0
by: anandp7890 | last post by:
How to install a UxTheme.dll file on Windows2000 Professional edition ? kindly, repond to thanks & regards anand
1
by: anirban123 | last post by:
I have an existing forms application developed in C# .NET 2.0. I would like to know the easiest way of enhancing its look and feel/apply skinning. Please help ASAP.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.