Skip to content

Commit

Permalink
Build 15.0.0.1029 - 14472, 14473, 14474, 14475, 14476, 14477, 14478, …
Browse files Browse the repository at this point in the history
…14479, 14480, 14481, 14482, 14483, 14484, 14485, 14486, 14487, 14488, 14489, 14490, 14491, 14492, 14493, 14494, 14495, 14496
  • Loading branch information
stephenegriffin committed Nov 29, 2011
1 parent 1d85413 commit 8e99c91
Show file tree
Hide file tree
Showing 65 changed files with 3,756 additions and 1,806 deletions.
5 changes: 3 additions & 2 deletions AbDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "SingleMAPIPropListCtrl.h"
#include "ColumnTags.h"
#include "MFCUtilityFunctions.h"
#include "UIFunctions.h"
#include "Editor.h"
#include "MAPIABFunctions.h"
#include "MAPIProgress.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ void CAbDlg::CreateDialogAndMenu(UINT nIDMenuResource)
CContentsTableDlg::CreateDialogAndMenu(nIDMenuResource);

UpdateMenuString(
this,
m_hWnd,
ID_CREATEPROPERTYSTRINGRESTRICTION,
IDS_ABRESMENU);
} // CAbDlg::CreateDialogAndMenu
Expand Down Expand Up @@ -117,7 +118,7 @@ void CAbDlg::OnDisplayDetails()

