Click here to get back home

Dialog full screen?

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Dialog full screen? Lisa Pearlson 07-12-2005
Get Chitika Premium
Posted by Lisa Pearlson on July 12, 2005, 6:00 am
Please log in for more thread options
When you create dialog based apps, can you register your own classname or
does it always have to be one specific to dialog boxes? I wish to use custom
dialog box class name to assist FindWindow.

More important, I want to use a dialog based app so I can easily design a
user interface with some controls on them.
But when I create a dialog based app using this piece of code:


int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int nCmdShow
)
{

INT nResult = DialogBox(hInstance,
MAKEINTRESOURCE(IDD_MAIN),
NULL,
(DLGPROC)DialogProc);

return(nResult);
}


But this just pops up a floating dialog box, doesn't put the caption on top,
of the window (the bar that also has standard icons like battery status and
such) but puts the title in the dialog, which doesn't cover the entire
screen.

The dialog should be full size, and contain menu items.. How do I resize the
dialog box, and make sure the title appears where it should? Obviously it is
not by making the dialog full screen and overlappen.

I'm really frustrated.. dialog based apps are so common, why the wizard
doesn't provide one is beyond me.

Lisa

P.S. I tried WTL, but same issues.




Posted by GG on July 12, 2005, 9:38 am
Please log in for more thread options
[cut]
>
> But this just pops up a floating dialog box, doesn't put the caption on
> top, of the window (the bar that also has standard icons like battery
> status and such) but puts the title in the dialog, which doesn't cover the
> entire screen.
>
> The dialog should be full size, and contain menu items.. How do I resize
> the dialog box, and make sure the title appears where it should? Obviously
> it is not by making the dialog full screen and overlappen.
>
> I'm really frustrated.. dialog based apps are so common, why the wizard
> doesn't provide one is beyond me.

add a WM_INITDIALOG handler in your dialog procedure; in the WM_INITDIALOG
handler add this code:

SHINITDLGINFO shidi;
memset(&shidi, 0, sizeof(SHINITDLGINFO));
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hDlg; //hDlg is the dialog window handle
SHInitDialog(&shidi); //error checking omitted

this will make your dialog full screen and will add the dialog title to the
top bar.
To add a menu bar, use this code (again, in WM_INITDIALOG handler):

SHMENUBARINFO si;
memset(&si, 0, sizeof(SHMENUBARINFO));
si.cbSize = sizeof(SHMENUBARINFO);
si.hwndParent = hDlg;
si.nToolBarId = IDR_MENUBAR;
si.hInstRes = hInstance;
SHCreateMenuBar(&si);


HTH,


--
Giuseppe Govi
g.govi <a> vodafone.it




Posted by Lisa Pearlson on July 12, 2005, 6:21 pm
Please log in for more thread options
Thank you a lot. By looking up SHINITDLGINFO in the online docs, I was able
to reveal the documentation I was looking for!!! Haven't read the docs yet,
but hopefully it includes how to add scroll bars and such.

Thanks,
Lisa


> [cut]
>>
>> But this just pops up a floating dialog box, doesn't put the caption on
>> top, of the window (the bar that also has standard icons like battery
>> status and such) but puts the title in the dialog, which doesn't cover
>> the entire screen.
>>
>> The dialog should be full size, and contain menu items.. How do I resize
>> the dialog box, and make sure the title appears where it should?
>> Obviously it is not by making the dialog full screen and overlappen.
>>
>> I'm really frustrated.. dialog based apps are so common, why the wizard
>> doesn't provide one is beyond me.
>
> add a WM_INITDIALOG handler in your dialog procedure; in the WM_INITDIALOG
> handler add this code:
>
> SHINITDLGINFO shidi;
> memset(&shidi, 0, sizeof(SHINITDLGINFO));
> shidi.dwMask = SHIDIM_FLAGS;
> shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
> shidi.hDlg = hDlg; //hDlg is the dialog window handle
> SHInitDialog(&shidi); //error checking omitted
>
> this will make your dialog full screen and will add the dialog title to
> the top bar.
> To add a menu bar, use this code (again, in WM_INITDIALOG handler):
>
> SHMENUBARINFO si;
> memset(&si, 0, sizeof(SHMENUBARINFO));
> si.cbSize = sizeof(SHMENUBARINFO);
> si.hwndParent = hDlg;
> si.nToolBarId = IDR_MENUBAR;
> si.hInstRes = hInstance;
> SHCreateMenuBar(&si);
>
>
> HTH,
>
>
> --
> Giuseppe Govi
> g.govi <a> vodafone.it
>
>




