i got a win32 project, on my WinMain() function i create a dialog and i monitor the dialog events. The events are mainly from winsock ( Asynchronous Sockets ).
The problem is that after getting the first few events , the main Dialog "Stops Responing" , although the aplication continues to work fine on the background.
Is there a way to refresh the Dialog?
code sample on creating the dialog
Code:int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nShowCmd) { MSG msgs; HWND hwnd; WNDCLASSEX wClass; ZeroMemory(&wClass,sizeof(WNDCLASSEX)); wClass.cbClsExtra=NULL; wClass.cbSize=sizeof(WNDCLASSEX); wClass.cbWndExtra=NULL; wClass.hbrBackground=(HBRUSH)COLOR_WINDOW; wClass.hCursor=LoadCursor(NULL,IDC_ARROW); wClass.hIcon=NULL; wClass.hIconSm=NULL; wClass.hInstance=hInst; wClass.lpfnWndProc=(WNDPROC)WinProc; wClass.lpszClassName="Window Class"; wClass.lpszMenuName=NULL; wClass.style=CS_HREDRAW|CS_VREDRAW; RegisterClassEx(&wClass); HWND hWnd=CreateWindowEx(NULL,"Window Class","Project",WS_OVERLAPPEDWINDOW, //WS_POPUP | WS_VISIBLE 400, 200, 300, 100,NULL,NULL,hInst,NULL); ShowWindow(hWnd,nShowCmd); ZeroMemory(&msgs,sizeof(UINT)); while(GetMessage(&msgs,NULL,0,0)) { TranslateMessage(&msgs); DispatchMessage(&msgs); } return 0; }




Reply With Quote