Click here to get back home

Repaint HomeScreen plugin area

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Repaint HomeScreen plugin area ado103c 11-06-2007
Get Chitika Premium
Posted by ado103c on November 6, 2007, 2:50 am
Please log in for more thread options
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 ?


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 ?
>

Similar ThreadsPosted
Help in getting my homescreen plugin to work on homescreen January 19, 2007, 6:39 pm
Homescreen plugin May 31, 2005, 4:21 pm
Homescreen Plugin June 24, 2005, 1:08 pm
homescreen, home.xml, and plugin July 11, 2006, 4:56 pm
Homescreen Plugin Events ... September 26, 2007, 2:08 pm
Best Practice? Homescreen Plugin October 16, 2007, 10:01 pm
signing homescreen plugin November 18, 2008, 4:29 am
Homescreen plugin - Images and Text June 1, 2005, 12:05 pm
PocketPC vs Smartphones homescreen plugin June 10, 2005, 12:32 am
How to communicate between Homescreen Plugin and C# Application ? July 6, 2006, 4:05 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap