2 Fragen ( Kontxtmenü, Fenster Problem )
-
Hi Jungs,
ich hab nun eine ListBox und möchte gerne wenn man da mit der Rechten maus rein clickt das ein Menü kommt wo man z.B auf Löschen drücken kann so das wäre das erste.
Das zweite ich habe ein Fenster gemacht :Parent : HWND hwnd; hwnd=CreateDialog(hI,MAKEINTRESOURCE(IDD_MAIN),0,DlgProc); Child : HWND hChat; hChat=CreateDialog(hI,MAKEINTRESOURCE(IDD_CHAT),hwnd,DlgChat); int CALLBACK DlgChat(HWND hChat, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: // Initialisierung der Elemente break; case WM_CLOSE: MessageBox(hChat,"ENDE...","...",NULL); DestroyWindow(hChat); break; } return 0; }Aber das Fenster ist total komisch es überdeckt das Parent Fenster obwohl das Parent den Focus hat es überdeckt es einfach außerdem wenn ich auf das X drücke verschwindet es zwar, aber ich kann es nicht nochmal aufrufen
Was mache ich falsch ?Gruß
-
Für dein erstes Problem musst du afaik die Listbox subclassen. Zum zweiten Problem:
Typically, the dialog box procedure should return TRUE if it processed the message, and FALSE if it did not. If the dialog box procedure returns FALSE, the dialog manager performs the default dialog operation in response to the message.
-
AFAIK nicht.
If a window is a child window, DefWindowProc sends the message to the parent.