Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Property Sheet Wizard Resize. Making the size smaller

105 views
Skip to first unread message

Alex Gray

unread,
Mar 10, 2004, 11:08:05 AM3/10/04
to
Hi,

I'm making an installer using the a Property Sheet Wizard, and
following the suggestions in this messageboard, i resize it with the
code below. BUT, when i reach a certain height, i cannot click on the
buttons anymore. I can see the entire buttons but i can only click on
the bottom part of the buttons. It's as if some window is on top of
the button, which is preventing me to click on it.

Is there anyway to move the buttons so that they are on top of this
"mysterious" window?

BOOL CInstallerPropertySheet::OnInitDialog()
{
// Get a handle to the Tab Control (buttons, and "little horizontal
line")
HWND hWnd = (HWND)::GetDlgItem(m_hWnd, AFX_IDC_TAB_CONTROL);
ASSERT(hWnd != NULL);

CRect rectOld;
::GetWindowRect(hWnd, &rectOld);

// Now move it:
::SetWindowPos(hWnd, NULL, 0, 0, 480, 50, SWP_NOMOVE | SWP_NOZORDER |
SWP_NOACTIVATE);

// Now resize the entire window.
SetWindowPos(NULL, 0, 0, 440, 100, SWP_NOMOVE | SWP_NOOWNERZORDER |
SWP_NOACTIVATE);

CWnd * pTab = GetDlgItem( AFX_IDC_TAB_CONTROL );
pTab->ModifyStyle( 0, TCS_BOTTOM );

return CPropertySheet::OnInitDialog();
}

Tim

unread,
Mar 11, 2004, 5:38:47 AM3/11/04
to
Alex,

A property sheet is a window + a tab control + each property page as a
dialog.
When you resize, you need to resize all of these including all property
pages.

If you have a wizard, the buttons along the bottom can be occluded by the
tab control, but this might not be obvious.
Get rid of all your hard coded values - they will not ever work for long. If
a user has their screen set to 120DPI (as I do) then all your sizing
estimates will be wrong.

I haven't seen the trick with getting the HWND for the tab control before -
must try it, but there is a standard way.

Assuming the 'trick' works - I don't see why not, you only need to get the
tab control once:

CWnd * pTab = GetDlgItem( AFX_IDC_TAB_CONTROL );

now use its hWnd.

If the sheet is working as a wizard, there is no point in doing this:

pTab->ModifyStyle( 0, TCS_BOTTOM );

This may also fowl things up since when in wizard mode, the tabs seem to be
pushed over the visible top - you will see this if you set top to zero and
is perhaps why you are trying to put the tabs at the bottom......

Maybe start by resizing things so that you can see everything. Then you will
be able to see what your computations should be based on. They will then be
reliable.

Note that the default size of a property sheet is the size of the largest
dialog resource (when not in wizard mode anyway).

- Tim

"Alex Gray" <gra...@netscape.net> wrote in message
news:50347d7a.04031...@posting.google.com...

0 new messages