002
05.04.2004, 14:23 Uhr
Oliver
S2-Pixelgeneral
|
Nein geht leider nicht. Hier ist der Code von der WinMain:
C++: |
#include <windows.h> #include <ctl3d.h> #include <RICHEDIT.H> #include <commctrl.h>
HWND hWindow, hButton1, hEdit; HINSTANCE hist; LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
hist=hInstance;
WNDCLASS WndClass; WndClass.style=0; WndClass.cbClsExtra=0; WndClass.cbWndExtra=0; WndClass.lpfnWndProc=WndProc; WndClass.hInstance=hInstance; WndClass.hbrBackground=(HBRUSH)GetStockObject(GRAY_BRUSH); WndClass.hCursor=LoadCursor(NULL,IDC_ARROW); WndClass.hIcon=LoadIcon(hInstance,MAKEINTRESOURCE(112)); WndClass.lpszMenuName=0; WndClass.lpszClassName="Winprog"; WndClass.lpszMenuName=MAKEINTRESOURCE(101);
RegisterClass(&WndClass);
InitCommonControls(); Ctl3dRegister(hInstance); Ctl3dEnabled();
HFONT std_font;
std_font=CreateFont(12,0,0,0,400,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,"MS Sans Serif");
hWindow=CreateWindow("WinProg","Fenster", WS_OVERLAPPEDWINDOW,0,0,400, 400,NULL,NULL,hInstance,NULL);
hButton1=CreateWindow("BUTTON","Zeigen", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,10,10,140, 30,hWindow, (HMENU) 1,hInstance,NULL); hEdit=CreateWindow(RICHEDIT_CLASS,"Ein RichEdit", WS_CHILD | WS_VISIBLE|WS_BORDER|ES_SUNKEN|ES_SAVESEL|ES_MULTILINE,180,10,140, 30,hWindow, (HMENU) 1,hInstance,NULL);
Ctl3dSubclassCtl(hEdit);
ShowWindow (hWindow,SW_MAXIMIZE);
SendMessage(hButton1,WM_SETFONT,(WPARAM)std_font,1); SendMessage(hEdit,WM_SETFONT,(WPARAM)std_font,1);
UpdateWindow(hWindow);
MSG Message;
while (GetMessage(&Message,NULL,0,0)) { TranslateMessage(&Message); DispatchMessage(&Message);
}
return (Message.wParam);
}
|
-- Demokratie ist die Diktatur der Mehrheit.
www.siedler25.org/ ( Siedler2 - Remake ) |