Posted by Lisa Pearlson on July 12, 2005, 6:31 pm
Please log in for more thread options
I guess I cheered too soon. Just 1 page explaining the difference between
PocketPC and SmartPhone screens and controls.
No sample code. :(

Is my code to display dialog using "DialogBox" the way to go? How do I add a
scroll bar and make ALL controls on that dialog scroll (or do I have to move
each of them myself using MoveWindow?)

How can I change Class name for my dialog, or can it not be changed? If not,
how else can I use FindWindow effectively? Just the window name is not
reliable.

Cheers,
Lisa

> Thank you a lot. By looking up SHINITDLGINFO in the online docs, I was
> able to reveal the documentation I was looking for!!! Haven't read the
> docs yet, but hopefully it includes how to add scroll bars and such.
>
> Thanks,
> Lisa
>
>
>> [cut]
>>>
>>> But this just pops up a floating dialog box, doesn't put the caption on
>>> top, of the window (the bar that also has standard icons like battery
>>> status and such) but puts the title in the dialog, which doesn't cover
>>> the entire screen.
>>>
>>> The dialog should be full size, and contain menu items.. How do I resize
>>> the dialog box, and make sure the title appears where it should?
>>> Obviously it is not by making the dialog full screen and overlappen.
>>>
>>> I'm really frustrated.. dialog based apps are so common, why the wizard
>>> doesn't provide one is beyond me.
>>
>> add a WM_INITDIALOG handler in your dialog procedure; in the
>> WM_INITDIALOG handler add this code:
>>
>> SHINITDLGINFO shidi;
>> memset(&shidi, 0, sizeof(SHINITDLGINFO));
>> shidi.dwMask = SHIDIM_FLAGS;
>> shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
>> shidi.hDlg = hDlg; //hDlg is the dialog window handle
>> SHInitDialog(&shidi); //error checking omitted
>>
>> this will make your dialog full screen and will add the dialog title to
>> the top bar.
>> To add a menu bar, use this code (again, in WM_INITDIALOG handler):
>>
>> SHMENUBARINFO si;
>> memset(&si, 0, sizeof(SHMENUBARINFO));
>> si.cbSize = sizeof(SHMENUBARINFO);
>> si.hwndParent = hDlg;
>> si.nToolBarId = IDR_MENUBAR;
>> si.hInstRes = hInstance;
>> SHCreateMenuBar(&si);
>>
>>
>> HTH,
>>
>>
>> --
>> Giuseppe Govi
>> g.govi <a> vodafone.it
>>
>>
>
>




Posted by GG on July 12, 2005, 6:32 pm
Please log in for more thread options
> Thank you a lot. By looking up SHINITDLGINFO in the online docs, I was
> able to reveal the documentation I was looking for!!! Haven't read the
> docs yet, but hopefully it includes how to add scroll bars and such.
>

AFAIR adding scroll bars is very simple: just add the WS_VSCROLL style to
your template. In eVC4 IDE, use the "Vertical scroll" check box in the
Dialog Properties window.


--
Giuseppe Govi
g.govi <a> vodafone.it




Similar ThreadsPosted
Not full screen Dialog Box April 24, 2006, 8:42 am
Full screen application changes home screen? May 23, 2007, 9:03 am
full screen app in smartphone March 16, 2006, 4:04 am
Full Screen Mode August 15, 2006, 6:33 am
Make window full screen? October 18, 2005, 12:28 am
problems if no menubar while FULL SCREEN August 10, 2006, 6:06 am
SmartPhone ListBox Control - Full Screen Dialogoue List March 2, 2006, 9:09 am
MAPIRULE and Smartphone (full strory. problem still not solved) August 29, 2005, 12:16 pm
dialog based app July 10, 2005, 8:44 am
scrollbar in a dialog August 11, 2005, 12:12 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap