From: Allan Bruce on
I have created a win32 instant messenger program and am porting it over to
PocketPC. Thankfully, I already had the program as unicode as I believe
this was a requirement for PocketPC. Anyway, the port has gone quite well,
I've had to lose a lot of functionality as it isnt required on the handheld
device. So far, I have my program running and working fine but there are a
few things I would like to get working a bit neater (as far as the GUI is
concerned).

Firstly, I would like my window to appear almost fullscreen, that is filling
the screen of the handheld device but with the task bar at the bottom and
the usual title bar at the top. So far, my window is almost doing this, I
can see the title bar fine but my window extends over thet ask bar at the
bottom. What should I do to create a window so that this doesnt happen?

I am trying to add a menu to my app, and am using the following code:
mHwndCB = CommandBar_Create(GetModuleHandle(NULL), mHwnd, 0);
CommandBar_InsertMenubar(mHwndCB, GetModuleHandle(NULL), IDR_MENU1, 0);
CommandBar_AddAdornments(mHwndCB, 0, 0);
CommandBar_Show(mHwndCB, TRUE);
None of the commands return failure, but the command bar doesnt appear to
show. I am confused by what msdn says about InsertMenuBar and the final
param, I have no buttons inserted. Can anybody tell me how I can get this
menu showing correctly?

Finally, I am using an edit control ("edit" class) and I want to change the
colour and size of the text, how can I do this?

Many Thanks.
Allan


From: TJ on
CommandBar is from previous versions of WinCE. WinCE 3.0+ uses
SHCreateMenuBar.

