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 


editbox and label question
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri May 09, 2008 8:37 pm    Post subject: editbox and label question Reply with quote

How do I make it so that in the edit box it has that italic, grayed text that you see in some programs. But as soon as you click on it, the edit turns blank? Like "Search for a buddy". Oh, and how can I change the label background to transparent, or make it's background color matches my windows background color?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing


Last edited by oib111 on Sat May 10, 2008 12:36 pm; edited 2 times in total
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Sat May 10, 2008 3:21 am    Post subject: Reply with quote

Save this code as .xml file and add it as resource:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
  xmlns="urn:schemas-microsoft-com:asm.v1"
  manifestVersion="1.0">
<assemblyIdentity
    name="CiaoSoftware.Ciao.Shell.Contacts"
    processorArchitecture="x86"
    version="5.1.0.0"
    type="win32"/>
<description>Windows Shell</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="x86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat May 10, 2008 7:33 am    Post subject: Reply with quote

In Win32 C++:

Add These Lines to the top of your program

Code:
#include <commctrl.h>
#pragma comment (lib,"COMCTL32.lib") // might not need...
#pragma comment (linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")


Then make sure to initalize your common controls using INITCOMMONCONTROLSEX struct and InitCommonControlsEx function:

Code:
INITCOMMONCONTROLSEX init;
init.dwSize = sizeof(INITCOMMONCONTROLSEX);
init.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&init);

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat May 10, 2008 8:02 am    Post subject: Reply with quote

Neither of those worked.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sat May 10, 2008 8:10 am    Post subject: Reply with quote

Both ways works just fine, you probably did it wrong.

Post your code here.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat May 10, 2008 8:32 am    Post subject: Reply with quote


_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat May 10, 2008 9:43 am    Post subject: Reply with quote

delete the resource and just put this below your defines

#pragma comment (linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

I just tested and it works. I don't use initcommoncontrols

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

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat May 10, 2008 11:08 am    Post subject: Reply with quote

you'll need InitCommonControlsEx for other people to use it who don't have certain includes or files probly cuz... i went through this already with my bot Confused ppl who opened it had a blank form problem.. once i initalized standerd classes it was fixed.
_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat May 10, 2008 11:27 am    Post subject: Reply with quote

blankrider wrote:
delete the resource and just put this below your defines

#pragma comment (linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

I just tested and it works. I don't use initcommoncontrols


Got a blank form.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat May 10, 2008 11:28 am    Post subject: Reply with quote

lurc wrote:
you'll need InitCommonControlsEx for other people to use it who don't have certain includes or files probly cuz... i went through this already with my bot Confused ppl who opened it had a blank form problem.. once i initalized standerd classes it was fixed.


lurc wrote:

Code:
INITCOMMONCONTROLSEX init;
init.dwSize = sizeof(INITCOMMONCONTROLSEX);
init.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&init);

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat May 10, 2008 11:55 am    Post subject: Reply with quote

Still got a problem...

Code:

#include <windows.h>
#include <commctrl.h>
#define IDC_MAIN_BUTTON 100
#define IDC_NAME_EDIT 101
#define IDC_SERIAL_EDIT 102
#define IDC_NAME_STATIC 103
#define IDC_SERIAL_STATIC 104
#pragma comment (lib,"COMCTL32.lib") // might not need...
#pragma comment (linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
INITCOMMONCONTROLSEX init;
init.dwSize = sizeof(INITCOMMONCONTROLSEX);
init.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&init);


Quote:

c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(11) : error C2143: syntax error : missing ';' before '.'
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(11) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(11) : error C2371: 'init' : redefinition; different basic types
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(10) : see declaration of 'init'
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(12) : error C2143: syntax error : missing ';' before '.'
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(12) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(12) : error C2371: 'init' : redefinition; different basic types
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(10) : see declaration of 'init'
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(13) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(13) : error C2365: 'InitCommonControlsEx' : redefinition; previous definition was 'function'
c:\program files\microsoft sdks\windows\v6.0a\include\commctrl.h(164) : see declaration of 'InitCommonControlsEx'
c:\documents and settings\oib\my documents\visual studio 2008\projects\keygenme\keygenme\main.cpp(13) : error C2440: 'initializing' : cannot convert from 'INITCOMMONCONTROLSEX *' to 'int'
There is no context in which this conversion is possible
Build log was saved at "file://c:\Documents and Settings\OIB\My Documents\Visual Studio 2008\Projects\KeyGenMe\KeyGenMe\Debug\BuildLog.htm"

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat May 10, 2008 12:05 pm    Post subject: Reply with quote

put the INITCOMMONCONTROLSEX and rest of that part in your WinMain Razz

or WM_CREATE

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat May 10, 2008 12:13 pm    Post subject: Reply with quote

lurc wrote:
put the INITCOMMONCONTROLSEX and rest of that part in your WinMain Razz

or WM_CREATE


Still getting errors lol

Quote:

------ Build started: Project: KeyGenMe, Configuration: Debug Win32 ------
Compiling...
main.cpp
Linking...
main.obj : error LNK2019: unresolved external symbol __imp__InitCommonControlsEx@4 referenced in function _WinMain@16
C:\Documents and Settings\OIB\My Documents\Visual Studio 2008\Projects\KeyGenMe\Debug\KeyGenMe.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\OIB\My Documents\Visual Studio 2008\Projects\KeyGenMe\KeyGenMe\Debug\BuildLog.htm"
KeyGenMe - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat May 10, 2008 12:20 pm    Post subject: Reply with quote

you kept the #pragma (lib,"comctl32.lib") up above right?

only moved the block from the struct definition to the Function call?

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat May 10, 2008 12:28 pm    Post subject: Reply with quote

Fixed it. Second topic of thread. How do I make it so that in the edit box it has that italic, grayed text that you see in some programs. But as soon as you click on it, the edit turns blank? Like "Search for a buddy". Oh, and how can I change the label background to transparent, or make it's background color matches my windows background color?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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