I am having trouble getting my toolbar dialog to interact with the main window, or the edit box. Right now I am just testing it on save, and open. The functions do work from the menu, but not from the dialog. I've tried using SendMessage(), PostMessage(), and SendNotifyMessage(). None of which seem to work correctly with the window. PostMessage freezes the entire program, the other two don't do anything. I just want to be able to click save from the toolbar, and have it save the edit box text. There are no compiler errors, or warnings. Here is my DlgProc() function.
Code:
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case ID_FILE_SAVE:
if(MiniWnd){
PostMessage(hwnd,WM_COMMAND,ID_FILE_SAVE,0);
}
else
MessageBox(hwnd,"Please open the edit box","Error",MB_OK);
break;
case ID_FILE_OPEN:
if(MiniWnd){
PostMessage(hwnd,WM_COMMAND,ID_FILE_OPEN,0);
}
else
MessageBox(hwnd,"Please open the edit box","Error",MB_OK);
break;
case ID_DLG_CLOSE:
ShowWindow(dlgret,SW_HIDE);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
I can't get it to indent correctly on the post, but it is indented right in the .cpp file, so don't worry about that.