Page 1 of 1 1
Topic Options
#211246 - 2016-03-29 11:03 PM Inputbox is appearing minimized
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
I've got kixtart working to open an inputbox to request the user to enter some info. However, the inputbox is appearing minimized, right next to the minimized kixtart application window. Any idea why the inputbox is minimized and how I can have it not minimized by default.
Top
#211247 - 2016-03-30 01:07 AM Re: Inputbox is appearing minimized [Re: ardy8888]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
InputBox? Are you using Kixforms?

Post a bit of the code so we can help you figure it out!

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

Top
#211248 - 2016-03-30 02:19 PM Re: Inputbox is appearing minimized [Re: Glenn Barnas]
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
I honestly don't know if this is Kixforms. Here is the code I am running. Basically, checks for group membership. If the user is in the group, an inputbox is supposed to pop up asking for their email address and then the script sends an email to that address. Everything works except that the inputbox shows up minimized.
 Code:
 if ingroup ("adsstest")
	SHELL 'cscript //nologo \\domain.local\netlogon\ADSelfService_Enroll_Check.vbs'
	if @ERROR = 47
		$smtpto=inputbox("Enter your email address for more info on Enrollment.","Enrollment")
		MAILER($smtpto)
	endif
endif



Edited by Glenn Barnas (2016-03-30 03:29 PM)
Edit Reason: added code tags

Top
#211249 - 2016-03-30 03:21 PM Re: Inputbox is appearing minimized [Re: ardy8888]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Probably using this... http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=197076#Post197076
Top
#211250 - 2016-03-30 03:27 PM Re: Inputbox is appearing minimized [Re: Allen]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
I would suggest using the built-in messagebox function. Also, kixtart is quite good at figuring out group membership. If you tell us what is in ADSelfService_Enroll_Check.vbs someone here can probably tell you how to do that without visual basic.
Top
#211251 - 2016-03-30 03:51 PM Re: Inputbox is appearing minimized [Re: BradV]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Brad - MessageBox is output only (OK, mostly - it allows button-based input). This needs to prompt for manual input text - email address. Also - he is using Kix for membership identification (If InGroup). \:\) I do agree that we can probably replace the VBS, but suspect its a 3rd party component of the AD Self Service app.

I looked at that function and don't see any controls for presence (minimize, show/hide, etc.) I did a quick look at this but could not find any more information about control options. I'd suggest not minimizing the Kix script and see if that helps.

KixForms would certainly help here, but that would require deploying/registering the DLL. Not as big an issue as you might suspect. I've used a BAT file to copy Kixforms.dll to C:\TEMP, register it with RegSvr32, then invoked the Kix/KF app, and then unregistered/delete the DLL. Hardly took any time at all. User permissions could be an issue with this, however, as users rarely have the needed rights nowadays.

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

Top
#211252 - 2016-03-30 04:03 PM Re: Inputbox is appearing minimized [Re: BradV]
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
Hey Brad, thanks for the response here!

Can the messagebox function take input?? I assumed it was just to post a message which is why I went with inputbox. The vbs script makes an http post to query if someone has enrolled into a selfservice portal (ManageEngine's ADSelfServicePlus). The post is made to the selfservice application directly and it returns true or false. Below is the vbs code. I've copied this section from a script provided by ManageEngine as their script did some other tasks I didn't need. I could probably simplify the script a bit as it is querying for the domain name but that is the same for everyone so I could specifically state that in the http post

 Code:
On Error Resume Next
	Set objNetwork = CreateObject("WScript.Network")
	
	url = "https://localhost:443" + "/CheckEnrollment.cc"
	postData = "user=" + objNetwork.UserName + "&domainFlatName=domain" + "&domainDNSName=domain.local" + "&manualScript=true"
	
	Set oHTTP = CreateObject("MSXML2.ServerXMLHTTP")	
       	oHTTP.open "POST", url,false 
      	oHTTP.setOption 2, 13056
        oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
        oHTTP.setRequestHeader "Content-Length", Len(postData)
        oHTTP.send postData  
	response = oHTTP.responseText
	result = 0
	   	If InStr(response, "Non-Enrolled User") Then
			result = 12
			ElseIf InStr(response, "Enrolled User") Then	
			result = 47
		End If
	wscript.quit result
	


Edited by Mart (2016-03-30 04:48 PM)
Edit Reason: Added code tags.

Top
#211253 - 2016-03-30 04:12 PM Re: Inputbox is appearing minimized [Re: ardy8888]
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
Thanks for the all the responses here. When I run kix32 manually which doesn't minimize, the inputbox is not minimized. It only seems to be minimized at logon, when kixtart is minimized.
Top
#211254 - 2016-03-30 04:30 PM Re: Inputbox is appearing minimized [Re: ardy8888]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
You can control Kix being visible with the SetConsole() function - try the Show, AlwaysOn Top, Foreground, and Maximize parameters to see which one works best for your situation.

I kind of figured that the InputBox state would follow the Kix script state.

Glenn

PS - use CODE tags around your code - click Edit on one of your prior posts to see exactly how.. \:\) Makes it easier to see the indents and logic flow.
_________________________
Actually I am a Rocket Scientist! \:D

Top
#211255 - 2016-03-30 05:03 PM Re: Inputbox is appearing minimized [Re: Glenn Barnas]
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
Thanks Glenn, will this SetConsole() function make the entire kixtart script visible or can I set this just for the inputbox? Just trying to understand where SetConsole() should be in the file.
Top
#211256 - 2016-03-30 05:55 PM Re: Inputbox is appearing minimized [Re: ardy8888]
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
Awesome! I just played with SetConsole and if I select HIDE, the kix32 script window is hidden but the inputbox does appear, not minimized or hidden!!

Thanks for everyone's input here!

Top
#211257 - 2016-03-30 07:50 PM Re: Inputbox is appearing minimized [Re: ardy8888]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Playing is good!

The SetConsole applies to the Kix script, but likely has side effects on the VBS code that produce the desired results.

Glad it worked out.

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

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 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.064 seconds in which 0.023 seconds were spent on a total of 14 queries. Zlib compression enabled.

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