no button

Posts 1–10 of 10 · Page 1 of 1
no button
When I put this in my WM_CREATE thing
Code:
hButton = CreateWindowEx(WS_EX_CLIENTEDGE, (LPCWSTR)"BUTTON", (LPCWSTR)"Set", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_CENTER | BS_TEXT, 110, 175, 14, 23, hWnd, (HMENU)SET_BUTTON, GetModuleHandle(NULL), NULL);
nothing shows up. It compiles, but nothing shows up.
This?
[highlight=c++]button = CreateWindow("button", "Set", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_CENTER | BS_TEXT, 110, 175, 14, 23, hWnd, (HMENU)SET_BUTTON, GetModuleHandle(NULL), 0);[/highlight]
It doesn't work... I get compile errors:
Code:
error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR'
owait, nevermind, i put an L infront of them it works.

SUPER EDDDIT: derp derp derp, it works but then it looks like those buttons from super old windows 95 or something.
Add a manifest.
Quote Originally Posted by Fovea View Post
Add a manifest.
[highlight=c++]#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif [/highlight]
Where do I put the manifest?
Quote Originally Posted by kuyakyloo View Post
Where do I put the manifest?
At the top of your "main" cpp file is where I usually put it.
[highlight="c++"]#include <windows.h>

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

int WINAPI wWinMain(...)
{
....
}
[/highlight]
Put it with your globals.
Umm... one last thing... the text looks like from old pc's too.
It may have to do with last two things being NULLed or the first/fourth options... that may determine appearance
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?