Hi,

I am creating an MFC application for pocket pc using eVC++ inVS2005.
While testing the application in the emulator, there is a hardware
button, which changes the layout of the emulator from portrait to
landscape. How to handle this button click event?
What is the best way to change the dialog size and controls size from
portrait to landscape mode. Please help.

Thanks

Re: portrait to landscape by Barry

Barry
Thu Jul 20 10:35:43 CDT 2006

Press the calendar button on the emulator skin, and the display will toggle
between portrait and landscape. You can also switch using the PocketPC
Start / Settings, then go to the System tab and tap on the Screen icon.

Have you checked out this article?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/screen_orientation_awareness.asp.
It describes how to build an orientation-aware native-code application.

Barry

"Sri" <srinivasan222@gmail.com> wrote in message
news:1153398630.272538.289980@b28g2000cwb.googlegroups.com...
> Hi,
>
> I am creating an MFC application for pocket pc using eVC++ inVS2005.
> While testing the application in the emulator, there is a hardware
> button, which changes the layout of the emulator from portrait to
> landscape. How to handle this button click event?
> What is the best way to change the dialog size and controls size from
> portrait to landscape mode. Please help.
>
> Thanks
>



Re: portrait to landscape by KhAoX

KhAoX
Fri Jul 21 02:55:16 CDT 2006

Sri, best practise is to react WM_SIZE ... it is occurs
- on switching portrait / landscape
- creating dialog (You never know what is at beginning)
- show/hide keyboard (what couses a big mess overlaying half of a
screen)

so I use... WM_SIZE as best, Microsoft's way to use just 240x240
screens is waste of space ... but be prepared, 'cos redesign to fit
240x320 (true 240x280) in 240x240 (true 240x200) is just one big pain
(scroll bars are hard to implement on CDialog)

and one more tip... if You can (report dialog = 2 CEdit + big report
list) just create basic dialog for 240x240 and on WM_SIZE resize list
control to fill screen

> > What is the best way to change the dialog size and controls size from
> > portrait to landscape mode. Please help.
> >
> > Thanks
> >


Re: portrait to landscape by Sri

Sri
Fri Jul 21 07:00:26 CDT 2006

Thank you both for your replies. I have a doubt. How to resize an
image. Actualy I have a CDialog(with scroll bars) which displays an
image. When I switch from Portrait to landscape, the image retains the
same size. I tried using stretchblt, but of no use. Is there any method
to resize the bitmap image, which is displayed in the dialog? Please
let me know.

Thanks again..
Sri

KhAoX wrote:
> Sri, best practise is to react WM_SIZE ... it is occurs
> - on switching portrait / landscape
> - creating dialog (You never know what is at beginning)
> - show/hide keyboard (what couses a big mess overlaying half of a
> screen)
>
> so I use... WM_SIZE as best, Microsoft's way to use just 240x240
> screens is waste of space ... but be prepared, 'cos redesign to fit
> 240x320 (true 240x280) in 240x240 (true 240x200) is just one big pain
> (scroll bars are hard to implement on CDialog)
>
> and one more tip... if You can (report dialog = 2 CEdit + big report
> list) just create basic dialog for 240x240 and on WM_SIZE resize list
> control to fill screen
>
> > > What is the best way to change the dialog size and controls size from
> > > portrait to landscape mode. Please help.
> > >
> > > Thanks
> > >


Re: portrait to landscape by r_z_aret

r_z_aret
Fri Jul 21 09:53:26 CDT 2006

On 21 Jul 2006 00:55:16 -0700, "KhAoX" <andhster@gmail.com> wrote:

>Sri, best practise is to react WM_SIZE ... it is occurs
>- on switching portrait / landscape
>- creating dialog (You never know what is at beginning)
>- show/hide keyboard (what couses a big mess overlaying half of a
>screen)

I respond to WM_SIZE by resizing my screens and then sizing and
positioning controls accordingly. But I also update my windows in
response to WM_SETTINGCHANGE when WPARAM is SETTINGCHANGE_RESET,
because this specifically signals a change in orientation. See a 22
Dec 2005 thread called "Portrait to Landscape..." in this newsgroup


>> > Thanks
>> >

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

Re: portrait to landscape by Sri

Sri
Mon Jul 24 00:29:45 CDT 2006

Hi,

Thanks for your reply. I am creating a zoom application, which captures
the image of the current window.
WM_SETTINGCHANGE message was captured when i change the layout from
Portrait to landscape.
But since i wanted to capture the new image,I minimize the window using
ShowWindow method and
capture the image and again I restore the window. I understand that
WM_SETTINGCHANGE message
is again posted when minimize and restore the window. But after
restoring the window, the dialog gets closed
and it exits the application, I tried to debug and trap the problem.
But I could not understand the reason for this issue.
Can anyone please let me know, why the application exists when I
restore the window? Please help.

Thanks

r_z_aret@pen_fact.com wrote:
> On 21 Jul 2006 00:55:16 -0700, "KhAoX" <andhster@gmail.com> wrote:
>
> >Sri, best practise is to react WM_SIZE ... it is occurs
> >- on switching portrait / landscape
> >- creating dialog (You never know what is at beginning)
> >- show/hide keyboard (what couses a big mess overlaying half of a
> >screen)
>
> I respond to WM_SIZE by resizing my screens and then sizing and
> positioning controls accordingly. But I also update my windows in
> response to WM_SETTINGCHANGE when WPARAM is SETTINGCHANGE_RESET,
> because this specifically signals a change in orientation. See a 22
> Dec 2005 thread called "Portrait to Landscape..." in this newsgroup
>
>
> >> > Thanks
> >> >
>
> -----------------------------------------
> To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>
> Robert E. Zaret, eMVP
> PenFact, Inc.
> 20 Park Plaza, Suite 478
> Boston, MA 02116
> www.penfact.com