statuszeilen text setzten
-
SetWindowText funzt aber!!!
-
SendMessage(hStatusbar, SB_SETTEXT, iNummerdesPanels, MeinText);
-
Luckie, lies doch erstmal, bevor du sowas postest!
-
Original erstellt von WebFritzi:
Luckie, lies doch erstmal, bevor du sowas postest!mag aber sein das Lawilog das mit den iNummerdesPanels versehentlich vergessen hat...
-
WebFritzi, denk doch erstmal, bevor du sowas postest!
-
Naja, man sollte die MSDN schon ordentlich lesen können...
-
bevor ihr euch die kopfe vom leib reißt :o : soll ich nicht besser erstmal code posten ?
(wird aber erst morgen)
lw
-
JA
-
hi,
hat sich erstmal erledigt. (wen interessiert warum, der ließt weiter.
)
ich hab alles rausgenommen, was zu meinem projekt gehört und hab nur das notwendige und das statuszeilen-betreffende zeugs dringelassen. und das geht jetzt. also werde ich jetzt mal auf eine lange fehlersuche einstellen.
und hier für alle die, die z.b. über die such-funktion hierein gekommen sind und und ein ähnliches problem haben: (sonst hätte ich mir ja umsonst die arbeit gemacht, alles andere rauszunehmen
;):
#include <windows> #include <commctrl> using namespace std; LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM); HINSTANCE hInstance; int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPreInst, LPSTR lpszCommandLine, int iCmdShow) { MSG msg; HWND hWnd; WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_HREDRAW | CS_VREDRAW | CS_OWNDC, MainWndProc, 0, 0, hInst, NULL, LoadCursor(NULL, IDC_ARROW), CreateSolidBrush(RGB(0, 153, 51)), NULL, "myclass", NULL}; hInstance = hInst; if(! RegisterClassEx(&wc)) { return -1; } hWnd = CreateWindow("myclass", "bla bla bla", WS_TILED | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SIZEBOX | WS_SYSMENU | WS_VISIBLE | WS_MAXIMIZE, 0, 0,//x, y 600, 400,//width, height NULL, NULL, hInst, NULL); if(! hWnd) { return -1; } ShowWindow(hWnd, iCmdShow); UpdateWindow(hWnd); while (GetMessage(&msg, NULL, 0, 0) != 0) { TranslateMessage(&msg); DispatchMessage(&msg); } return (int)msg.wParam; } LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static HWND hStausBar; switch(msg) { case WM_CREATE: { InitCommonControls(); //Statuszeile erstellen hStausBar = CreateWindow(STATUSCLASSNAME, "Fertig.", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hWnd, (HMENU)102, hInstance, NULL); break; } case WM_LBUTTONDOWN: { SetWindowText(hStausBar, "click"); SendMessage(hStausBar, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)"click2"); RECT rStatusRect; GetClientRect(hStausBar, &rStatusRect); /*DrawStatusText(GetDC(hStausBar), (LPRECT)&rStatusRect, "click3", NULL); //RelaseDC... (ja ich weiß)*/ SendMessage(hStausBar, WM_SETTEXT, NULL, (LPARAM)"click4"); InvalidateRect(hStausBar, &rStatusRect, true); break; } default:return(DefWindowProc(hWnd, msg, wParam, lParam)); } return 0; }
-
m_strText = lpszText;
CWnd* pMainWnd = ::AfxGetMainWnd();
if (pMainWnd)
pMainWnd->SendMessage(WM_SETMESSAGESTRING, 0, (LPARAM)(LPCTSTR)m_strText);
-
Das ist kein MFC Programm @Frank II
-
Aber das Prinzip ist doch daselbe.