mIRC Home    About    Download    Register    News    Help

Print Thread
#6312 13/01/03 02:30 AM
Joined: Jan 2003
Posts: 20
H
hatch Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Jan 2003
Posts: 20
Hello Board!

How can I manage to close an already opened $input dialog?

My goal is to ask the user if he wants to close an incative window. I can manage that, but it would be a nice feature, to stop bothering the user if the query returns to activity while the $input dialog is already open.

Thanks for your help!
--hatch


__________________
"Who cares. Out of sight, out of mind."
#6313 13/01/03 05:24 AM
Joined: Dec 2002
Posts: 144
D
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
I don't think that this is possible at this time.

What you *can* do is to not use the $input identifier and to make your own custom dialog window instead. You can close your own dialog windows with /dialog.

If you're unfamiliar with dialogs, you can read this tutorial on dialog design and this tutorial on the more general aspects of dialogs.


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
#6314 13/01/03 06:18 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
As you've been told, you can use a dialog for that. If you want to stick to $input though there is a -kinda dirty- way to do it: set a timer to close $input after N milliseconds. How to close $input? You can use mirc's COM support to call the Sendkeys method (in WshShell) and make it 'press' Alt+F4. Here's the $tinput alias
Code:
[color:green]; syntax: $tinput(<timeout>,<param1 of $input>,<param2 of $input>,....)
; <timeout> is milliseconds, eg 3000 for a 3-second timeout.
; Example: //echo -s $tinput(4000,This dialog will close in 4 seconds,o,This is the titlebar)[/color]
alias tinput {
  if $1 !isnum 1- { return }
  .timerInput -m 1 $1 if ($appactive) sendkeys % $!+ {F4}
  var %a = $input($2,$3,$4,$5,$6)
  .timerInput off
  return %a
}
alias sendkeys {
  var %a = sendkeys $+ $ticks 
  .comopen %a WScript.Shell
  if !$comerr { .comclose %a $com(%a,SendKeys,3,bstr,$1-) }
}

Last edited by qwerty; 13/01/03 06:22 AM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard