Determine the handle to Parent window of the printer configuration property sheet
I need to obtain the handle to the parent window of the printer-configuration property sheet in Excel. I think I have to use FindWindow,
Code:
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
But I have no idea what the strings for the two parameters should be? Could someone tell me how to determine these parameters?
Thanks,
Tom
Re: Determine the handle to Parent window of the printer configuration property sheet
I found the solution via a program I found at MSDN (http://support.microsoft.com/kb/183009) that enumerates the Windows handles. Using this I determined the lpClassName was XLMAIN and the lpWindowName was "Excel." With this information I was able to obtain the Excel Window handle via:
Code:
ExcelWindowHandle = FindWindow("XLMAIN", "Excel")
Regards,
Tom