CreateStatusWindow
-
Hallo! Ich möchte eine Statuszeile zu meinem Programm hinzufügen.
Bis jetzt hab ichs so:g_hStatusBar = CreateStatusWindow(WS_CHILD | WS_VISIBLE, NULL, g_hWindow, 0)
Aber VC 6 sagt, CreateStatusWindow sei nicht deklariert. In welcher Headerdatei ist die Funktion deklariert?
Oder ist es ein anderer Fehler?Gruß, Maxi
-
commctrl.h
-
und welche Lib?
Compilern tut er ersts mal
-
comctl32.lib
kannst du nicht in die hilfe gucken?
-
Sorry sorry, aber in meiner Hilfe steht nur das hier:
schön in HTML-Format und so, aber wos definiert ist, steht nicht da:
CreateStatusWindow
HWND CreateStatusWindow(
LONG style,
LPCTSTR lpszText,
HWND hwndParent,
UINT wID
);Creates a status window, which is typically used to display the status of an application. The window generally appears at the bottom of the parent window, and it contains the specified text.
Returns the handle for the status window if successful, or NULL otherwise. To get extended error information, callGetLastError.
style
Window styles for the status window. This parameter must include the WS_CHILD style and should also include the WS_VISIBLE style.
lpszText
Address of a null-terminated string that specifies the status text for the first part.
hwndParent
Handle to the parent window.
wID
Control identifier for the status window. The window procedure uses this value to identify messages it sends to the parent window.
The CreateStatusWindow function calls theCreateWindow function to create the window. It passes the parameters to CreateWindow without modification and sets the position, width, and height parameters to default values.--------------------------------------------------------------------------------
Top of Page
1997 Microsoft Corporation. All rights reserved. Terms of Use.
-
Auführen geht jetzt, aber er zeigt nichts an von der Statuszeile. Mein code:
HWND g_hStatusBar; g_hStatusBar = CreateStatusWindow(WS_CHILD | WS_VISIBLE, NULL, g_hWindow, 0); char Fehler[1024]; sprintf(Fehler, "%i", GetLastError()); MessageBox(NULL, Fehler, "Fehler!", NULL); ShowWindow(g_hStatusBar, 0); sprintf(Fehler, "%i", GetLastError()); MessageBox(NULL, Fehler, "Fehler!", NULL); if(g_hStatusBar == NULL) MessageBox(NULL, "NULL", "NULL", NULL);
Es kommt immer MsgBox "0, nochmal "0" und dann "NULL"
woran liegt das?
-
InitCommonControls
oder
InitCommonControlsEx
-
Hm, es funktioniert immer noch nicht. Jetzt hab ichs so:
LPINITCOMMONCONTROLSEX ccontrols; ccontrols->dwICC = ICC_BAR_CLASSES; ccontrols->dwSize = sizeof(LPINITCOMMONCONTROLSEX); if(!InitCommonControlsEx(ccontrols)) MessageBox(NULL, "InitCommFehler", "FEHLer", NULL);; // <-- wird angezeigt char Fehler[1024]; sprintf(Fehler, "%i", GetLastError()); MessageBox(NULL, Fehler, "Fehler!", NULL); // <-- zeigt 0 an, also suceeded
was soll ich blos machen?? Es muss doch irgendwie gehen...
-
INITCOMMONCONTROLSEX ccontrols; ccontrols.dwICC = ICC_BAR_CLASSES; ccontrols.dwSize = sizeof(INITCOMMONCONTROLSEX); if(!InitCommonControlsEx(&ccontrols)) MessageBox(NULL, "InitCommFehler", "FEHLer", NULL);; // <-- wird angezeigt
-
Aua, ich habe die Erstellung der Statuszeile noch vor dem Erstellen des Hauptfensters gemacht... wie dumm kann man sein...
Jetzt sehe ich wenigstens die Statusleiste.
mal schauen wies mit Text anzeigen so steht...Danke erstmal an alle, die mir geholfen haben