Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got some probelms with Outlook Address Book
When I open a new one I develeped with C#, It open after the older one - Office Product is prividing Itself - appeared
The older one appear and close automatically
It is a little bit annoying me

so, I hope I open my one without the older one's appearing or with hiding it
Is there a way ?


WinApiProvider Class

public const uint WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;

[DllImport("user32", CharSet = CharSet.Auto)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);


/* SendMessage */
1. ((Outlook.InspectorEvents_10_Event)Inspector).Deactivate Event Function
IntPtr hBuiltInDialog = WinApiProvider.FindWindow("#32770", "");

WinApiProvider.SendMessage(hBuiltInDialog, WinApiProvider.WM_SYSCOMMAND, WinApiProvider.SC_CLOSE, 0);
_showOwnDialogOnActivate = true;

2. ((Outlook.InspectorEvents_10_Event)Inspector).Activate Event Function
if (_showOwnDialogOnActivate)
{
RecipientDialog customDialog = new RecipientDialog(Inspector.CurrentItem);
customDialog.ShowDialog();
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900