|
Posted by dbgrick on November 6, 2007, 9:51 am
Please log in for more thread options
Instead of drawing in the button event, try calling InvalidateRect(hWnd,
NULL, FALSE). This will force the control to redraw itself.
Regards,
Rick D.
Contractor
"ado103c" wrote:
> Hello, all!
>
> I'm try to write something interactive user application using homescreen
> mechanism.
> I need to repaint plugin area (plugin in focus), when user press Left \
> Right nav. keys...
>
> My code sample below:
>
> HRESULT PluginMem:: OnEvent(
> PluginEvent* ppe
> )
> {
> ....
>
> switch(ppe->idEvent)
> {
> case PE_KEYDOWN:
>
> switch(ppe->p.key.wVKey) {
>
> // left nav key
> case 37:
>
> hdc = ppe->p.paint.hdc;
>
> hbr = CreateSolidBrush(test);
> rect=ppe->p.paint.rcDraw;
>
> rect.right=rect.left + 176;
> rect.top+=20;
> rect.bottom--;
>
> // draw the status bar and our XML-specfied custom title
> FillRect(hdc, &rect, hbr);
> DrawText(hdc, TEXT("Left pressed"), -1,
> const_cast<RECT*>(&(ppe->p.paint.rcDraw)),
> DT_SINGLELINE | DT_CENTER | DT_TOP);
>
>
> break;
>
> // right nav key
> case 39:
> break;
>
> }
>
> break;
>
> case PE_ACTION:
> ........
>
> break;
>
> case PE_PAINT:
> {
> hdc = ppe->p.paint.hdc;
> hbr = CreateSolidBrush(rgbLeft);
> rect=ppe->p.paint.rcDraw;
>
> rect.right=rect.left + 176;
> rect.top+=20;
> rect.bottom--;
>
> FillRect(hdc, &rect, hbr);
> DrawText(hdc, TEXT("Test"), -1,
> const_cast<RECT*>(&(ppe->p.paint.rcDraw)),
> DT_SINGLELINE | DT_CENTER | DT_TOP);
>
>
> break;
> }
>
> This code gives no effect ... I don't see any changes after pressing Left
> navigation key ...
> Could you point me, where my mistake ?
>
|