VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
3 Replies Last post: Nov 19, 2009 6:30 AM by fixitchris  

Any API to control VMware WorkStation? posted: Oct 29, 2009 5:24 AM

Click to view Nasu's profile Novice 20 posts since
Jan 23, 2008

I am currently using VIX API to open a VM and run our testing tool on the VM but is there any way to control VMware Workstation? I am thinking of things like maximizing it (which I have tried via VBScript without success), showing it in full screen mode etc.

Re: Any API to control VMware WorkStation?

1. Oct 29, 2009 6:34 AM in response to: Nasu
Click to view fixitchris's profile Expert 547 posts since
Dec 8, 2006
Controlling the window could be done through the Windows API. What are the exact requirements?

Re: Any API to control VMware WorkStation?

3. Nov 19, 2009 6:30 AM in response to: Nasu
Click to view fixitchris's profile Expert 547 posts since
Dec 8, 2006
Here is some vb code:

API Declarations
Private Declare Function FindWindow Lib "user32" Alias _
   "FindWindowA" (ByVal lpClassName As String, ByVal _
   lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal _
   hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_MAXIMIZE = 3

'the code to find and maximize a notepad window
Dim WinHandle As Long
WinHandle = FindWindow("Notepad", vbNullString)
ShowWindow WinHandle, SW_MAXIMIZE

Developer Social Media

Communities