I am working on a win32 based application. When Iclick on a button, the command prompt is opened using WinExec, but when I move the command window than I feel that drawing is not done on my application.
What I do is:
case WM_ERASEBKGND:
InvalidateRect(hwnd,NULL,TRUE);
break;
It is working fine at my end but when I test it on Windows CE machine than the problem remains the same.
FYI this application works as a shell there.
Instead of using WinExec i used CreateProcess
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
TCHAR wchCmdPath[MAX_PATH];
memset(wchCmdPath,_T('\0'),MAX_PATH);
GetSystemDirectory(wchCmdPath,MAX_PATH);
wcscat(wchCmdPath,_T("\\cmd.exe"));
if( !CreateProcess( NULL,
wchCmdPath,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi )
)
{
return;
}
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
Thanks in advance.
Hi Richard,
Thanks for ur reply.
All drawing is done in WM_PAINT. Application have 6 buttons when click on buttons image is displayed on Picture control. Picture control is dynamically created.
If picture is large than scrolling is enabled.
on WM_PAINT all painting is done.
For button there is a class that load the image and paint the button.
EnglishBtn.LoadFromRec(IDB_BITMAP_SR);// Image in button is loaded from resource
EnglishBtn.Paint();// Paint button.
I write the code of InvalidateRect when
1) Button is clicked and image is displayed.
2) User scroll the picture.
Everything working fine when i click on button, scroll the image etc. But when i execute the command prompt and move quickly than that portion displayed gray.
Now please tell me where i am wrong :(
Thanks again. - Shilpi Boosar 7 hrs ago