| View previous topic :: View next topic |
| Author |
Message |
hermitblade Cheater
Reputation: 0
Joined: 17 Nov 2007 Posts: 47
|
Posted: Mon Feb 18, 2008 10:54 pm Post subject: [VB6] Windows XP Styles! (Working) |
|
|
To use the Windows XP visual styles from an application, you must add an application manifest file. This application manifest file should specify that ComCtl32.dll version 6 be used if it is available. One of the features that is included with this component is support for changing the appearance of controls in a window.
Therefore, you must follow two steps to enable the Windows XP theme or visual style in Visual Basic 6.0:
| Quote: | 1. Call the InitCommonControls functionAdd an application manifest file
2. Add an application manifest file |
Call the InitCommonControls Function
You must call the InitCommonControls function in the Form_Initialize event:
| Code: | Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
Private Sub Form_Initialize()
InitCommonControls
End Sub
|
NOTE: Do not call InitCommonControls in the Form_Load event. When you call InitCommonControls from the Form_Load event, the form cannot load.
Add an Application Manifest File
You must add a file named YourApp.exe.manifest to the same folder as your executable file. For example, if your application is named Generic.exe, include a manifest file that is named Generic.exe.manifest. The application manifest file has Extensible Markup Language (XML) format similar to the following:
| Code: | <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="CompanyName.ProductName.YourApp"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly> |
After you place the application manifest file in the same folder as the executable file, you can run the compiled executable file to display the Windows XP visual style in the application.
Now your VB6 programs can have sexy buttons like Windows XP! Like this:
|
|
| Back to top |
|
 |
h4ckz0r's twisted soul Grandmaster Cheater Supreme
Reputation: 1
Joined: 24 Oct 2007 Posts: 1181 Location: Paradise city, where the grass is green and the girls are somwhat pretty~
|
Posted: Tue Feb 19, 2008 4:24 am Post subject: |
|
|
I've been looking for something like this
Thanks!
_________________
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Tue Feb 19, 2008 9:00 am Post subject: |
|
|
outdated, use InitCommonControlsEx
besides, you forgot to include LoadLibrary "conctl32.dll" on form_terminate so you'll crash on some systems (or the program does not start)
_________________
Get kidnapped often. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Feb 20, 2008 7:20 pm Post subject: |
|
|
| blland wrote: | outdated, use InitCommonControlsEx
besides, you forgot to include LoadLibrary "conctl32.dll" on form_terminate so you'll crash on some systems (or the program does not start) |
For the time that VB6 was being used for most application development, InitCommonControlsEx was not around, or enforced. The old version will work just as fine in VB. Also, VB will automatically load the library wen you import a call from the library. The MSVBVM60.dll will do the loading for you.
You can debug a VB application and set a breakpoint on LoadLibraryA and watch the calls from the MSVBVM60.dll, there will be at least 6 imports for a basic application using the above code. 8 with the code.
gdi32.dll
MSVCR71.dll
kernel32.dll
OLEAUT32.dll
SXS.dll
OLEAUT32.dll
ole32.dll
comctrl32.dll
_________________
- Retired. |
|
| Back to top |
|
 |
Buggy Advanced Cheater
Reputation: 0
Joined: 04 Jan 2008 Posts: 72 Location: Republic of Korea (South Korea)
|
Posted: Fri Feb 22, 2008 11:23 pm Post subject: |
|
|
here is another way :
use xpstyle.res
http://buggy.ufree.kr/xpstyle.res
.manifest may be a good way but it looks dirty? i don't know exactly words that means but it can be a good method.
using resource file may be a good method, too!
and PictureBox, you have to change BorderStyle to 0.
and Microsoft Windows Common Controls, you have to use 5.0.
w5t2u4903itujgasdfiotj209384tjslkg
_________________
[img]
<a><img></a>[/img]
iroo sooo hooooot |
|
| Back to top |
|
 |
|