politicalconfusion | 4 Jun 23:19 2008
Picon

How to persist CMainFrame location and size?

I have a CFrameWindowImpl<>-based window.  In my WM_CREATE handler, I
load values for the last location and size of the window and call
MoveWindow() with them.  However, when wndMain.ShowWindow( nCmdShow )
is called from Run(), WM_SIZE and WM_MOVE messages are received with
different values from the ones I set.  Are there any canonical WTL
examples of persisting window location and size?  I can set the
location and size after wndMain.ShowWindow( nCmdShow ), but I get a
quick flash of the window at the wrong size and location.

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:wtl-digest@... 
    mailto:wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    wtl-unsubscribe@...

(Continue reading)

Dick Dievendorff | 5 Jun 06:16 2008
Picon
Picon

RE: How to persist CMainFrame location and size?

I restore my main window's position and size in my main module's Run method,
after calling wndMain.CreateEx and before ShowWindow.

I save the main window's position and size in the main window's OnDestroy
handler.

I use GetWindowPlacement and SetWindowPlacement and save each of the values
in the registry.

YMMV.

Dick

From: wtl@...
[mailto:wtl@...] On Behalf Of
politicalconfusion
Sent: Wednesday, June 04, 2008 2:20 PM
To: wtl@...
Subject: [wtl] How to persist CMainFrame location and size?

I have a CFrameWindowImpl<>-based window. In my WM_CREATE handler, I
load values for the last location and size of the window and call
MoveWindow() with them. However, when wndMain.ShowWindow( nCmdShow )
is called from Run(), WM_SIZE and WM_MOVE messages are received with
different values from the ones I set. Are there any canonical WTL
examples of persisting window location and size? I can set the
location and size after wndMain.ShowWindow( nCmdShow ), but I get a
quick flash of the window at the wrong size and location.

[Non-text portions of this message have been removed]
(Continue reading)

politicalconfusion | 6 Jun 01:24 2008
Picon

Re: How to persist CMainFrame location and size?

Thanks.  That works perfectly.  I find it strange that MoveWindow in
the same place (between CreateEx and ShowWindow) doesn't.  But I guess
SetWindowPlacement is a little more involved (and the canonical way to
do it).

--- In wtl@..., "Dick Dievendorff" <dieven <at> ...> wrote:
>
> I restore my main window's position and size in my main module's Run
method,
> after calling wndMain.CreateEx and before ShowWindow.
> 
>  
> 
> I save the main window's position and size in the main window's
OnDestroy
> handler.
> 
>  
> 
> I use GetWindowPlacement and SetWindowPlacement and save each of the
values
> in the registry.
> 
>  
> 
> YMMV.
> 
>  
> 
> Dick
(Continue reading)

wtller | 6 Jun 07:41 2008
Picon

how to use CommandBar in dialogbox?

thx!

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:wtl-digest@... 
    mailto:wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    wtl-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

jacklin5168 | 10 Jun 09:27 2008
Picon

Re: how to create a vertical toolbar based on WTL CToolBarCtrl

--- In wtl@..., "johndiiix" <johndiiix <at> ...> wrote:
>
> What happened when you just created the toolbar with the vertical
> window that you wanted?  
> 
> There are a lot of articles concerning WTL at CodeProject, and it
> seems likely that you could find what you are looking for on this 
page: 
> 
> http://www.codeproject.com/KB/wtl/
> 
> More specifically, here are a couple of articles that deal with
> toolbars:  
> 
> http://www.codeproject.com/KB/wtl/wtl4mfc3.aspx
> 
> http://www.codeproject.com/KB/wtl/CToolBarHelper.aspx
> 
> Neither of these things are exactly rocket science; there are 
vertical
> and dockable toolbars in many applications.  I don't have the time 
to
> research it for you, but the information is certainly out there. 
> 
> John

///////////////////////////////////////////
Hi John,
   It's kind of you for your help.
   But what you refered to is not fit for my question. I've read 
(Continue reading)

jacklin5168 | 10 Jun 09:28 2008
Picon

Re: how to create a vertical toolbar based on WTL CToolBarCtrl

--- In wtl@..., "johndiiix" <johndiiix <at> ...> wrote:
>
> What happened when you just created the toolbar with the vertical
> window that you wanted?  
> 
> There are a lot of articles concerning WTL at CodeProject, and it
> seems likely that you could find what you are looking for on this 
page: 
> 
> http://www.codeproject.com/KB/wtl/
> 
> More specifically, here are a couple of articles that deal with
> toolbars:  
> 
> http://www.codeproject.com/KB/wtl/wtl4mfc3.aspx
> 
> http://www.codeproject.com/KB/wtl/CToolBarHelper.aspx
> 
> Neither of these things are exactly rocket science; there are 
vertical
> and dockable toolbars in many applications.  I don't have the time 
to
> research it for you, but the information is certainly out there. 
> 
> John
> 
> 
///////////////////////////////////////////
Hi John,
   It's kind of you for your help.
(Continue reading)

jacklin5168 | 10 Jun 10:07 2008
Picon

Re: how to create a vertical toolbar based on WTL CToolBarCtrl