Here's an example of how it works:
SHMENUBARINFO mbi;
memset(&mbi,0,sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = hwnd;
mbi.nToolBarId = MYMENU;
mbi.hInstRes = hInst;
mbi.dwFlags=SHCMBF_COLORBK;
mbi.nBmpId = 0;
mbi.cBmpImages = 0;
mbi.clrBk=RGB(178,70,178);
mbi.hwndMB=0;
SHCreateMenuBar(&mbi);
hmenu=mbi.hwndMB;

To set a font:
myfont = CreateFont( 12, /* Height */
0, /* Width */
0, /* Angel */
0, /* Orientation */
FW_NORMAL, /* Weight */
FALSE, /* Italics */
FALSE, /* Underline */
FALSE, /* Strikethrough */
OEM_CHARSET, /* Charset */
OUT_DEFAULT_PRECIS, /* Output
Precision */
CLIP_DEFAULT_PRECIS, /* Clip Precision */
DEFAULT_QUALITY, /* Quality */
DEFAULT_PITCH, /* Pitch */
"Terminal"); /* Font name */
SendMessage(hedit,WM_SETFONT,(WPARAM)myfont,(LPARAM)TRUE);

To set font color:

heditdc=GetDC(hedit);
SetTextColor(heditdc,RGB(255,0,0));




Allan Bruce wrote:
> I have created a win32 instant messenger program and am porting it over to
> PocketPC. Thankfully, I already had the program as unicode as I believe
> this was a requirement for PocketPC. Anyway, the port has gone quite well,
> I've had to lose a lot of functionality as it isnt required on the handheld
> device. So far, I have my program running and working fine but there are a
> few things I would like to get working a bit neater (as far as the GUI is
> concerned).
>
> Firstly, I would like my window to appear almost fullscreen, that is filling
> the screen of the handheld device but with the task bar at the bottom and
> the usual title bar at the top. So far, my window is almost doing this, I
> can see the title bar fine but my window extends over thet ask bar at the
> bottom. What should I do to create a window so that this doesnt happen?
>
> I am trying to add a menu to my app, and am using the following code:
> mHwndCB = CommandBar_Create(GetModuleHandle(NULL), mHwnd, 0);
> CommandBar_InsertMenubar(mHwndCB, GetModuleHandle(NULL), IDR_MENU1, 0);
> CommandBar_AddAdornments(mHwndCB, 0, 0);
> CommandBar_Show(mHwndCB, TRUE);
> None of the commands return failure, but the command bar doesnt appear to
> show. I am confused by what msdn says about InsertMenuBar and the final
> param, I have no buttons inserted. Can anybody tell me how I can get this
> menu showing correctly?
>
> Finally, I am using an edit control ("edit" class) and I want to change the
> colour and size of the text, how can I do this?
>
> Many Thanks.
> Allan
>
>
From: r_z_aret on
On Wed, 17 Aug 2005 15:24:57 -0500, TJ <someone(a)somewhere.com> wrote:

>CommandBar is from previous versions of WinCE. WinCE 3.0+ uses
>SHCreateMenuBar.

Actually, SHCreateMenuBar is for the Pocket PC and Smartphone
_platforms_, no matter what the version of the base (Windows CE)
operating system. It definitely works under versions 3.0 and 4.2 of
the base operating system (HPC 2000 and some industrial devices that
use Windows CE but don't fit any Microsoft platform).

Older Pocket PC platforms (the original and 2002) let applications use
the CommandBar_Create. Applications that use it run in "emulation"
mode, with the Task Bar at the bottom of the screen and the
application menu at the top. As of Pocket PC 2003 (or perhaps 2003
SE), the function seems to work but the menu is not visible (as the OP
noted).


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

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
From: r_z_aret on
On Wed, 17 Aug 2005 11:26:25 +0100, "Allan Bruce" <amb(a)abc.net> wrote:

>I have created a win32 instant messenger program and am porting it over to
>PocketPC. Thankfully, I already had the program as unicode as I believe
>this was a requirement for PocketPC. Anyway, the port has gone quite well,
>I've had to lose a lot of functionality as it isnt required on the handheld
>device. So far, I have my program running and working fine but there are a
>few things I would like to get working a bit neater (as far as the GUI is
>concerned).
>
>Firstly, I would like my window to appear almost fullscreen, that is filling
>the screen of the handheld device but with the task bar at the bottom and
>the usual title bar at the top. So far, my window is almost doing this, I
>can see the title bar fine but my window extends over thet ask bar at the
>bottom. What should I do to create a window so that this doesnt happen?
>

See my 19 June 2003 contribution to a thread called "Fullscreen" in
comp.os.ms-windows.programmer.win32. It provides source code for
related functions that work on several versions of Windows CE and
"big" Windows.


clip


>
>Finally, I am using an edit control ("edit" class) and I want to change the
>colour and size of the text, how can I do this?

I'm not sure about color/colour. But for hints about size, see my 19
January 2004 contribution to a thread called " How to change font size
in List Control" in this newsgroup.

>
>Many Thanks.
>Allan
>

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

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
From: Allan Bruce on

"TJ" <someone(a)somewhere.com> wrote in message
news:zbSdnSKemaeEAJ7eRVn-qA(a)midco.net...
> CommandBar is from previous versions of WinCE. WinCE 3.0+ uses
> SHCreateMenuBar.
>
> Here's an example of how it works:
> SHMENUBARINFO mbi;
> memset(&mbi,0,sizeof(SHMENUBARINFO));
> mbi.cbSize = sizeof(SHMENUBARINFO);
> mbi.hwndParent = hwnd;
> mbi.nToolBarId = MYMENU;
> mbi.hInstRes = hInst;
> mbi.dwFlags=SHCMBF_COLORBK;
> mbi.nBmpId = 0;
> mbi.cBmpImages = 0;
> mbi.clrBk=RGB(178,70,178);
> mbi.hwndMB=0;
> SHCreateMenuBar(&mbi);
> hmenu=mbi.hwndMB;
>
> To set a font:
> myfont = CreateFont( 12, /* Height */
> 0, /* Width */
> 0, /* Angel */
> 0, /* Orientation */
> FW_NORMAL, /* Weight */
> FALSE, /* Italics */
> FALSE, /* Underline */
> FALSE, /* Strikethrough */
> OEM_CHARSET, /* Charset */
> OUT_DEFAULT_PRECIS, /* Output Precision
> */
> CLIP_DEFAULT_PRECIS, /* Clip Precision
> */
> DEFAULT_QUALITY, /* Quality */
> DEFAULT_PITCH, /* Pitch */
> "Terminal"); /* Font name */
> SendMessage(hedit,WM_SETFONT,(WPARAM)myfont,(LPARAM)TRUE);
>
> To set font color:
>
> heditdc=GetDC(hedit);
> SetTextColor(heditdc,RGB(255,0,0));
>
>
>
>

I tried to do the font changes and add the manu bar but I get compiler
errors. I included AYGSHELL.H for the menubar stuff, but it has an error:
:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\aygshell.h(285) : error C2061: syntax error : identifier
'SIPSTATE'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\aygshell.h(475) : error C2061: syntax error : identifier
'IShellPropSheetExt'

And I cannot get the CreateFont to work, msdn says to include Afxwin.h but
it doesnt work - I think maybe because I am not using MFC?

Thanks.
Allan