From: TJ on
Try using CreateFontIndrect with a logical font instead.

As for the aygshell.h problems I'm not sure why the header would be
throwing errors like that. Try commenting out those lines.


Allan Bruce wrote:
> "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
>
>
From: Allan Bruce on
>
> To set font color:
>
> heditdc=GetDC(hedit);
> SetTextColor(heditdc,RGB(255,0,0));
>

This doesnt seem to work, should it matter if my edit control is read only?
Thanks.
Allan



From: Allan Bruce on

"TJ" <someone(a)somewhere.com> wrote in message
news:Pq6dnZHlzah4K57eRVn-gQ(a)midco.net...
> Try using CreateFontIndrect with a logical font instead.
>
> As for the aygshell.h problems I'm not sure why the header would be
> throwing errors like that. Try commenting out those lines.
>
>

CreateFontIndirect works fine. Thanks.

I get an error 120 for SHCreateMenuBar, which is 'not implemented'. Any
ideas?

Thanks.
Allan


From: TJ on
Try:

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

or:

heditdc=GetDC(hedit);
SetBkColor(hedit,RGB(255,0,0));
SetBkMode(heditdc,OPAQUE);

With it being a readonly edit control I don't know which would be the
proper way of doing it. The background can't be changed with a readonly
edit control but the text color can be.

Allan Bruce wrote:
>>To set font color:
>>
>>heditdc=GetDC(hedit);
>>SetTextColor(heditdc,RGB(255,0,0));
>>
>
>
> This doesnt seem to work, should it matter if my edit control is read only?
> Thanks.
> Allan
>
>
>
From: TJ on
SetBkColor(heditdc,RGB(255,0,0));

TJ wrote:
> Try:
>
> heditdc=GetDC(hedit);
> SetBkMode(heditdc,TRANSPARENT);
> SetTextColor(heditdc,RGB(255,0,0));
>
> or:
>
> heditdc=GetDC(hedit);
> SetBkColor(hedit,RGB(255,0,0));
> SetBkMode(heditdc,OPAQUE);
>
> With it being a readonly edit control I don't know which would be the
> proper way of doing it. The background can't be changed with a readonly
> edit control but the text color can be.
>
> Allan Bruce wrote:
>
>>> To set font color:
>>>
>>> heditdc=GetDC(hedit);
>>> SetTextColor(heditdc,RGB(255,0,0));
>>>
>>
>>
>> This doesnt seem to work, should it matter if my edit control is read
>> only?
>> Thanks.
>> Allan
>>
>>
>>