Determine the handle to Parent window of the printer configuration property sheet-VBForums
Results 1 to 2 of 2

Thread: Determine the handle to Parent window of the printer configuration property sheet

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    6

    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

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    6

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.