http://hashvb.earlsoft.co.uk/index.php?title=User:Dee/Flicker_handling&feed=atom&action=history
User:Dee/Flicker handling - Revision history
2024-03-28T15:26:13Z
Revision history for this page on the wiki
MediaWiki 1.22.2
http://hashvb.earlsoft.co.uk/index.php?title=User:Dee/Flicker_handling&diff=2902&oldid=prev
Dee: Adjusted wording
2010-04-05T21:32:54Z
<p>Adjusted wording</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 21:32, 5 April 2010</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>{{VB6}}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>{{VB6}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>VB6 seems to <del class="diffchange diffchange-inline">ignore </del>the <del class="diffchange diffchange-inline">erasebackground </del>message and <del class="diffchange diffchange-inline">do it's </del>background drawing internally in <del class="diffchange diffchange-inline">wm_paint</del>.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>VB6 seems to <ins class="diffchange diffchange-inline">ignores </ins>the <ins class="diffchange diffchange-inline">WM_ERASEBKGND </ins>message and <ins class="diffchange diffchange-inline">deso its </ins>background drawing internally in <ins class="diffchange diffchange-inline">the WM_PAINT message</ins>.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This can cause flickering so to "fix" this, we <del class="diffchange diffchange-inline">eat </del>both messages and override <del class="diffchange diffchange-inline">VBs wm_paint </del>handling, set <del class="diffchange diffchange-inline">everytign </del>up and call the paint event ourselves.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This can cause flickering so to "fix" this, we <ins class="diffchange diffchange-inline">handle </ins>both messages and override <ins class="diffchange diffchange-inline">VB's own WM_PAINT </ins>handling, set <ins class="diffchange diffchange-inline">everything </ins>up and call the paint event ourselves.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>We make sure the messages are not passed on to the next handler by telling the subclasser not to call CallWindowProc() but return <del class="diffchange diffchange-inline">immediatly</del>.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>We make sure the messages are not passed on to the next handler by telling the subclasser not to call CallWindowProc() but return <ins class="diffchange diffchange-inline">immediately</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td></tr>
</table>
Dee
http://hashvb.earlsoft.co.uk/index.php?title=User:Dee/Flicker_handling&diff=2901&oldid=prev
Dee: Initial version
2010-04-05T21:30:51Z
<p>Initial version</p>
<p><b>New page</b></p><div>{{WIP}}<br />
{{VB6}}<br />
<br />
VB6 seems to ignore the erasebackground message and do it's background drawing internally in wm_paint.<br />
This can cause flickering so to "fix" this, we eat both messages and override VBs wm_paint handling, set everytign up and call the paint event ourselves.<br />
We make sure the messages are not passed on to the next handler by telling the subclasser not to call CallWindowProc() but return immediatly.<br />
<br />
<pre><br />
Private Function SubClassed_WindowProc(ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long, Handled As Boolean) As Long<br />
Dim PaintInfo As PAINTSTRUCT<br />
Dim hDC As Long<br />
<br />
Select Case hWnd<br />
Case GraphFrame.hWnd<br />
Select Case Msg<br />
Case &HF 'WM_PAINT<br />
'We handle WM_PAINT ourselves as VB6 seems to explicitly draw the background in its handler<br />
hDC = BeginPaint(hWnd, PaintInfo)<br />
GraphFrame_Paint<br />
EndPaint hWnd, PaintInfo<br />
'We've handled it so VB doesn't do anything further<br />
SubClassed_WindowProc = 0<br />
Handled = True<br />
<br />
Case &H14 'WM_ERASEBKGND<br />
'WM_ERASEBKGND seems to be a noop, but we handle it here anyway<br />
SubClassed_WindowProc = -1<br />
Handled = True<br />
<br />
Case &H137 'WM_CTLCOLORSCROLLBAR<br />
'Ignore the message to fix the scrollbar background<br />
Handled = True<br />
<br />
End Select<br />
End Select<br />
End Function<br />
</pre></div>
Dee