sss0379
February 6th, 2003, 04:42 AM
Hi Everybody,
I m creating a chat application. Now if both the end users who are chatting with each other have there chat window open they get the chat message. So now i need to check that when the chat window isn't open i need to open a dialog & display the message in it. I do come to know whether the chat window is open or not but if i call createdialog & later showwindow the dialog box shows up but the everything is disabled. Can anybody help me in this regard?
The following is the code snippet that i have written: -
HWND hWndDialog;
hWndDialog = GetHwndOpen(); //My Function which determines whether the Window is open or not if open then gives the Handle else returns NULL
if(hWndDialog == NULL){
hWndDialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DLGCHAT), NULL,(DLGPROC) dlgChat); // IDD_DLGCHAT is my dialog box name & dlgChat is the function
ShowWindow(hWndDialog,SW_SHOW);
}
LRESULT CALLBACK DlgChat(HWND hDlg, UINT message, WPARAM wParam, LPARAM LParam)
{
switch (message)
{
case WM_INITDIALOG:
{
::MessageBox(NULL,"in INIT","CC",0);
return TRUE ;
}
}
return FALSE;
}
I have also the Visible property of the IDD_DLGCHAT to true. Moreover the Disabled property of the IDD_DLGCHAT is False.
I also get the MessageBox written in WM_INITDIALOG.
Please help me in this regard.
Thanking You,
Sonali.....
Have a gud day!!!!!
I m creating a chat application. Now if both the end users who are chatting with each other have there chat window open they get the chat message. So now i need to check that when the chat window isn't open i need to open a dialog & display the message in it. I do come to know whether the chat window is open or not but if i call createdialog & later showwindow the dialog box shows up but the everything is disabled. Can anybody help me in this regard?
The following is the code snippet that i have written: -
HWND hWndDialog;
hWndDialog = GetHwndOpen(); //My Function which determines whether the Window is open or not if open then gives the Handle else returns NULL
if(hWndDialog == NULL){
hWndDialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DLGCHAT), NULL,(DLGPROC) dlgChat); // IDD_DLGCHAT is my dialog box name & dlgChat is the function
ShowWindow(hWndDialog,SW_SHOW);
}
LRESULT CALLBACK DlgChat(HWND hDlg, UINT message, WPARAM wParam, LPARAM LParam)
{
switch (message)
{
case WM_INITDIALOG:
{
::MessageBox(NULL,"in INIT","CC",0);
return TRUE ;
}
}
return FALSE;
}
I have also the Visible property of the IDD_DLGCHAT to true. Moreover the Disabled property of the IDD_DLGCHAT is False.
I also get the MessageBox written in WM_INITDIALOG.
Please help me in this regard.
Thanking You,
Sonali.....
Have a gud day!!!!!