Jun 12th, 2014, 06:11 AM
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,
But I have no idea what the strings for the two parameters should be? Could someone tell me how to determine these parameters?
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Jun 15th, 2014, 08:03 AM
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:
ExcelWindowHandle = FindWindow("XLMAIN", "Excel")
Click Here to Expand Forum to Full Width
Survey posted by VBForums.