| 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?
|
Posted: Fri May 09, 2008 8:37 pm Post subject: editbox and label question |
|
|
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 |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sat May 10, 2008 3:21 am Post subject: |
|
|
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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat May 10, 2008 7:33 am Post subject: |
|
|
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 |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat May 10, 2008 8:02 am Post subject: |
|
|
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 |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat May 10, 2008 8:10 am Post subject: |
|
|
Both ways works just fine, you probably did it wrong.
Post your code here.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat May 10, 2008 8:32 am Post subject: |
|
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat May 10, 2008 9:43 am Post subject: |
|
|
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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat May 10, 2008 11:08 am Post subject: |
|
|
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 ppl who opened it had a blank form problem.. once i initalized standerd classes it was fixed.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat May 10, 2008 11:27 am Post subject: |
|
|
| 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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat May 10, 2008 11:28 am Post subject: |
|
|
| 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 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 |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat May 10, 2008 11:55 am Post subject: |
|
|
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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat May 10, 2008 12:05 pm Post subject: |
|
|
put the INITCOMMONCONTROLSEX and rest of that part in your WinMain
or WM_CREATE
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat May 10, 2008 12:13 pm Post subject: |
|
|
| lurc wrote: | put the INITCOMMONCONTROLSEX and rest of that part in your WinMain
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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat May 10, 2008 12:20 pm Post subject: |
|
|
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 |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat May 10, 2008 12:28 pm Post subject: |
|
|
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 |
|
 |
|