#86236 - 2002-06-24 10:32 AM
Hourglass Mouse Pointer
|
rclarke
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 ; 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
Any help would be much appreciated.
Rod.
|
Top
|
|
|
|
#86237 - 2002-06-24 04:12 PM
Re: Hourglass Mouse Pointer
|
BrianTX
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
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.
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/
Kind regards,
Rod.
|
Top
|
|
|
|
#86241 - 2002-06-24 05:05 PM
Re: Hourglass Mouse Pointer
|
rclarke
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,
Rod.
|
Top
|
|
|
|
#86242 - 2002-06-24 05:40 PM
Re: Hourglass Mouse Pointer
|
Chris S.
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
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?
Kind regards,
Rod.
|
Top
|
|
|
|
#86244 - 2002-06-24 08:14 PM
Re: Hourglass Mouse Pointer
|
rclarke
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
Kind regards,
Rod.
|
Top
|
|
|
|
#86245 - 2002-06-24 08:42 PM
Re: Hourglass Mouse Pointer
|
Chris S.
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. [ 24 June 2002, 20:45: Message edited by: Chris S. ]
|
Top
|
|
|
|
#86248 - 2002-06-24 08:51 PM
Re: Hourglass Mouse Pointer
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
NP. Let me know how it works for you.
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 259 anonymous users online.
|
|
|