--- In wtl@..., "domehead100" <domehead100 <at> ...> wrote:
>
> --- In wtl@..., jack lin <jacklin5168 <at> > wrote:
> >
> > it's really urgent for me to get the problem(Creating a vertical 
> toolbar using WTL::CToolBarCtrl) done.?I tried in many ways, and 
not 
> successed any time. 
> 
> Seems you are familiar with MFC, so you are aware that the majority 
> of the docking bar stuff in MFC is part of the frame window class.  
> As you note, I guess WTL doesn't have that functionality.  
> 
> There are some docking window frameworks, such as Mr. Viskoe's and 
> one or two more on CodeProject.  None of them handle toolbars, so I 
> guess you'd have to write your own "toolbar window" and wire it up 
in 
> one of these frameworks.
> 
> But, if all you want is a vertical toolbar, say on the left side of 
a 
> frame window like Lotus Notes, this is what I would do...
> 
> I would probably try to write a templated mixin class so that it 
> could be used with any window.  The mixin would handle NCCalcSize 
and 
> NCPaint messages to reserve an area in the nonclient area of the 
> window for the "toolbar", and it would draw the toolbar buttons in 
> that area.  That area could be on any side of the window's 
nonclient 
(Continue reading)

jacklin5168 | 10 Jun 10:08 2008
Picon

Re: how to create a vertical toolbar based on WTL CToolBarCtrl

--- In wtl@..., "domehead100" <domehead100 <at> ...> wrote:
>
> --- In wtl@..., jack lin <jacklin5168 <at> > wrote:
> >
> > it's really urgent for me to get the problem(Creating a vertical 
> toolbar using WTL::CToolBarCtrl) done.?I tried in many ways, and 
not 
> successed any time. 
> 
> Seems you are familiar with MFC, so you are aware that the majority 
> of the docking bar stuff in MFC is part of the frame window class.  
> As you note, I guess WTL doesn't have that functionality.  
> 
> There are some docking window frameworks, such as Mr. Viskoe's and 
> one or two more on CodeProject.  None of them handle toolbars, so I 
> guess you'd have to write your own "toolbar window" and wire it up 
in 
> one of these frameworks.
> 
> But, if all you want is a vertical toolbar, say on the left side of 
a 
> frame window like Lotus Notes, this is what I would do...
> 
> I would probably try to write a templated mixin class so that it 
> could be used with any window.  The mixin would handle NCCalcSize 
and 
> NCPaint messages to reserve an area in the nonclient area of the 
> window for the "toolbar", and it would draw the toolbar buttons in 
> that area.  That area could be on any side of the window's 
nonclient 
(Continue reading)

jack lin | 10 Jun 10:14 2008
Picon

Re: Re: how to create a vertical toolbar based on WTL CToolBarCtrl

Hi Mike,
       I'm so apprieciated for your help. You give the right answer for 
me. Could you share your mixin with me?

 Best Regards!
jacklin

----- Original Message ----
From: domehead100 <domehead100@...>
To: wtl@...
Sent: Friday, May 23, 2008 11:13:44 AM
Subject: [wtl] Re: how to create a vertical toolbar based on WTL CToolBarCtrl

--- In wtl <at> yahoogroups. com, jack lin <jacklin5168 <at>  ...> wrote:
>
> it's really urgent for me to get the problem(Creating a vertical 
toolbar using WTL::CToolBarCtrl) done.  I tried in many ways, and not 
successed any time. 

Seems you are familiar with MFC, so you are aware that the majority 
of the docking bar stuff in MFC is part of the frame window class. 
As you note, I guess WTL doesn't have that functionality. 

There are some docking window frameworks, such as Mr. Viskoe's and 
one or two more on CodeProject. None of them handle toolbars, so I 
guess you'd have to write your own "toolbar window" and wire it up in 
one of these frameworks.

But, if all you want is a vertical toolbar, say on the left side of a 
frame window like Lotus Notes, this is what I would do...
(Continue reading)

jack lin | 10 Jun 10:17 2008
Picon

Re: Re: how to create a vertical toolbar based on WTL CToolBarCtrl

Hi John,
       It's kind of you for your help.
       But what you refered to is not fit for my question. I've read articles under above link in
codeproject. I also posted a message in its forum and got no useful answer.

 Best Regards!
jacklin

----- Original Message ----
From: johndiiix <johndiiix@...>
To: wtl@...
Sent: Thursday, May 22, 2008 10:07:12 AM
Subject: [wtl] Re: how to create a vertical toolbar based on WTL CToolBarCtrl

What happened when you just created the toolbar with the vertical
window that you wanted? 

There are a lot of articles concerning WTL at CodeProject, and it
seems likely that you could find what you are looking for on this page: 

http://www.codeproj ect.com/KB/ wtl/

More specifically, here are a couple of articles that deal with
toolbars: 

http://www..codeproj ect.com/KB/ wtl/wtl4mfc3. aspx

http://www.codeproj ect.com/KB/ wtl/CToolBarHelp er.aspx

Neither of these things are exactly rocket science; there are vertical
(Continue reading)


Gmane