View Single Post
  #2  
Old January 20th 09, 01:56 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to set control position in outlook property page?

About the best way I've found is just to get the normal sizes for both
versions and set up your code based on that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"ryotyankou via OfficeKB.com" u48591@uwe wrote in message
news:9072cd87988d5@uwe...
My environment is VC++2005/ATL/OLK2003&2007. I added Outlook::
ApplicationEvents successfully and all are ok. But the size of
propertypage
for outlook2003 and 2007 is different, so i want to adjust the controls'
position to the middle of the propertypage. But it is no use to call
SetWindowPos or MoveWindow in OnInitDialog function, what should i do? I
have
a lot of controls on the propertypage.
LRESULT CPropPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled)
{
// TODO : Add Code for message handler. Call DefWindowProc if
necessary.
GetDlgItem(IDC_STATIC_PROPAGE).SetFont(HFONT(boldF ont_));
SetTimer(FreshGUI, 1000, NULL);

//set the window position, can't take effort, why??
m_Control = GetParent();
CRect ParentRc, CurRc;
int xCord = 0, yCord = 0;
m_Control.GetClientRect(ParentRc);
GetWindowRect(CurRc);
xCord = (ParentRc.Width()-CurRc.Width())/2;
yCord = (ParentRc.Height()-CurRc.Height())/2;
SetWindowPos(HWND_TOP, xCord, yCord, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW);

return 0;
}

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ddins/200901/1


Ads