Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh a Modless Dialog with ICON or BMP???

Status
Not open for further replies.

youssef

Programmer
Mar 13, 2001
96
BE
I use a Modless Dialog for display the result.

Sometimes, the Modless Dialog doesn't refresh correctly.

for example : In the Modles Dialog, I have a Static Message and a ICON .

I call Modless.Invalidate() in my Parent Dialog. The Static is refreshed but the ICON is NOT refresh.

I add this code for resolving my problem but sometimes the ICON isn't refresh.

// Yield
WMSG msg;
DWORD dwCount = 0;
while( PeekMessage((PMSG)&msg, (HWND) NULL, 0, 0, PM_REMOVE) && (dwCount < 1000 ))
{
dwCount++;
TranslateMessage( (PMSG)&msg );
DispatchMessage( (PMSG)&msg );
}

If anyone can help me
 
It may be a wrong default style of Your Static (for example, it is IDC_ICON).
Try so:
GetDlgItem( IDC_ICON)->ModifyStyle( SS_BITMAP , SS_ICON | SS_CENTERIMAGE);
If it not works, You can use that:
GetDlgItem( IDC_ICON)->ShowWindow(SW_HIDE );
GetDlgItem( IDC_ICON)->ShowWindow( SW_SHOWNORMAL );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top