mIRC Homepage
Posted By: Mashu Attn: C gurus - 02/05/03 05:49 PM
I was just wondering if any of you would know how I can use my dll to tell mIRC to use 1ms timers like it did in the previous version (but was mysteriously taken back out due to problems) by using 'a', or a combination of winapi commands.

Thanks
Posted By: codemastr Re: Attn: C gurus - 02/05/03 07:46 PM
If you specify the -m or -h switch, this indicates that the interval delay is in milliseconds.

Why do you need a dll to do what /timer can already do?
Posted By: Mashu Re: Attn: C gurus - 02/05/03 10:45 PM
You got it all wrong. I wan't to change the Kernel timing for mIRC, not create a timer.
Posted By: codemastr Re: Attn: C gurus - 03/05/03 05:36 PM
I'm not really sure what you mean by changing the kernel timing, can you be more specific?
Posted By: Mashu Re: Attn: C gurus - 04/05/03 10:43 AM
timeBeginPeriod(1); // request 1ms accuracy
int now = timeGetTime();
timeEndPeriod(1);

Ring a bell yet?
Posted By: codemastr Re: Attn: C gurus - 04/05/03 04:59 PM
I know what that is, but it still doesn't tell me what you want to do. You want to get the systemtime that is accurate to milliseconds rather than seconds? If so, why are you asking us how to do it? The code you included does exactly what you want.
Posted By: Mashu Ok i've done that heres another question - 06/05/03 10:05 AM
Ok, i've managed to do what I was on about, heres a completely differant question.

I have an updater for my script I have programmed (which of course works perfectly). But I need to quit mirc without it bring up a confirmation dialog. on ^*:EXIT....haldefhalt/halt didn't work so I was thinking that I could use 'OpenProcess' on mirc's process and issue a 'TerminateProcess', but I would need to forcefully terminate it (like when you click "end process" in the task manager). Do you have any idea how I can do this?

Ta
Open mIRC options: IRC -> Options. Uncheck all the things under "Confirm exit if:"
Well I would think (not sure if this will actually work) using SendMessage sending it a WM_DESTROY would be a more... graceful(?) way of doing it. I'm not sure if mIRC displays the stuff after receiving WM_CLOSE/WM_QUIT or if it does it in WM_DESTROY. I would think the former simply because I don't think you can "cancel" a WM_DESTROY. Meaning once that message is received, I'm pretty sure the window MUST die. And most likely, if you send a WM_DESTROY to the main mIRC window, that will end the program.

May not work, but if it does, it would be cleaner than using TerminateProcess. Especially since MS specifically says only use TerminateProcess in "extreme circumstances" :P
Posted By: Mashu Re: Ok i've done that heres another question - 07/05/03 11:02 AM
OK. I've used
Code:
SendMessage(mWnd,WM_DESTROY,0,0);
and it works perfectly with confirmations set to 'always' in mirc options. Thanks alot
© mIRC Discussion Forums