Page 1 of 1 1
Topic Options
#212094 - 2016-11-13 04:05 AM Messagebox and lost focus
_Daniel Offline
Just in Town

Registered: 2016-11-08
Posts: 2
Loc: TN
Hi All.
I need a recommendation on how to keep focus during a SHELL and MessageBox routine.
I've got a cmd window with a messagebox popup timed for 6secs and IF the user does a mouse click anywhere off the message box during those 6secs the script just idles and doesn't proceed. (And on first test run it happened...)
I tried 'SetFocus' and that didn't work. Also tried to use the minimizeall UDF and wasn't able to get that to work.

Thanks, _Dan

 Code:

(CODE Snippet)
; >>> Messagebox to keep the user informed...
$Holding =  MessageBox("Please wait, 
Need to check for Workstations still running Silly Old Access97 Program
before continuing with BackUps...
-=-=-=-=-=-=-=-=-=-=-=-=-=-",+"Checking Workstations ---", 64, 6)
tried SetFocus ("wkix32.exe") here...
; ======================================================================================
<clipped......>
$Not_Running = 0	
$List_Em = ""
   SHELL "PSList.exe \\workstation01 sillyoldprogram.exe  -nobanner"	; >>> ws One
	IF @ERROR = 0 $Dash_00 = "Yes" else $Dash_00 = "Nada"
    endif


Top
#212101 - 2016-11-13 02:22 PM Re: Messagebox and lost focus [Re: _Daniel]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Hey Dan - Welcome to KORG!

Your style value (third parameter) is 64, which is:
  • "OK" button
  • "Information" symbol
  • First button is default
  • Application Modal

Try adding 4096 to the style value to change to System Modal. The values are cumulative, and if you only define one, the defaults are set for all others. App modal allows other apps to run, System Modal forces the Kix script to stay in focus.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#212115 - 2016-11-15 04:20 PM Re: Messagebox and lost focus [Re: Glenn Barnas]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
mumble .. there was a nice list by Shawn of all those modal values, even the undocumented ones .. Wonder if they are still valid.

Lemme search for that one -.-
_________________________



Top
#212116 - 2016-11-15 04:24 PM Re: Messagebox and lost focus [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
there you go : http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=82022#Post82022
_________________________



Top
#212121 - 2016-11-16 07:24 PM Re: Messagebox and lost focus [Re: Jochen]
_Daniel Offline
Just in Town

Registered: 2016-11-08
Posts: 2
Loc: TN
Thanks Gang! That made it better. The messagebox window doesn't disappear.
It does stay on top.
Still though if the user clicks off somewhere else the messagebox loses focus but does
stay on top.
The (6) second timer becomes inactive, so the user _has_ to select the 'OK' button.
After (6) seconds the focus seems to switch to the CMD window...

I didn't mentioned it above but I'm launching the script with wkix32.exe.

_Dan

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 793 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.059 seconds in which 0.029 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org