Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[VB6] Windows XP Styles! (Working)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
hermitblade
Cheater
Reputation: 0

Joined: 17 Nov 2007
Posts: 47

PostPosted: Mon Feb 18, 2008 10:54 pm    Post subject: [VB6] Windows XP Styles! (Working) Reply with quote

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
View user's profile Send private message
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~

PostPosted: Tue Feb 19, 2008 4:24 am    Post subject: Reply with quote

I've been looking for something like this
Thanks!

_________________


Back to top
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Tue Feb 19, 2008 5:51 am    Post subject: Reply with quote

You should give credit to where you found it, Microsoft also has it on their site:
http://support.microsoft.com/kb/309366

_________________
Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Tue Feb 19, 2008 9:00 am    Post subject: Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Feb 20, 2008 7:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Buggy
Advanced Cheater
Reputation: 0

Joined: 04 Jan 2008
Posts: 72
Location: Republic of Korea (South Korea)

PostPosted: Fri Feb 22, 2008 11:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites