Hallo,
ich versuch mit reinem Api einfach nur ein Bitmap im Dialog anzuzeigen. Meine Dateien sehen so aus:
resource.h
resource.rc
main.cpp
Wie kann ich jetzt das Bitmap anzeigen lassen? Bin fast echt am verzweifeln.
ich versuch mit reinem Api einfach nur ein Bitmap im Dialog anzuzeigen. Meine Dateien sehen so aus:
resource.h
Code:
#define IDM_LOCK 6
#define DIALOG_0 100
#define mylock 200
Code:
#include "resource.h"
mylock BITMAP "******.bmp"
LANGUAGE LANG_NEUTRAL, 0
DIALOG_0 DIALOG 0, 0, 330, 70
STYLE DS_FIXEDSYS |DS_SETFONT |WS_POPUP |WS_VISIBLE |WS_THICKFRAME |WS_CAPTION
CAPTION "......."
FONT 8, "Ms Shell Dlg"
BEGIN
CONTROL "Picture0",IDM_LOCK,"STATIC",SS_BLACKFRAME |WS_CHILD |WS_VISIBLE ,15,5,48,48
END
main.cpp
Code:
//FunktionsPrototypen
BOOL CALLBACK DialogProc (HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
MyInstance = hInstance;
hDialog = CreateDialog(hInstance, MAKEINTRESOURCE(DIALOG_0), NULL, DialogProc);
ShowWindow(hDialog, nCmdShow);
UpdateWindow(hDialog);
while (GetMessage(&msg, NULL, 0, 0))
{
if(!IsDialogMessage(hDialog, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
BOOL CALLBACK DialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
HWND hfeld;
hfeld = GetDlgItem(hDlg,IDM_LOCK);
// Load the bitmap from the resource
bmp = LoadBitmap(MyInstance, MAKEINTRESOURCE(mylock));
return (TRUE);
case WM_DESTROY:
case WM_CLOSE:
PostQuitMessage(0);
return (TRUE);
.....
default:
break;
}
return (FALSE);
}
return (FALSE);
}