// Have to pass DIALOG_MODAL according to
// http://support.microsoft.com/kb/171637
EC_H(lpAddrBook->Details(
EC_H_CANCEL(lpAddrBook->Details(
&ulUIParam,
NULL,
NULL,
Expand Down
68 changes: 54 additions & 14 deletions AboutDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "stdafx.h"
#include "AboutDlg.h"
#include "ParentWnd.h"
#include "UIFunctions.h"

void DisplayAboutDlg(_In_ CWnd* lpParentWnd)
{
Expand All @@ -18,12 +19,9 @@ static TCHAR* CLASS = _T("CAboutDlg");

CAboutDlg::CAboutDlg(
_In_ CWnd* pParentWnd
):CDialog(IDD_ABOUT,pParentWnd)
):CMyDialog(IDD_ABOUT,pParentWnd)
{
TRACE_CONSTRUCTOR(CLASS);
HRESULT hRes = S_OK;
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
EC_D(m_hIcon,AfxGetApp()->LoadIcon(IDR_MAINFRAME));
} // CAboutDlg::CAboutDlg

CAboutDlg::~CAboutDlg()
Expand All @@ -34,15 +32,15 @@ CAboutDlg::~CAboutDlg()
_Check_return_ BOOL CAboutDlg::OnInitDialog()
{
HRESULT hRes = S_OK;
BOOL bRet = CDialog::OnInitDialog();
BOOL bRet = CMyDialog::OnInitDialog();
TCHAR szFullPath[256];
DWORD dwVerHnd = 0;
DWORD dwRet = 0;
DWORD dwVerInfoSize = 0;
DWORD dwCheckHeight = GetSystemMetrics(SM_CYMENUCHECK);
DWORD dwBorder = GetSystemMetrics(SM_CXEDGE);

int iRet = 0;
int i = 0;
int iRet = 0;
static TCHAR szProductName[128];

WC_D(iRet,LoadString(
Expand All @@ -57,11 +55,24 @@ _Check_return_ BOOL CAboutDlg::OnInitDialog()
CRect MyBarRect;
CRect MyCheckRect;

int iTextHeight = GetTextHeight(m_hWnd);
// Position our about text with proper height
for (i = IDD_ABOUTVERFIRST; i <= IDD_ABOUTVERLAST; i++)
{
HWND hWndAboutText = ::GetDlgItem(m_hWnd, i);
RECT rcText = {0};
::GetWindowRect(hWndAboutText, &rcText);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT) &rcText, 2);
rcText.top = 5 + iTextHeight * (i - IDD_ABOUTVERFIRST);
rcText.bottom = rcText.top + iTextHeight;
::MoveWindow(hWndAboutText, rcText.left, rcText.top, rcText.right - rcText.left, rcText.bottom - rcText.top, false);
}

// Find the shape of our client window
GetClientRect(&MyTextRect);

// Get Screen coords for the last bar
CWnd* dlgWnd = GetDlgItem(IDD_BLACKBARLAST);
// Get Screen coords for the last control
CWnd* dlgWnd = GetDlgItem(IDD_ABOUTVERLAST);
if (dlgWnd) dlgWnd->GetWindowRect(&MyBarRect);
// Convert those to client coords we need
ScreenToClient(&MyBarRect);
Expand All @@ -77,18 +88,24 @@ _Check_return_ BOOL CAboutDlg::OnInitDialog()
| WS_VISIBLE
| WS_HSCROLL
| WS_VSCROLL
| WS_BORDER
| ES_AUTOHSCROLL
| ES_AUTOVSCROLL
| ES_MULTILINE
| ES_READONLY,
MyTextRect,
this,
IDD_HELP));
m_HelpText.ModifyStyleEx(WS_EX_CLIENTEDGE, 0, 0);
::SendMessage(m_HelpText.m_hWnd, EM_SETEVENTMASK,NULL, ENM_LINK);
::SendMessage(m_HelpText.m_hWnd, EM_AUTOURLDETECT,true, NULL);
m_HelpText.SetBackgroundColor(false, MyGetSysColor(cBackground));
m_HelpText.SetFont(GetFont());
ClearEditFormatting(m_HelpText.m_hWnd);

CString szHelpText;
szHelpText.FormatMessage(IDS_HELPTEXT,szProductName);
m_HelpText.SetWindowText(szHelpText);
m_HelpText.SetFont(GetFont());

MyCheckRect.SetRect(
MyTextRect.left,
Expand All @@ -107,7 +124,6 @@ _Check_return_ BOOL CAboutDlg::OnInitDialog()
this,
IDD_DISPLAYABOUT));
m_DisplayAboutCheck.SetCheck(RegKeys[regkeyDISPLAY_ABOUT_DIALOG].ulCurDWORD?BST_CHECKED:BST_UNCHECKED);
m_DisplayAboutCheck.SetFont(GetFont());
CString szDisplayAboutCheck;
EC_B(szDisplayAboutCheck.LoadString(IDS_DISPLAYABOUTCHECK));
m_DisplayAboutCheck.SetWindowText(szDisplayAboutCheck);
Expand All @@ -118,7 +134,6 @@ _Check_return_ BOOL CAboutDlg::OnInitDialog()
if (dwVerInfoSize)
{
// If we were able to get the information, process it.
int i = 0;
size_t cchRoot = 0;

BYTE* pbData = NULL;
Expand Down Expand Up @@ -197,13 +212,38 @@ _Check_return_ LRESULT CAboutDlg::WindowProc(UINT message, WPARAM wParam, LPARAM
case WM_HELP:
return true;
break;
case WM_NOTIFY:
{
ENLINK* lpel = (ENLINK*) lParam;
if (lpel)
{
switch (lpel->nmhdr.code)
{
case EN_LINK:
{
if (WM_LBUTTONUP == lpel->msg)
{
TCHAR szLink[128] = {0};
TEXTRANGE tr = {0};
tr.lpstrText = szLink;
tr.chrg = lpel->chrg;
::SendMessage(lpel->nmhdr.hwndFrom, EM_GETTEXTRANGE, NULL, (LPARAM) &tr);
ShellExecute(NULL, _T("open"), szLink, NULL, NULL, SW_SHOWNORMAL); // STRING_OK
}
return NULL;
}
break;
}
}
break;
}
} // end switch
return CDialog::WindowProc(message,wParam,lParam);
return CMyDialog::WindowProc(message,wParam,lParam);
} // CAboutDlg::WindowProc

void CAboutDlg::OnOK()
{
CDialog::OnOK();
CMyDialog::OnOK();
int iCheckState = m_DisplayAboutCheck.GetCheck();

if (BST_CHECKED == iCheckState)
Expand Down
4 changes: 2 additions & 2 deletions AboutDlg.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once
// AboutDlg.h : Displays an about dialog
#include "Dialog.h"

void DisplayAboutDlg(_In_ CWnd* lpParentWnd);

class CAboutDlg : public CDialog
class CAboutDlg : public CMyDialog
{
public:
CAboutDlg(
Expand All @@ -16,7 +17,6 @@ class CAboutDlg : public CDialog
_Check_return_ LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
_Check_return_ BOOL OnInitDialog();

HICON m_hIcon;
CRichEditCtrl m_HelpText;
CButton m_DisplayAboutCheck;
};
54 changes: 28 additions & 26 deletions AddIns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include "MAPIFunctions.h"
#include "Editor.h"
#include "Guids.h"
#ifndef MRMAPI
#include "UIFunctions.h"
#endif

// Our built in arrays, which get merged into the arrays declared in mfcmapi.h
#include "GenTagArray.h"
Expand Down Expand Up @@ -567,6 +570,7 @@ void UnloadAddIns()
DebugPrint(DBGAddInPlumbing,_T("Done unloading AddIns\n"));
} // UnloadAddIns

#ifndef MRMAPI
// Adds menu items appropriate to the context
// Returns number of menu items added
ULONG ExtendAddInMenu(HMENU hMenu, ULONG ulAddInContext)
Expand Down Expand Up @@ -607,46 +611,39 @@ ULONG ExtendAddInMenu(HMENU hMenu, ULONG ulAddInContext)
}
if (lpCurAddIn->lpMenu[ulMenu].ulContext & ulAddInContext)
{
// Add the Add-Ins menu if we haven't added it already
if (!hAddInMenu)
{
WCHAR szAddInTitle[8] = {0}; // The length of IDS_ADDINSMENU
int iRet = NULL;
// CString doesn't provide a way to extract just Unicode strings, so we do this manually
EC_D(iRet,LoadStringW(GetModuleHandle(NULL),
IDS_ADDINSMENU,
szAddInTitle,
_countof(szAddInTitle)));

hAddInMenu = CreatePopupMenu();

MENUITEMINFOW topMenu = {0};
topMenu.cbSize = sizeof(MENUITEMINFO);
topMenu.fMask = MIIM_SUBMENU|MIIM_TYPE|MIIM_STATE|MIIM_ID;
topMenu.hSubMenu = hAddInMenu;
topMenu.fState = MFS_ENABLED;
topMenu.dwTypeData = szAddInTitle;
EC_B(InsertMenuItemW(
::InsertMenuW(
hMenu,
(UINT) -1,
MF_BYPOSITION | MF_POPUP | MF_STRING,
&topMenu));
MF_BYPOSITION | MF_POPUP | MF_ENABLED,
(UINT_PTR) hAddInMenu,
(LPCWSTR) szAddInTitle);
}

// Now add each of the menu entries
if (SUCCEEDED(hRes))
{
MENUITEMINFOW subMenu = {0};
subMenu.cbSize = sizeof(MENUITEMINFO);
subMenu.fMask = MIIM_TYPE|MIIM_STATE|MIIM_ID|MIIM_DATA;
subMenu.fType = MFT_STRING;
subMenu.fState = MFS_ENABLED;
subMenu.wID = uidCurMenu;
subMenu.dwTypeData = lpCurAddIn->lpMenu[ulMenu].szMenu;
subMenu.dwItemData = (ULONG_PTR) &lpCurAddIn->lpMenu[ulMenu];

EC_B(InsertMenuItemW(
LPMENUENTRY lpMenu = CreateMenuEntry(lpCurAddIn->lpMenu[ulMenu].szMenu);
if (lpMenu)
{
lpMenu->m_AddInData = (ULONG_PTR) &lpCurAddIn->lpMenu[ulMenu];
}

EC_B(AppendMenu(
hAddInMenu,
(UINT) -1,
MF_BYPOSITION | MF_POPUP | MF_STRING,
&subMenu));
MF_ENABLED | MF_OWNERDRAW,
uidCurMenu,
(LPCTSTR) lpMenu));
uidCurMenu++;
}
}
Expand All @@ -655,7 +652,6 @@ ULONG ExtendAddInMenu(HMENU hMenu, ULONG ulAddInContext)
lpCurAddIn = lpCurAddIn->lpNextAddIn;
}
}
if (hAddInMenu) DestroyMenu(hAddInMenu);
DebugPrint(DBGAddInPlumbing,_T("Done extending menus\n"));
return uidCurMenu-ID_ADDINMENU;
} // ExtendAddInMenu
Expand All @@ -674,7 +670,12 @@ LPMENUITEM GetAddinMenuItem(HWND hWnd, UINT uidMsg)
uidMsg,
false,
&subMenu));
return (LPMENUITEM) subMenu.dwItemData;
if (subMenu.dwItemData)
{
return (LPMENUITEM) ((LPMENUENTRY) subMenu.dwItemData)->m_AddInData;
}

return NULL;
} // GetAddinMenuItem

void InvokeAddInMenu(_In_opt_ LPADDINMENUPARAMS lpParams)
Expand All @@ -701,6 +702,7 @@ void InvokeAddInMenu(_In_opt_ LPADDINMENUPARAMS lpParams)

WC_H(lpParams->lpAddInMenu->lpAddIn->pfnCallMenu(lpParams));
} // InvokeAddInMenu
#endif // MRMAPI

// Compare type arrays.
int CompareTypes(_In_ const void* a1, _In_ const void* a2)
Expand Down
Loading

0 comments on commit 8e99c91

Please sign in to comment.