WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Control Manager
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

cGetSBText and UAC

 Keywords: cGetSBText 229 Timeout Error IE UAC Protected Mode Windows 7 8 Medium Integrity

Question:

I am having the problem on Windows 7 with IE 10. No matter what I try I cannot get to the status bar I am looking for... I get the 229 Timeout error on the cGetSBtext line
 
AddExtender("wwctl44i.dll")
title = "Statusbar Text"
BoxOpen(title, "")
IntControl(54,title,1,0,0) 
 
While 1
   If IsKeyDown(@SHIFT) Then Break
   
   ; Find the IE status bar control
   ;window1=DllHwnd("~Internet Explorer")
   window1=cFindbyClass("IEFrame")
   ;window2=cWndBySeq(window1,6)
   window2=cWndByClass(window1,`Frame Tab`)
   window3=cWndByClass(window2,`TabWindowClass`)
   ;ControlHandle=cWndByID(window3,40961)
   ControlHandle=cWndByClass(window3,`msctls_statusbar32`) ; this may be more generic
   
   BoxTItle(window1:"|":window2:"|":window3:"|":ControlHandle)
   if window1 == 0 || window2 == 0 || window3 == 0 || ControlHandle == 0 then Continue
   ;ErrorMode(@off)
   sbtext=cGetSBText(ControlHandle) ;Reads statusbar text
   ;ErrorMode(@cancel)
   if sbtext == "" || sbtext == 0 then Continue
   BoxText(sbtext)
EndWhile
Exit

Answer:

With UAC on you need to get IE up to medium integrity level by tuning of protected mode and you need to move your script down to medium level by changing the extension to either .wbt_if or .wbt_it. With UAC off it just works.

Turning of protected mode doesn't always take for some reason. You need to kill IE, wait a few minutes, and then restart it. Some times you have to restart it a couple of times. This may be because IE starts up a surrogate process that may not shutdown right away or something. But who knows?

It is a little more problematic on Windows 8 because the integrity level part of UAC is always on.

After doing a little research I don't think there is much we can do about this with UAC and protected mode on.

The user can use the get text business to get the text of the first part of the status bar. you could try using cWndInfo(0) to get that text without having to resort to a dll call. It will have to do for those that can't dump protected mode and have to use UAC.


Article ID:   W17557
Filename:   cGetSBText and UAC.txt
File Created: 2013:08:09:09:39:30
Last Updated: 2013:08:09:09:39:30