MainWindowHandle of an HTA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cainnech
    New Member
    • Nov 2007
    • 132

    MainWindowHandle of an HTA

    Hello,

    I'm currently working on a software where I need to get the windowhandle of an HTAwindow.

    Currently I'm Using this code
    Code:
    Process[] procs = Process.GetProcessesByName("MSHTA");
    IntPtr hWnd;
    
    debug.print(procs.count()) // returns 1
    
    hWnd = procs[0].MainWindowHandle;
    
    debug.print(hWnd.ToString()); // returns 0
    At all times, I'm getting 0 as my handle.
    But I don't understand why.

    I even tried using the FindWindow but I'm getting the same results.

    Anybody has an idea why?

    Cheers,
    Kenneth
  • Cainnech
    New Member
    • Nov 2007
    • 132

    #2
    Actually I just noticed that I made a typo in the FindWindow-code. I jut tried it again and it is working.

    However still not using the ProcessByName-function.

    But I can continue so that's ok.

    Comment

    Working...