mIRC Home    About    Download    Register    News    Help

Print Thread
#103002 15/11/04 02:03 AM
Joined: Nov 2004
Posts: 2
D
djh Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
D
Joined: Nov 2004
Posts: 2
i downloaded and isntalled mIRC 6.16
is there a way to allow only one insstance to run at a time ?
also is there a way to change the icon mirc shows ? i mean when i press alt+tab it gets confusing ( i have multiple versions installed for testing and personal reasons) because i see lots of icons that look the same way.
for now that would be all smile
thanx

#103003 15/11/04 06:37 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Your question seems confusing, you have multiple mIRCs running (since alt+tab is confusing), you only want to be able to run one instance at a time?

Firstly, you can change the icon that displays in the tray (via, ALT + O - Display - Options - Tray, however you can't change the alt+tab icon.

Secondly, if you want only one instance of mIRC to run, you would need to add some sort of code to each mIRC you run, i.e.

On *:START:{
if ($isfile(C:\mIRCisrunning)) { exit }
else { write C:\mIRCisrunning loaded | set %thismirc 1 }
}

Which would check if a file exists on starting your mIRC and set a variable so each mIRC version can tell if it made the file.

On *:EXIT:{
if (%thismirc) { unset %thismirc | .remove c:\mircisrunning }
}

if its this mirc you only have open, unset var and remove file.

Eamonn.

#103004 15/11/04 08:13 AM
Joined: Nov 2004
Posts: 2
D
djh Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
D
Joined: Nov 2004
Posts: 2
i'm sorry if it sounds confusing
let me be more precise :
i have c:\mirc1 and c:\mirc2 each holding 2 different installations
so there are 2 exe's that run in the same time
i only want to be abe to run c:\mirc1\mirc.exe ONCE and not more, and same with c:\mirc2\mirc.exe. your script has been adapted to writing c:\mirc1 and mirc2 files respectively and it works just two times (i don't know why)
IE: if i open c:\mirc1\mirc.exe and then open c:\mirc1\mirc.exe again, the second time it won't load, BUT if i open it the third time, it loads.
hmm what could be done ?

Last edited by djh; 15/11/04 08:13 AM.
#103005 18/11/04 01:03 AM
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
Quote:


On *:START:{
if ($isfile($+(",$mircdir,mIRCisrunning")) { exit }
else { write $+(",$mircdir,mIRCisrunning") loaded | set %thismirc $window(-2).hwnd }
}



On *:EXIT:{
if (%thismirc == $window(-2).hwnd) { unset %thismirc | .remove $+(",$mircdir,mIRCisrunning") }
}



the %thismirc is set, saved so exists at the second run, thus triggering the exit event.

this way you check if you are the right mIRC instance

also the $mircdir makes it installtion dir dependend (so you can run mirc1\ and mirc2\ both at the same time, but not more then 1 instance)

(I hope :-P didn't test it ;-] )

only problem is if mIRC crashed and didn't remove the file you need to do it by hand... else it won't boot anymore


If it ain't broken, don't fix it!

Link Copied to Clipboard