How to Use WindowFX.dll
Written by [AFX]
Introduction
Hello, it is me [AFX] again and in my third tutorial, I will be talking about the DLL called WindowFX.dll. I heard some users do not know how to use the DLL because of the lack of detail in the help file that came with the DLL. Well, my purpose for this tutorial is to show the reader how to use this DLL and to show that it isn't as hard as some users say it is.
This tutorial assumes you have your mIRC in C:\mIRC and that WindowFX.dll is located in the same directory. For this example, we will make a channel bar, so when you join a channel, a small channel toolbar will appear at the top of the channel. This is quite easy and also requires DragonZaps' DLL, MDX (if you don't have any of these DLL's, go to the end of the tutorial to find out where to get them). Icons will also be a necessity, so for the tutorial, our icons directory will be in C:\mIRC\Icons directory. Now, onto the rest of the tutorial.
Step 1 - Aliases and Identifiers
For this tutorial, you will need certain aliases. These are as follows:
alias wfx.load { dialog -m winfx. $+ $chan $+ . $+ $cid winfx | .timer -m 1 5 scid $cid window -a $chan }
alias wfx { dll windowfx.dll $1- }
alias mdx { dll mdx.dll $1- }
alias bars { return bars.mdx }
Step 2 - Making the table
For our toolbar, we only need a listbox, so just make a small dialog with one of those.
dialog winfx {
title "wFX"
size 0 0 167 3
option dbu
list 1, 0 0 166 15, size
}
Step 3 - The INIT event
Next, we must compile the dialogs' INIT event, adding the necessary MDX commands and WindowFX information:
;we use a .* on the dialog name because we will be calling many of the same dialog tables, just assigning them different dialog names when we call them.
on *:dialog:winfx.*:init:0: {
var %s = $gettok($dname,-1,46)
var %l = - $+ $calc($len($gettok($dname,-1,46)) +1)
var %c = $left($right($dname,-6),%l)
;MDX INPUT
mdx MarkDialog $dname
;creating
toolbar here
mdx SetControlMDX $dname 1 toolbar flat nodivider wrap > $bars
;removing
border from listbox
mdx SetBorderStyle $dname 1
;make the
dialog titlebarless and frameless
mdx SetDialog $dname style
;adding images
did -i $dname 1 1 bmpsize 16 16
did -i $dname 1 1 setimage icon small Icons\AutoJoin.ico
did -i $dname 1 1 setimage icon small Icons\CTCP.ico
did -i $dname 1 1 setimage icon small Icons\MP3.ico
did -i $dname 1 1 setimage icon small Icons\Channel.ico
did -i $dname 1 1 setimage icon small Icons\Close.ico
;adding
information to the toolbar
did -a $dname 1 1 $chr(9) $+ Add to auto join
did -a $dname 1 2 $chr(9) $+ Send CTCP
did -a $dname 1 -
did -a $dname 1 3 $chr(9) $+ Advertise playing MP3
did -a $dname 1 4 $chr(9) $+ Channel information
did -a $dname 1 -
did -a $dname 1
5 $chr(9) $+ Leave channel
;WINDOWFX INPUT
;This is the main portion where you dock your dialog to any window.
;%s is the
connection ID, and %c is the child name
scid %s wfx SetPadding %c > 28 text
scid %s wfx SetChild %c > $dname
;28 is the height of the bars' padding (how big it will look in the channel
window)
;text means it
will be docked in the channel window. If we used list, it would dock over the
nicklist
}
Now, we are done the INIT event for all winfx.* dialogs. Using this DLL isn't as hard as you thought it was right? It just requires a bit of thinking and scripting skill.
Step 3 - Calling the dialog
Now, to call the dialog on an on JOIN event. This part will tie into why we used all of those variables in our INIT event to get the dialog name.
on *:join:*: {
if ($nick == $me) {
wfx.load
}
}
Now, if we look at the wfx.load alias, look at how it is calling the dialog:
dialog -m winfx. $+ $chan $+ . $+ $cid winfx
In other words, if I joined the channel #merkFX on connection 2, the dialog name would be winfx.#merkFX.2. Also, it is using the original winfx dialog table, so basically you can load the same dialog many times.
Conclusion
In conclusion, using WindowFX.dll isn't hard, mentioned earlier, it just requires thinking and scripting skill. Mainly, I use this DLL to create small channel-related functions in a toolbar to dock in the channel window, but you can customize it to do whatever you want. I hope this tutorial has given you a better understanding on how the DLL works and what to do with it. Thanks for reading my third tutorial, see you next time!
MDX.dll from DragonZap can be found at www.mIRCsource.com
WindowFX.dll Epsilon can be found at www.mIRCscripts.org