Ok, after hours of checking MSDN and poking around System.Windows.Forms.Form using Telerik I finally have a working solution and here's what I got:
if (aaaRectClose.Contains(e.Location) && aaaParentForm != null)
{
if (aaaRectClose.Contains(e.Location) && this.Parent != null)
{
IntPtr frmHandle = (this.Parent is Form) ? this.Parent.Handle : IntPtr.Zero;
if (frmHandle != IntPtr.Zero)
{
SendMessage(frmHandle, 16, 0, 0);
}
}
}
Basically here is what I was trying to accomplish: A custom control could be included in any form in the project. This control contained several "Virtual" buttons which where part of an image. aaaRectClose was a Rectangle that contained the bounds for the "Close" button. When pressed it needed to close the form as if pressing the "X" in the upper right corner of standard Windows forms. The reason for including this close button is some of the forms may be borderless.
Anyways thank you to everyone who read my question and proposed a solution your efforts have been appreciated.
The above code does work for anyone who may eventually have the same silly requirements thrown in their lap with someone higher than yourself demanding things that make no since to you. Otherwise simply issue the "this.Parent.Close()" statement as its much simpler.
Whilst I couldn't find or there is no documentation on "SendMessage(IntPtr, 16, 0, 0)" nor does it coincide with what is on MSDN it does work.
-Phil