From WikiChip
$dialog Identifier - mIRC
< mirc‎ | identifiers

The $dialog() identifier can be used in one of two ways:

  1. To create a modal dialog
  2. To be used as an identifier in order to get properties for a specific dialog window.


Modal vs Modeless[edit]

mIRC has the ability to create a special kind of dialog, known as a modal dialog. Modal dialogs can be called from within a script using the $dialog() identifier. These dialogs are special in that they stop a script from continuing until one of the following conditions are met:

  1. The dialog is closed
  2. The dialog returns a value

Modal dialogs are different from modeless dialogs for a variety of reasons, but the most important ones are:

  1. They don't allow users to do anything else in mIRC until their conditions are met.
  2. They return information via the $dialog() identifier inside the script.
  3. They are generally only used when immediate action is necessary.

Modal dialogs should never be used unless absolutely necessary; they are mainly for critical user input. While modeless dialogs can be executed and navigated away from, or even minimized, it should be noted that modal dialogs do not have these abilities.

Creating A Modal Dialog[edit]

We can take a quick look at how to create a modal dialog via the following piece of code:

%modalvar = $dialog(name,table[,parent])


Here we can break down what we are looking at:

  • Name - The name you will give to the dialog and use to refer to it later.
  • Table - The table name used to create the dialog
  • Parent - The parent window of the dialog, this can be a window name or one of the following:
-1 : Desktop window
-2 : Main mIRC window
-3 : Currently active window
-4 : Currently active dialog (Note: If there is no dialog open, this defaults to -3)

Note: This type of dialog cannot be called from a remote script event.

Use As An Identifier[edit]

$dialog(), in use as an identifier, can be used to get information regarding any dialog you specify, and its properties. To get the properties of a dialog you specify, you simply append a period after $dialog() and the property name, such as $dialog(mydialog).title to get the title of the dialog named mydialog. Don't worry, this is all explained further below.

Synopsis[edit]

$dialog(<name/N>)[.property]
Name - The name of the dialog you want to reference.
N - If you want to reference a dialog by it's ID number, you would specify the ID number here. If you specify 0, mIRC will return the number of currently open dialogs.
Property - Here is where you would specify the property that you want to retrieve about a specific dialog.

List of Properties[edit]

Property Example Description
x,y,w,h $dialog(mydialog).x Can be used to return the x/y-position of a dialog, or the width/height.
cw,ch $dialog(mydialog).cw Returns the width and height of the client area within the dialog.
title $dialog(mydialog).title Returns the title of the dialog that you reference.
modal $dialog(mydialog).modal If the dialog is a modal dialog, returns $true, otherwise returns $false.
table $dialog(mydialog).table Returns the dialog table that the dialog name you reference is using.
ok $dialog(mydialog).ok If you specify an 'OK' button, this will allow the identifier to specify the dialog ID number of that button.
cancel $dialog(mydialog).cancel Same as above, but specifies the cancel button ID.
result $dialog(mydialog).result Same as above, but specifies the result button ID.
focus $dialog(mydialog).focus Allows you to retrieve the ID of the object control, within the dialog, that currently has focus.
tab $dialog(mydialog).tab Returns the ID of the tab that is currently being displayed.
active $dialog(mydialog).active If the dialog is the active window, returns $true, otherwise returns $false.
hwnd $dialog(mydialog).hwnd Returns the window handle of the current dialog window.

See also[edit]

v · d · e mIRC identifier list

$ $$, $, $0, $1-, $!, $&, $*, $+, $++, $?

A $abook, $abs, $acos, $active, $activecid, $activewid, $adate, $address, $addtok, $addtokcs, $agent, $agentname, $agentstat, $agentver, $alias, $and, $anick, $ansi2mirc, $aop, $appactive, $appstate, $asc, $asctime, $asin, $atan, $atan2, $auto, $avoice, $away, $awaymsg, $awaytime

B $banlist, $banmask, $base, $beta, $bfind, $bindip, $bitoff, $biton, $bits, $bnick, $bvar, $bytes

C $calc, $caller, $cancel, $cb, $cd, $ceil, $chan, $chanmodes, $channel, $chantypes, $chat, $chr, $cid, $clevel, $click, $cmdbox, $cmdline, $cnick, $color, $colour, $com, $comcall, $comchan, $comchar, $comerr, $compact, $compress, $comval, $cos, $cosh, $count, $countcs, $cr, $crc, $creq, $crlf, $ctime, $ctimer, $ctrlenter

D $date, $day, $daylight, $dbuh, $dbuw, $dccignore, $dccport, $dde, $ddename, $debug, $decode, $decompress, $deltok, $devent, $dialog, $did, $didreg, $didtok, $didwm, $dir, $disk, $dlevel, $dll, $dllcall, $dname, $dns, $donotdisturb, $dqwindow, $duration

