Q:

UFT not identifying a window in some playback

I am using descriptive programming in UFT. During playback, I want to check if the Windows print dialog does appear. Then I want to click the Cancel button in that dialog.
My problem: Sporadically QTP fails to identify the printing dialog, so clicking on the cancel button fails.
How can this possibly sometimes fail, sometimes succeed?
My code syntax given below:
Set Window_EnterMeter = browser_servicemanager.Window("regexpwndtitle:=Enter Meters.*") 
Set dialog_Print = Window_EnterMeter.Dialog("regexpwndtitle:=Print") 
Set winbtn_CalcelPrint = dialog_Print.WinButton("regexpwndtitle:=Cancel") 

fn chckprintpopupwndow() 
{ ''''''''Navigating to that page 
          call Absolutehighlight(Button_Action) 
          call Absolutehighlight(Meter_Entry) 
          call Absolutehighlight(PrintMeter_Opt2) 
          AbsoluteClick(PrintMeter_Opt2) 
          EnterMeters_Window.WebElement("html id:=ctl00_Save_BTN_C").Click 

'''''''By click on abve option window popup print option appears and UFT not identifying that window all times, so clicking on cancel button not doing so TC fails 
          dialog_Print.Activate 
          AbsoluteClick(winbtn_CalcelPrint) 
          EnterMeters_Window.WebElement("html id:=ctl00_Cancel_BTN_C").Click 
} 

A:

I found out the root cause of this problem, Actually am running the whole script in a Virtual Machine(VM). During some playback i minimize the VM and work on local system, so during minimizing UFT fails to detect the winobject and also there wont work the (send keys) any keypress events in minimized mode. We can solve the minimize issue by updating the registry edit. For more details go to:-
can we execute QTP script on remote machine by keeping session minimized

