Hello,
I have a problem.
I wrote an application for a WinCe Device (PNA).
I create a window with this lines:
HWND hWnd;
hWnd = CreateWindow(L"someClass", L"Dialog", WS_VISIBLE, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
ShowWindow (hWnd, nCmdShow);
UpdateWindow (hWnd);
It shows me a blanc window, I fill it with text like this:
CreateWindow( _T("STATIC"), _T("my text"), WS_CHILD | WS_VISIBLE | SS_CENTER, 10, 220 , 460, 15, hWnd, NULL, NULL, NULL);
UpdateWindow (hWnd);
it works very well,
now I will show a logo (bitmap) at the top, but it doesnt work.
I tried several things, bit it doesnt show me the resource
CreateWindow(_T("BITMAP"),MAKEINTRESOURCE(ID_BMP), WS_CHILD | WS_VISIBLE , 0,0,480,100, NULL, NULL, NULL, NULL);
UpdateWindow (hWnd);
Does anyone know what Im doing wrong?
Michael
Have you tried to use the STATIC class and add the SS_BITMAP style to display the bitmap.
See Static Control Styles (http://msdn.microsoft.com/en-us/library/bb760773(VS.85).aspx)
Hello,
yes I tried severall things, also
CreateWindow(_T("STATIC"),MAKEINTRESOURCE(ID_BMP), WS_CHILD | WS_VISIBLE | SS_BITMAP, 0,0,480,100, NULL, NULL, NULL, NULL);
UpdateWindow (hWnd);
but i cannot see the image.
In case of the filesize, the bitmap is included as a resource, perhaps the way I call it is wrong....
I dont know.
Michael
Here's a small demo project that loads and displays a bitmap.
DMac
Hi,
thanks all of you :-)
I found a similar solution that works also :-)
HWND imgCtrl = CreateWindow( _T("STATIC"), NULL, SS_CENTERIMAGE | SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0 , 480, 90, hWnd, NULL, NULL, NULL);
SendMessage(imgCtrl,STM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)hbit);
UpdateWindow (hWnd);
So I can continue with the next probs :-)
Michael