E $ebeeps, $editbox, $email, $emailaddr, $encode, $envvar, $error, $eval, $evalnext, $event, $eventid, $eventparms, $exists, $exiting

F $false, $feof, $ferr, $fgetc, $file, $filename, $filtered, $find, $finddir, $finddirn, $findfile, $findfilen, $findtok, $findtokcs, $fline, $flinen, $floor, $font, $fopen, $fread, $fromeditbox, $fserv, $fserve, $fulladdress, $fulldate, $fullname, $fullscreen

G $get, $getdir, $getdot, $gettok, $gmt, $group

H $halted, $hash, $height, $hfile, $hfind, $hget, $highlight, $hmac $hmatch, $hnick, $host, $hotline, $hotlinepos, $hotlink, $hotp, $hregex, $hypot

I $iaddress, $ial, $ialchan, $ibl, $idle, $iel, $ifmatch, $ifmatch2, $ignore, $iif, $iil, $inellipse, $ini, $initopic, $inmidi, $inmode, $inmp3, $inpaste, $inpoly, $input, $inrect, $inroundrect, $insong, $insongpause, $instok, $int, $intersect, $inwave, $inwho, $ip, $iptype, $iql, $isadmin, $isalias, $isbit, $isdde, $isdir, $isfile, $isid, $islower, $istok, $istokcs, $isupper, $isutf

K $keychar, $keyrpt, $keyval, $knick

L $lactive, $lactivecid, $lactivewid, $left, $leftwin, $leftwincid, $leftwinwid, $len, $level, $lf, $line, $lines, $link, $lock, $locked, $lof, $log, $log10, $logdir, $logstamp, $logstampfmt, $longfn, $longip, $lower, $ltimer

M $maddress, $mask, $matchkey, $matchtok, $matchtokcs, $maxlenl, $maxlenm, $maxlens, $md5, $me, $menu, $menubar, $menucontext, $menutype, $mid, $mididir, $mircdir, $mircexe, $mircini, $mkfn, $mklogfn, $mknickfn, $mnick, $mode, $modefirst, $modelast, $modespl, $mouse, $mousecx, $mousecy, $mousedx, $mousedy, $mousekey, $mouselb, $mousex, $mousey, $mousewin, $mp3, $mp3dir, $msfile, $msgstamp, $msgtags

N $N, $naddress, $network, $newnick, $nhnick, $nick, $nickmode, $no, $nofile, $nopath, $nopnick, $noqt, $not, $notags, $notify, $null, $numeric, $numtok, $nvnick

O $ok, $online, $onlineserver, $onlinetotal $onpoly, $opnick, $or, $ord, $os

P $parmN, $parms, $parseline, $parsetype, $parseutf, $passivedcc, $pi, $pic, $play, $pnick, $portable, $portfree, $pos, $poscs, $prefix, $prop, $protect, $puttok

Q $qt, $query

R $r, $raddress, $rand, $rands, $rawbytes, $rawmsg, $read, $readini, $readn, $regbr, $regerrstr, $regex, $regml, $regmlex, $regsub, $regsubex, $remote, $remove, $removecs, $remtok, $remtokcs, $replace, $replacecs, $replacex, $replacexcs, $reptok, $reptokcs, $result, $rgb, $right, $rnick, $round

S $samepath, $scid, $scon, $script, $scriptdir, $scriptline, $sdir, $send, $server, $serverip, $servertarget, $sfile, $sha1, $sha256, $sha384, $sha512, $shortfn, $show, $signal, $sin, $sinh, $site, $sline, $snick, $snicks, $snotify, $sock, $sockbr, $sockerr, $sockname, $sorttok, $sorttokcs, $sound, $speak, $sqrt, $sreq, $ssl, $sslcertsha1, $sslcertsha256, $sslcertvalid, $ssldll, $ssllibdll, $sslready, $sslversion, $starting, $status, $str, $strip, $stripped, $style, $submenu, $switchbar, $sysdir

T $tan, $tanh, $target, $tempfn, $ticks, $time, $timeout, $timer, $timestamp, $timestampfmt, $timezone, $tip, $tips, $titlebar, $token, $toolbar, $topic, $totp, $treebar, $true, $trust

U $ulevel, $ulist, $unsafe, $upper, $uptime, $url, $usermode, $utfdecode, $utfencode

V $v1, $v2, $var, $vc, $vcmd, $vcmdstat, $vcmdver, $version, $vnick, $vol

W $wavedir, $wid, $width, $wildsite, $wildtok, $wildtokcs, $window, $wrap

X $xor

Y $yes

Z $zip

= =$nick