I'm converting an Excel COM Addin that was written in VB6 to VB.NET 2008. I have a form that I would like to make TopMost but only to Excel. I also have Excel's Win32 Hwnd but I get it using late binding so I'm not sure if it's OK to store it as an integer.
Dim xlHwnd As Integer = oAddin.ExcelApp.Hwnd ' (I'm using Addin Express 2009)
Dim myForm = New frmOneOfMyWindowsForms
myForm.TopMost = True
myForm.Show(xlHwnd) ' ***
*** This won't compile because I'm not allowed to convert an Integer (xlHwnd) to an IWin32Window in the myForm.Show statement.
How do I convert an Hwnd to an IWin32Window?
I suspect I have to pass an object that implements IWin32Window to Form.Show() but I have been unable to find any examples in VB.NET.