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

Hiding-Disabling Apps to Prevent User Intervention

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

How to Cover the Screen to Keep Users Out

Keywords:    keep a window on top


The example uses IntControl 54 to keep the window on top...

;Force WinBatch boxes to stay on top....
OurWnd=WinName()
;IntControl(54, OurWnd, 1, 0, 0)
WindowOnTop( OurWnd, 1 )

;Move Mouse off the screen
MouseMove(-1, -1, "", "")
;Disable keyboard and mouse
IgnoreInput(@true)

; initialize text color strings that we use for messages
t1="0,255,0" ;green text-for general messages
t2="255,0,0" ;red text-for error messages
t3="255,255,0" ;yellow text-for warning messages

BoxesUp("0,0,1000,1000", @zoomed)

BoxCaption(1, "Installation - Go for a coffee!")

; set color to green and msg and call subroutine
c=1

; may have to "play around" with font settings and sizes depending on 
gosub showbox
;;;;;YOUR CODE GOES HERE;;;;;;;;;;;;
      ;Example:
		run("notepad.exe","");runs notepad
		timedelay(2);waits two seconds
		Sendkeysto("~Notepad","!fx");closes notepad
		timedelay(2);waits two seconds
exit

:showbox
BoxColor(1,"255,0,0",6) ;sets the background color
BoxDrawRect(1,"0,0,1000,1000",2) ;object which will use the color
BoxTextColor(1,"0,255,0")
BoxTextFont(1,"Times Roman", 75, 70, 18)
BoxDrawText(1, "150,150,850,300", "Script processing....", @False, 1)
BoxTextColor(1,t%c%)
BoxTextFont(1,"Helvetica", 65, 80, 34)
BoxDrawText(1, "150,600,850,600", "%msg%", @TRUE, 1)
return

Try this routine which I insert into ALL my Winbatch scripts to keep the users from seeing/disturbing what's happening behind the scenes.

; This code should keep the following Window "on top" of the screen
; The idea will be to maximize this window (or make very large) so that
; you will display a status message and the user can't see what's going
; on behind the scenes. Mike
; Set our windows to be on top

; create "flag file" called c:\testie, if this file exists, do NOT blank screen
; this will allow testing without having to recompile

If FileExist("c:\testie")==@TRUE then goto testietest

OurWnd=DllhWnd("")
xx=-1
DaDll=strcat(DirWindows(1),"USER32.DLL")
DllCall(DaDll,long:"SetWindowPos",long:OurWnd,long:xx,long:0,long:0, 
long:0, long:0,long:3)

; initialize text color strings that we use for messages
t1="0,255,0" ;green text-for general messages
t2="255,0,0" ;red text-for error messages
t3="255,255,0" ;yellow text-for warning messages

BoxesUp("0,0,1000,1000", @zoomed)
;BoxesUp("50,50,950,950", @normal)
;BoxesUp("50,50,950,750", @normal)
BoxCaption(1, "IE 4.0 Installation - Go for a coffee!")

; set color to green and msg and call subroutine
c=1
msg="Your message here"
; may have to "play around" with font settings and sizes depending on 
message

gosub showbox


:testietest
;YOUR CODE GOES HERE!!!!!!!!!!!!
exit


:showbox
BoxColor(1,"255,0,0",6) ;sets the background color
BoxDrawRect(1,"0,0,1000,1000",2) ;object which will use the color
BoxTextColor(1,"0,255,0")
BoxTextFont(1,"Times Roman", 75, 70, 18)
BoxDrawText(1, "150,150,850,300", "Please do NOT touch keyboard or mouse", 
@False, 1)
BoxTextColor(1,t%c%)
BoxTextFont(1,"Helvetica", 65, 80, 34)
BoxDrawText(1, "150,600,850,600", "%msg%", @TRUE, 1)
return


Article ID:   W13250
Filename:   Cover the Screen to Keep Users Out.txt
File Created: 2008:10:02:09:32:04
Last Updated: 2008:10:02:09:32:04