Hello,

I am writing a PocketPC application, and to get a window which is full
screen, I use CW_USEDEFAULT on Width, Height, Left and Top on
CreateWindowEx.

Now, that produces a too large window. The bottom panel of the device is
partially covered. What is the recommended way to create a window with
the exact size of the screen, without covering the bottom panel?

I know this is a very simple question, but I googled a lot and couldn't
find an answer =(

thank you very much,

Felipe

Re: Windows CE window size by ctacke/>

ctacke/>
Mon Feb 18 06:54:03 CST 2008

Query to find the current size of the SIP.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com


"Felipe Monteiro de Carvalho" <felipe@gmail.com> wrote in message
news:Oo$lGggcIHA.5208@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I am writing a PocketPC application, and to get a window which is full
> screen, I use CW_USEDEFAULT on Width, Height, Left and Top on
> CreateWindowEx.
>
> Now, that produces a too large window. The bottom panel of the device is
> partially covered. What is the recommended way to create a window with the
> exact size of the screen, without covering the bottom panel?
>
> I know this is a very simple question, but I googled a lot and couldn't
> find an answer =(
>
> thank you very much,
>
> Felipe



Re: Windows CE window size by Felipe

Felipe
Mon Feb 18 07:01:45 CST 2008

<ctacke/> escreveu:
> Query to find the current size of the SIP.

Please define better what is a SIP:

http://www.google.com/search?hl=en&safe=active&client=firefox-a&rls=org.mozilla%3Apt-BR%3Aofficial&q=SPI+windows+ce&btnG=Search

I am currently doing it like this:

Windows.SystemParametersInfo(SPI_GETWORKAREA, 0, @WR, 0);

Left := WR.Left;
Top := WR.Top;
Height := WR.Bottom - WR.Top - GetSystemMetrics(SM_CYMENU)
- GetSystemMetrics(SM_CXBORDER) * 2;
Width := WR.Right - WR.Left;

But it's somewhat a hack. I don't know which constants I should be using
exactly. Simply Height := WR.Bottom - WR.Top will produce a too high
window, which covers the menus.

thanks,

Re: Windows CE window size by Scott

Scott
Mon Feb 18 10:08:08 CST 2008

Felipe Monteiro de Carvalho <felipe@gmail.com> wrote:
>
>Hello,
>
>I am writing a PocketPC application, and to get a window which is full
>screen, I use CW_USEDEFAULT on Width, Height, Left and Top on
>CreateWindowEx.
>
>Now, that produces a too large window. The bottom panel of the device is
>partially covered. What is the recommended way to create a window with
>the exact size of the screen, without covering the bottom panel?

Use SHInitDialog with the SHIDIF_SIZEDLG flag.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
-- Ben Franklin

Re: Windows CE window size by Felipe

Felipe
Mon Feb 18 10:39:37 CST 2008

Scott Seligman escreveu:
> Use SHInitDialog with the SHIDIF_SIZEDLG flag.

But there are no dialogs on my application, in the sense that I don't
use windows resources to create my window. I have a code created window
(created with CreateWindowEx). It must be done this way because I am
writing a cross-platform gui library.

Therefore I won't receive a WM_INITDIALOG message like the docs say this
function should be used.

thanks,

Re: Windows CE window size by Scott

Scott
Mon Feb 18 10:49:06 CST 2008

Felipe Monteiro de Carvalho <felipe@gmail.com> wrote:
>
>Scott Seligman escreveu:
>> Use SHInitDialog with the SHIDIF_SIZEDLG flag.
>
>But there are no dialogs on my application, in the sense that I don't
>use windows resources to create my window. I have a code created window
>(created with CreateWindowEx). It must be done this way because I am
>writing a cross-platform gui library.

Well, you're still going to need resources. That said, there's no reason
you can't use SHInitDialog on a normal window.

>Therefore I won't receive a WM_INITDIALOG message like the docs say
>this function should be used.

The docs don't say it should be used in WM_INITDIALOG, they just
provide a code example of that. Most of my apps use it after the
CreateWindowEx call.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
All religions are founded on the fear of the many and the cleverness
of the few.
-- Stendhal

Re: Windows CE window size by r_z_aret

r_z_aret
Mon Feb 18 13:33:15 CST 2008

You might want to check my 7 Jun 2007 contribution to a thread called
"Work Area on a Pocket PC square emulator" in this newsgroup.

On Mon, 18 Feb 2008 09:25:25 +0100, Felipe Monteiro de Carvalho
<felipe@gmail.com> wrote:

>Hello,
>
>I am writing a PocketPC application, and to get a window which is full
>screen, I use CW_USEDEFAULT on Width, Height, Left and Top on
>CreateWindowEx.
>
>Now, that produces a too large window. The bottom panel of the device is
>partially covered. What is the recommended way to create a window with
>the exact size of the screen, without covering the bottom panel?
>
>I know this is a very simple question, but I googled a lot and couldn't
>find an answer =(
>
>thank you very much,
>
>Felipe

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