CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2008
    Posts
    114

    Exclamation Findwindow/FindwindowEX on VMWare program in VB6

    Hey all, i am trying to grab some text input from notepad thats within a VMWare virtual machine running Windows 7. I can get a handle of the VMWare form but nothing within it (the windows 7 OS running inside it).

    This is the code i am currently using:
    Code:
        Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
        Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    
        Private Sub Commandcc_Click()
        Dim FromHwnd As Long
        Dim hWin As Long
        Dim count As Integer
    
           FromHwnd = FindWindow("VMUIFrame", vbNullString)
           hWin = FindWindowEx(FromHwnd, 0&, "MKSEmbedded", "")
        End Sub
    I am getting a value for FromHwnd just fine, but once it goes into the EX, i get no value. The **MKSEmbedded** is the window inside the VMWare that Windows 7 is running in.

    Is there something i am missing or need to do in order to grab that window inside VMWare?

    Thanks!

    David

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Findwindow/FindwindowEX on VMWare program in VB6

    That isn't a standard error key. Check their support page
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Findwindow/FindwindowEX on VMWare program in VB6

    If I understand correctly what you are trying to do, there is little chance that you will get that to work. The host OS that both your app and VMWare run on doesn't know anything about what's going on inside the VM. Your best bet could be that VMWare would provide some API that allows to access VM internals, but I'm afraid something like that doesn't exist either or it wouldn't be able to do what you want.

    Sorry.
    Last edited by Eri523; October 23rd, 2010 at 08:54 PM.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured