How to get notification on change in Orientation.
Hi,
I developed one exe which display some graphics(text with some background image) on desktop. My TickerContainer class is derived from CBase. Now problem is that " how can i get event when user change display mode (portrait to landscape and vice-versa).
i know that by implementing CEikAppUi::HandleResourceChangeL() in application, we get notification in HandleResourceChangeL. but my exe is not derived from CEikAppUi or CCoeControl.
is there any solution to this problem?
savaj.
Re: How to get notification on change in Orientation.
if you can not find any clean way, you could always have an timer that checks the Screendevice time to time, to see whether screen resolution has changed.
Re: How to get notification on change in Orientation.
You could try CCoeEnv::AddResourceChangeObserverL() , and then check the TWsEvent received to see if it helps, though I never tried it myself.
Re: How to get notification on change in Orientation.
Since most events dispatched to various handlers are actually unwrapped from a generic Window Server event, you may try experimenting with a raw RWsSession first.
Re: How to get notification on change in Orientation.
You could try the watching for the EEventScreenDeviceChanged event and then acting on that, though personally I would log all events coming through and work out which one is the actual event when the switch happens.
[url]http://www.symbian.com/Developer/techlib/v70sdocs/doc_source/DevGuides/cpp/Graphics/WindowServerClientSide/WindowServerGuide1/WindowServerEvents/HowToSystemRelatedEvents.html[/url]
Re: How to get notification on change in Orientation.
Thanks to all for reply,
Sorry for replying late, as i was OOO.
i resolved issue in following way.
first i enabled screen change event of my RWindowGroup
iWindowGroup.EnableScreenChangeEvents();
then implemented one EventListener. which is an Active object.
EventListener notify on change in orientation.
iWsSession.GetEvent(wsEvent); //TWsEvent wsEvent;
switch (wsEvent.Type())
{
case EEventScreenDeviceChanged:
{
iClient->HandleKeyEventL(*wsEvent.Key(),EEventScreenDeviceChanged);
break;
}
}
savaj..