QUOTE(Martyr2 @ 30 Oct, 2007 - 04:10 PM)

Usually this is a sign of not firing a repaint when you are suppose to. However we can't find that out without any code displayed. Perhaps you can help us out and provide some and then maybe someone will go "AH HA! There is the problem!" and all will be right with the world.
Then you will be able to go on and make billions of dollars and you can forget about us guys at DIC. hehe

Billion of dollar hahaha? that's alot of money, but nah I don't want that much; just enough for the living and not owning any debt that's all good for me, also who knows maybe down the road if I become expert like you, I may join you guys the super star coders at DIC.
CODE
int textPosition = 350; //this is the position where thetext should be at
const int maxDisplayLine = 10; //limit how many lines availabe to display the text
int currentDisplayLinePosition = 0; //this keeps track the current position of the displaying text
int textLength = 0;
LPSTR id = NULL;
void zoomTextDescription(LPSTR descriptionID, int length, int posY)
{
HWND menuWindow = FindWindow(NULL, TEXT("My Window"));
if(currentDisplayLinePosition < maxDisplayLine)
{
currentDisplayLinePosition +=1;
textPosition = posY;
textLength = length;
id = descriptionID;
InvalidateRect(menuWindow, NULL, FALSE);
}
else //even though the condition is fail, but there is one text description
{ //left of that fail condition need to display
currentDisplayLinePosition = 0;
textPosition = 300;
textLength = length;
id = descriptionID;
InvalidateRect(menuWindow, NULL, FALSE);
}
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case ID_MENU_ZOOMme:
{
DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_zoomCommand), hwnd, AboutDlgProc1);
}
break;
case WM_PAINT:
{
HDC hdc = GetDC(hwnd);
TextOut(hdc, 5, textPosition, (LPCWSTR)id, textLength);
ReleaseDC(hwnd, hdc);
}
break;
case WM_DESTROY:
{
PostQuitMessage(0);
}
break;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
BOOL CALLBACK AboutDlgProc1(HWND dlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_magnifyOn:
{
zoomTextDescription((LPSTR)TEXT("Magnify On"), (int)strlen("Magnify On"), textPosition +=18);
}
break;
case SC_CLOSE:
case WM_DESTROY:
//case WM_QUIT:
case WM_CLOSE:
{
EndDialog(dlg, 0);
PostQuitMessage(0);
return TRUE;
}
break;
}//end of COMMAND message switch case
}//end of message switch case
return FALSE;
}
basically my code above, have a menu and under the menu it has submenu where it will open a dialog box with one button to click on. Whenever that button is clicked on, it will call zoomTextDescription() to update the global variables so it can be drawn inside the WndProc(). Each text will display line by line with the starting position at 350, the space between each line is 18. So if I click on the button for many times then i drag another window over those display texts, they will get erased except the last line is showing.
This post has been edited by chronoTrigger: 30 Oct, 2007 - 04:34 PM