Page 1 of 1 1
Topic Options
#210014 - 2015-02-27 06:48 PM Windows 7 logon process Keeps kixform from refreshing window
tito Offline
Fresh Scripter

Registered: 2002-04-03
Posts: 11
Loc: seattle washington
It started with Windows 7. I use kixform w/ kix login script to present the user logging in with a popup window displaying the progress of their login. What appears to happen is when the kix script encounters an issue w/ connecting to a printer or share for example... is that the kixform window turns black, I assume because Windows 7 is not allowing kixform to refresh the window, until the connection issue has been resolved, time out most likely. Have you heard of this? and if so, any recommendations of what to try to avoid having the kixform window go black.

Kix version: 4.63
Kixform ver: 2.46.55.0

Top
#210015 - 2015-02-27 07:03 PM Re: Windows 7 logon process Keeps kixform from refreshing window [Re: tito]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
What version of kix and kixforms are you using? I just set up an example scenario, and as the form hangs while waiting for mapping (as expected), it does not turn black. Below is the code I used to demonstrate, using kixforms 2.47.5.0.

 Code:
$System = CreateObject("Kixtart.System")
$Form1 = $System.Form()

$TextBox = $Form1.Controls.Add("TextBox")
$TextBox.Width = $Form1.Width
$TextBox.Height = $Form1.Height
$TextBox.Center()
$TextBox.Text = "Attempting to map drive X"

$Form1.Show()

MapDrives()

While $Form1.Visible
   $Nul = Execute($System.DoEvents)
Loop

Exit 0

Function MapDrives()
   Use X: "\\server\share"
   If @Error
      $TextBox.Text = "Failed to map drive X"
   Else
      $TextBox.Text = "Successfully mapped drive X"
   Endif
EndFunction

Top
#210016 - 2015-02-27 09:21 PM Re: Windows 7 logon process Keeps kixform from refreshing window [Re: ShaneEP]
tito Offline
Fresh Scripter

Registered: 2002-04-03
Posts: 11
Loc: seattle washington

ShaneEP...

Kix version: 4.63
Kixform ver: 2.46.55.0

Are you saying that you had the same problem? I see that you are using kixforms 2.47x. and my version is 2.46.55.

I just checked my code and I see that I may have shot myself in the foot... While trying to force the kix form window to stay in the center and on top I commented out the code that refreshes the window... looking at the lines of code from script... Using the '.Running = 1' has been working for me to force the window centered and on top of other apps. Would you recommend just uncommenting $Form_DistLogin.Visible or do I need to include $ = Execute($Form_DistLogin.DoEvents())
-------------------
;$Form_DistLogin.Show

$Form_DistLogin.Visible
$Form_DistLogin.Show
$Form_DistLogin.Center
$Form_DistLogin.TopMost = "True"
While $Form_DistLogin.Running = 1
; $ = Execute($Form_DistLogin.DoEvents())
; $Form_DistLogin.Visible
; $Form_DistLogin.Show
$Form_DistLogin.Center
; $Form_DistLogin.TopMost = "True"
Loop
-------------------------
Thanks

Top
#210019 - 2015-02-28 04:59 PM Re: Windows 7 logon process Keeps kixform from refreshing window [Re: tito]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Someone correct me if I'm wrong, but I'm not sure there is any way to update the form while kix is in the middle of a command, for example trying map a drive. But I don't think the form should just go black either. In the example I posted, the text that is displayed before the drive mapping occurs stays visible until the mapping is complete.

Maybe consider just changing the form icon to an hourglass while running commands? As for the $Form_DistLogin.Visible line, I believe that is just a boolean that allows you to set the visibility, or get the current visibility. Just running that line shouldn't really do anything except display whatever it returns to the console. So I'm not sure why it would be needed.

The below is how I have always shown and run my forms, and it has worked for just about every scenario.

 Code:
$Form_DistLogin.Center
$Form_DistLogin.TopMost = "True"
$Form_DistLogin.Show

While $Form_DistLogin.Visible
   $ = Execute($Form_DistLogin.DoEvents)
Loop

Exit 0

Top
#210021 - 2015-03-01 04:44 AM Re: Windows 7 logon process Keeps kixform from refreshing window [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Kixtart is single thread and so is kixforms on top of it. The only way yo keep the form responsive is to have the kixtart commands possibly taking more than 20 ms in a separate kixtart process.
_________________________
!

download KiXnet

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
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.065 seconds in which 0.033 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