|
-
June 24th, 2010, 01:00 PM
#1
[RESOLVED] Refresh Dialog
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;
}
-
June 24th, 2010, 01:14 PM
#2
Re: Refresh Dialog
Unless creating window like this did u try creating Dialog from resource editor and CreateDialog api to create that.
-
June 24th, 2010, 01:40 PM
#3
Re: Refresh Dialog
returning wParam fixes the problem 
Code:
return static_cast<int>(msgs.wParam);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|