Page 1 of 1 1
Topic Options
#86236 - 2002-06-24 10:32 AM Hourglass Mouse Pointer
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
I am using KiXtart v4.10 RC2 and KiXGUI v1.1 Build 42 to write a small utility that queries a remote workstation’s registry to ascertain the version of McAfee VirusScan installed. If the domain administrator deems an update is necessary then an upgrade can be initiated on the remote workstation without the user’s knowledge (BTW this will only work for NT, 2K, XP).

Now comes the problem, I am using the native ‘net view’ command to enumerate the network which obviously can take some time with remote domains. Ideally I would like to change the mouse pointer to an houglass and ignore any further mouse clicks within the application until the enumeration is complete. To the best of my knowledge, this functionality is not available in either KiXGUI or Kixforms, although it may exist and is simply not documented. Therefore, is it possible to change the mouse pointer using pure COM scripting? or am I talking complete rubbish [Wink] ; or could either Alex or Shawn add that functionality in a future release of their excellent Dlls?

BTW I did try popping up another dialog box, on top of the main window, with a ‘Please Wait …’ message, however it doesn’t stop the administrator from changing focus back to the main window underneath [Frown]

Any help would be much appreciated.

Rod.

Top
#86237 - 2002-06-24 04:12 PM Re: Hourglass Mouse Pointer
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Just a couple questions:

1. How does someone clicking in the application affect you negatively?

2. Is this pure KiXtart or are you using other utilities along with KiXtart?

....

I have been poking around, looking for something to change the mouse cursor (using COM), however I have not been successful with it (although an IE window can be controlled in that way). It IS possible to block input using the freeware program/dll AutoIT.

Brian

Top
#86238 - 2002-06-24 04:32 PM Re: Hourglass Mouse Pointer
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
Hi Brian,

Thank you for the response, and to answer your questions:

1. The key reason to change the mouse pointer to an hourglass is to indicate to the user that some processing is going on and that the application hasn’t simply locked up. Remote domain enumeration can take many seconds (even minutes) to complete and without some visual cue, the user may end up confused and frustrated. [Frown]

2. The code is mostly KiXtart, however I do make use of ‘net view’ and two excellent little utilities called ‘alive.exe’ and ‘atonce.exe’ which are available from http://wettberg.home.texas.net/ [Cool]

Kind regards,

Rod.

Top
#86239 - 2002-06-24 04:44 PM Re: Hourglass Mouse Pointer
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Rod, forms doesn't allow one to change the mouse cursor, good idea though. KiXGUI doesn't either (to the best of my knowledge). Your best short-term bet would be to go with your original idea of popping-up a "Please wait ..." message. But the trick is to de-active (disable) the parent window from receiving mouse clicks. Forms does this automatically, when creating subsequent forms off the main form. I believe Alex added this feature to KiXGUI, later-on in the game. So might want to check your versions. I think he may have some notes about this on his website. I just called them child-forms, but Alex calls them owned-forms (if memory serves).

One thing you might try, with KiXGUI, is to "manually" disable the parent form while displaying the wait message form, ie:

$mainform.enabled = 0

then, re-enable when done. Not sure if this works with KiXGUI or not.

-Shawn

Top
#86240 - 2002-06-24 05:03 PM Re: Hourglass Mouse Pointer
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
In KiXGui it would be

$frm.visible=0 ; Hides form

$frm.visible=1 ; Shows form

Top
#86241 - 2002-06-24 05:05 PM Re: Hourglass Mouse Pointer
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
Hi Shawn,

Many thanks for your help, I will try this out asap and post a reply as to the outcome.

Many thanks, [Smile]

Rod.

Top
#86242 - 2002-06-24 05:40 PM Re: Hourglass Mouse Pointer
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
You can do it via the API. Here's how...

code:
$API=CreateObject("wshAPIToolkitObject.ucATO")

HourglassCursor()
sleep 5
HourglassCursor()
exit

function HourglassCursor()
$Cursor=$API.CALLAPI("USER32.DLL", "LoadCursorA", 0, 32514)
$HourglassCursor=$API.CALLAPI("USER32.DLL", "SetSystemCursor", $Cursor, 32512)
endfunction

Of course, you'll need the ActiveX component to do it. See this thread for more: ActiveX Component for API Calls

[ 24 June 2002, 17:42: Message edited by: Chris S. ]

Top
#86243 - 2002-06-24 08:09 PM Re: Hourglass Mouse Pointer
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
Hi Shawn,

Your tip works just fine with KiXGUI as follows:

$form.enable = "0" ; to disable the whole parent window
$form.enable = "1" ; to enable the whole parent window

BTW should you use quotes or not?

One very minor issue is that you then need to manually regain focus of the parent window using:

$form.setfocus

However, I now have one new problem in that I can only draw the 'Please Wait ...' message box once during each run time. The second time it is called the program bombs out. Obviously this has something to do with calling $desktop.createform twice with exactly the same parameters. How is it possible to release resources in KiXGUI (I tried using $plswait.closeall but that didn’t work), or should I create the message box only once at the start and just make it visible when required as per Chris’ post?

BTW what are the key differences between Kixforms and KiXGUI, or isn't that a simple question? [Wink]

Kind regards,

Rod.

Top
#86244 - 2002-06-24 08:14 PM Re: Hourglass Mouse Pointer
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
Hi Chris,

Many thanks for your suggestion. I would love to try it out however please can you humour this API newbie by detailing which file in the ZIP archive I have to register and how I go about registering it, plus are any of the remaining files in the ZIP file required or are they just examples which can be deleted. Please excuse my ignorance, but this is complex stuff just to get the mouse pointer to change shape [Big Grin]

Kind regards,

Rod.

Top
#86245 - 2002-06-24 08:42 PM Re: Hourglass Mouse Pointer
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Unzip the file. Copy the "wshAPIToolkitObject.ocx" file to your %windir% or %windir%\sys32 (wherever you prefer, probably the same place you registered KiXGUI). Then run "regsvr32 %path_to_ocx%\wshAPIToolkitObject.ocx"

BTW, its not that difficult. I couldn't even spell API until last week. If you can get a handle on KiXGUI then you should be able to handle this. [Wink]

[ 24 June 2002, 20:45: Message edited by: Chris S. ]

Top
#86246 - 2002-06-24 08:46 PM Re: Hourglass Mouse Pointer
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
Thanks Chris, I thought it may be that simple, but I didn't want to bend my OS out of shape if I was wrong.

Rod.

Top
#86247 - 2002-06-24 08:49 PM Re: Hourglass Mouse Pointer
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Rod, there are a ton of differences - and similiarities - between Kixforms and KiXGUI, too numerous to mention (in this thread) really. My suggestion would be to do like you said, create the form once, then show when needed, then hide and reshow as required.
Top
#86248 - 2002-06-24 08:51 PM Re: Hourglass Mouse Pointer
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
NP. Let me know how it works for you. [Smile]
Top
#86249 - 2002-06-24 10:35 PM Re: Hourglass Mouse Pointer
rclarke Offline
Starting to like KiXtart
*****

Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
Thanks for all your help guys. I will hopefully be able to post the finished program to this bulletin board, and even though portions of it are specific to our company, it may help others get to grips with these very powerful add-ons to KiXtart.

Kind regards,

Rod.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

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

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