Micro Focus QTP (UFT) Forums
hWnd is not visible - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: hWnd is not visible (/Thread-hWnd-is-not-visible)



hWnd is not visible - sushil_gupta - 09-29-2011

I want to maximize explorer. When I am writing below code
Code:
hWnd = Browser("name:=.*PRS.*").GetROProperty("HWND")
Window("hwnd:=" & hWnd).Activate
window("hWnd:=" & hWnd).Maximize
I am getting error.
Object not visible Line (14):
Code:
"Window("hwnd:=" & hWnd).Activate".
in the second line
If I delete that line then error will come
The operation cannot be performed Line (14):
Code:
"Window("hWnd:=" & hWnd).Maximize".

I tried even the code below
Code:
hWnd = Browser("name:=.*PRS.*").Object.HWND
Window("hWnd:=" & hWnd).Maximize
But same error
Same code is working on other machine. Do I need to change some setting of my QTP? OR is it related to IE setting?


RE: hWnd is not visible - rajpes - 09-29-2011

Code:
'small letters
GetROProperty("hwnd")



RE: hWnd is not visible - Acharya_silu@yahoo.com - 09-29-2011

Ans:

Hi,

In my machine it is also showing error.but there is another way to maximize the browser which i tried and it works fine in my machine.You can Try this code below:

SystemUtil.Run "iexplore.exe", "name of your Url", , , 3
Here 3 is the mode for maximizing the browser..

Thanks


RE: hWnd is not visible - TesterJan - 04-23-2013

Try This!!
It worked for me

Code:
hWnd = Browser(BrowserName).GetROProperty("hwnd")      
hWnd = Browser("hwnd:=" &hWnd).Object.hWnd                                  
Window("hwnd:=" & hWnd).Activate    
Window("hwnd:=" & hWnd).Maximize