Maybe I am just missing some silly link on the MSDN, but I cannot seem to find the list of possible values RegisterWindowMessage() can take
The only one I can find is "WM_HTML_GETOBJECT". I found this on pinvoke.net. This however, I believe this crashes my application because what I am trying to get is an IHTMLDialog and not a IHTMLDocument
I have looked at
A google search for RegisterWIndowMessage list of possible values
Another google search for send message types
Maybe I am searching for the wrong things, but I sure can't find it.
My application fails here:
Dialog = (IHTMLDialog)ObjectFromLresult(lRes, typeof(IHTMLDialog).GUID, IntPtr.Zero);
However I believe the issue happened further up the pipeline up here :
uint iMsg = RegisterWindowMessage("WM_HTML_GETOBJECT");
Because this is not an HTML document, but actually a dialog.
If it helps I am getting the hwnd to the dialog this way :
IntPtr hwnd = FindWindow("Internet Explorer_TridentDlgFrame", "Google -- Webpage Dialog");
Here is the full snippet of what I am trying to do if it helps :
UIntPtr lRes;
IHTMLDialog Dialog;
IntPtr hwnd = FindWindow("Internet Explorer_TridentDlgFrame", "Google -- Webpage Dialog");
uint iMsg = RegisterWindowMessage("WM_HTML_GETOBJECT");
if (SendMessageTimeout(hwnd, iMsg, IntPtr.Zero, IntPtr.Zero, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out lRes) == IntPtr.Zero)
{
MessageBox.Show("operation failed");
}
else
{
Dialog = (IHTMLDialog)ObjectFromLresult(lRes, typeof(IHTMLDialog).GUID, IntPtr.Zero);
}