// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
CPaintDC dc(this); // device context for painting
Thanks for your help on this.., I am able to draw the constant line if i have opened other window on dialog box, but here in my application the line will move from left to right in between two sliders along with the slider positions.
while the line is moving, if i have opened any window on dialog box, the previous line is not getting erasing.
I thought of it is losting the previous line pixels information..
Can you please tell me how i have to achive this..?
Well Im not Saadi (poet)[^].
Your answer is easy if you want to clear previous lines you can draw on it again for example you have this code:
if you use of this code again you clear previous line.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
first take the contents of the file using FILE* like c funtions
gradually turn to next line ,meanwhile to store a static value if the pointer goes to downwards if reached 456 write " " ie empty text there ...
go straight forward until you reach the first crossroad with traffic lights, then turn left and straight forward to the next crossroad with traffic lights where you will take the left turn and then make a turn on first available street on your right. Go straight forward down the street and at the end, on your right you'll see the hotel.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke