Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to get ReDraw event in exe from window server?

From Wiki
Jump to: navigation, search
Article Metadata
Created: savaj (08 Mar 2009)
Last edited: hamishwillee (09 Feb 2012)

Why it is required?
When you draw something in exe (without CONE environment), you will not get redraw event automatically. It is required because when some part of your rect gets invalid than you have to validate it again. Possible cases when your rect might get invalid are opening other aap, receive call, receive SMS etc.

How to implement it?
We have to request redraw events from the window server, we can do this by the RedrawReady method of window server. We also need to create an active object for redraw events.

CMyReDraw::CMyReDraw(RWsSession& aWsSession): CActive(CActive::EPriorityStandard), iWsSession(aWsSession)
iStatus = KRequestPending;
//iWsSession is your window server session and assuming u have created it.
void CMyReDraw::RunL()
TWsRedrawEvent e;
//GetRedraw will give you redraw event
//you can call your drawing function here.
iStatus = KRequestPending;
//you should not call RedrawReady again until you've either called GetRedraw() or RedrawReadyCancel().
void CMyReDraw::DoCancel()

Related Links:

This page was last modified on 9 February 2012, at 04:33.
26 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.