I have a problem with the xp.manifest.
If I use a manifest file for my Win32GUI application, the control I've created isn't visible anymore ...
Without the manifest file all is ok, but just in Win2ooo style.
#include <windows.h>
//#include <commctrl.h>
// Beispiel: CheckBox mit transparentem Hintergrund !
// funktioniert !!! :), aber nur ohne xp.manifest :(
HWND checkBoxButton;
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
/* case WM_CTLCOLORSTATIC :
if( checkBoxButton == (HWND)lParam)
{
HBRUSH hbr = (HBRUSH)DefWindowProc(hwnd, message, wParam, lParam);
::DeleteObject(hbr);
SetBkMode((HDC)wParam, TRANSPARENT);
return (LRESULT)::GetStockObject(NULL_BRUSH);
}
return 0 ;*/
case WM_CREATE :
checkBoxButton = CreateWindow (TEXT("button"),
__TEXT("checkbox"),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
100, 100, 100, 20,
hwnd, NULL,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
return 0 ;
case WM_CLOSE:
DestroyWindow(hwnd);
return 0;
case WM_DESTROY :
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("Checkbox") ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = NULL ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;
if (!RegisterClass (&wndclass))
{
return 0 ;
}
// InitCommonControls();
hwnd = CreateWindow (szAppName, TEXT ("Button Look"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return 0;
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
name="cHECKbOX.Debug.App"
processorArchitecture="x86"
version="1.0.0.0"
type="win32"/>
<description>Executable</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
Thanx.