011
26.02.2005, 19:54 Uhr
RedEagle
|
das sind über 1500 Zeilen... Hier mal das Wichtigste für das Fenster:
In der WinMain
C++: |
//... wc_edit.style = CS_HREDRAW | CS_VREDRAW; //CS = Class Style wc_edit.lpfnWndProc = WndProc_Edit; wc_edit.cbClsExtra = 0; wc_edit.cbWndExtra = 0; wc_edit.hInstance = hInstance; wc_edit.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc_edit.hCursor = LoadCursor(NULL, IDC_ARROW); wc_edit.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH); wc_edit.lpszMenuName = NULL; wc_edit.lpszClassName = szAppNameE; //... if(!RegisterClass(&wc_edit)) bRegisterClassFailed = true; //... hWnd_edit = CreateWindow(szAppNameE, szAppName, WS_CAPTION, 100, 120, 400, 195, NULL, NULL, hInstance, NULL); //... ShowWindow(hWnd_edit, SW_HIDE); UpdateWindow(hWnd_edit);
|
C++: |
LRESULT CALLBACK WndProc_Edit(HWND hWnd, UINT messageE, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC hDC; HFONT hFontE; static HWND hwndStaticOK, hwndStaticABBRECHEN; static HANDLE hIconOK, hIconABBRECHEN; switch (messageE) { case WM_CREATE: { hWndTXTKommentar = CreateWindow("edit", "", WS_CHILD | WS_VISIBLE | ES_WANTRETURN , 105, 40, 180, 17, hWnd, (HMENU) 13315, (HINSTANCE) GetWindowLong (hWnd, GWL_HINSTANCE), NULL);
hFontE = CreateFont(15, 0, 0, 0, 0, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, TEXT("Courier New")); SendMessage(hWndTXTKommentar, WM_SETFONT, (WPARAM)hFontE, 0); hIconOK = LoadImage(GetModuleHandle(NULL), "Bitmaps\\bmpOK.bmp", IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE); hwndStaticOK = CreateWindow("STATIC", "", WS_CHILD | SS_NOTIFY | WS_VISIBLE | SS_BITMAP, 16, 135, 27, 17, hWnd, (HMENU)ID_eOK, (HINSTANCE) GetWindowLong (hWnd, GWL_HINSTANCE), NULL); SendMessage(hwndStaticOK, STM_SETIMAGE, (WPARAM) IMAGE_BITMAP, (LPARAM)(HANDLE) hIconOK); hIconABBRECHEN = LoadImage(GetModuleHandle(NULL), "Bitmaps\\bmpAB.bmp", IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE); hwndStaticABBRECHEN = CreateWindow("STATIC", "", WS_CHILD | SS_NOTIFY | WS_VISIBLE | SS_BITMAP, 49, 135, 80, 17, hWnd, (HMENU)ID_eABBRECHEN, (HINSTANCE) GetWindowLong (hWnd, GWL_HINSTANCE), NULL); SendMessage(hwndStaticABBRECHEN, STM_SETIMAGE, (WPARAM) IMAGE_BITMAP, (LPARAM)(HANDLE) hIconABBRECHEN); break; } case WM_PAINT: //--------------------------------------------------------- { hDC = BeginPaint(hWnd, &ps); { DrawBorder_E(hDC, hWnd); color tc; color bg; font Schrift; tc.init(0,255,0); bg.init(0,0,0); Schrift.init(15,0,false,false,false,"Courier New"); output(hDC, hWnd, 10, 8, Schrift, tc, bg, "Kommentar bearbeiten:"); } EndPaint(hWnd, &ps); break; } case WM_COMMAND: { switch(LOWORD(wParam)) //Wenn auf ein Icon geklickt wurde: { case ID_eOK: { ShowWindow(hWnd, SW_HIDE); break; } case ID_eABBRECHEN: { ShowWindow(hWnd, SW_HIDE); break; } } break; } } return DefWindowProc(hWnd, messageE, wParam, lParam); }
|
-- MFG RedEagle Dieser Post wurde am 26.02.2005 um 19:55 Uhr von RedEagle editiert. |