Board index » Visual Studio » skinned Dialog & scrollbars

skinned Dialog & scrollbars

Visual Studio61
I have a skinned (WS_EX_LAYERED) Dialog-App and would like to scroll a child

dialog without flicker.

ScrollWindow(...) copies the valid clientregion and the new (now visible)

region is drawn in OnPaint(). My Problem is that these steps are visible

which means when the copy occurs i see the old pixels of the clientarea

overlapped with the copied pixels of the valid clientregion and at last the

new pixels are drawn in OnPaint(). You can imagine this isnt a "nice"

scrolling.

If i turn of the LAYERED-style everthing works fine, cause it just happens

so fast, that the eye cannt catch these steps.



So what can I do to make ScrollWindow(...) paint to the device context all

at once or is there another way of a flicker free scrolling of a skinned

app?



Thx Mark


-
 

Re:skinned Dialog & scrollbars

Hi, Mark,



Use

UpdateWindow() or

RedrawWindow(...RDW_UPDATENOW...)

after ScrollWindow call.



Andrew Fedoniouk.

terrainormatica.com">terrainormatica.com







"Mark Daring" <cap_nemesis@hotmail.com>wrote in message

Quote
I have a skinned (WS_EX_LAYERED) Dialog-App and would like to scroll a

child

dialog without flicker.

ScrollWindow(...) copies the valid clientregion and the new (now visible)

region is drawn in OnPaint(). My Problem is that these steps are visible

which means when the copy occurs i see the old pixels of the clientarea

overlapped with the copied pixels of the valid clientregion and at last

the

new pixels are drawn in OnPaint(). You can imagine this isnt a "nice"

scrolling.

If i turn of the LAYERED-style everthing works fine, cause it just happens

so fast, that the eye cannt catch these steps.



So what can I do to make ScrollWindow(...) paint to the device context all

at once or is there another way of a flicker free scrolling of a skinned

app?



Thx Mark









-

Re:skinned Dialog & scrollbars

Yup, that helped!

It was much smoother, though it flickered. The tricky part was getting rid

of the flickering.

First I used to set the windoworigin of the device context according to the

amount i scrolled like this:



CPaintDC dc(this);

dc.SetWindowOrig(m_HScrollPos, m_VScrollPos);

...

::DefWindowProc(m_hWnd, WM_PRINT, (WPARAM)mDC->GetSafeHdc(),....);



which screwed up.

Removing the 2nd line did it.



Thx Mark



"Andrew Fedoniouk" <news@terrainformatica.com>schrieb im Newsbeitrag

Quote
Hi, Mark,



Use

UpdateWindow() or

RedrawWindow(...RDW_UPDATENOW...)

after ScrollWindow call.



Andrew Fedoniouk.

terrainormatica.com">terrainormatica.com





-