What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Timer in a plug-in

Pages: (3): « First [ 1 ] 2 3 » Last »
Timer in a plug-in
Author: Message:
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
32 / Male / –
Joined: Nov 2005
O.P. Timer in a plug-in
My plug-in needs to set some things every 30 seconds. Is there a good way to do it, or should I call an external program from my DLL?
12-21-2005 12:48 PM
Profile E-Mail PM Web Find Quote Report
(CyBeRDuDe)
Senior Member
****


Posts: 512
Reputation: 21
37 / Male / –
Joined: Jul 2003
RE: Timer in a plug-in
In VB I guess?
Add a form, and add a Timer.
In the initialize function call:

Load Form1

And you can then use whatever you want, Form1.Timer1.Enable, Form1.Timer1.Interval.. Etc...

This post was edited on 12-21-2005 at 01:23 PM by (CyBeRDuDe).
12-21-2005 01:22 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Timer in a plug-in
If you're working in C++, then let me know, and I'll knock up an example for that.
[Image: spartaafk.png]
12-21-2005 02:07 PM
Profile PM Web Find Quote Report
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
32 / Male / –
Joined: Nov 2005
O.P. RE: Timer in a plug-in
* Itsme-HcK lets raceprouk now.
If I can just keep the function running, just reply with that, I'll know what to do then. :)
12-21-2005 10:03 PM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Timer in a plug-in
To start the timer:
UINT timerID = SetTimer(NULL, 1, <delay in ms>, &TimerProc);

To kill the timer:
KillTimer(timerID);

To respond to timer events:
void CALLBACK TimerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    // Code to respond to timer
}

Timers on MSDN
;)

This post was edited on 12-22-2005 at 11:12 AM by RaceProUK.
[Image: spartaafk.png]
12-22-2005 11:11 AM
Profile PM Web Find Quote Report
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
32 / Male / –
Joined: Nov 2005
O.P. RE: Timer in a plug-in
That will make my plug-in run all the time, while it is only supposed to be called once in the <number> minutes...
12-22-2005 01:45 PM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Timer in a plug-in
void CALLBACK TimerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    // Code to respond to timer
    KillTimer(timerID);
}

:P
[Image: spartaafk.png]
12-22-2005 04:12 PM
Profile PM Web Find Quote Report
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
32 / Male / –
Joined: Nov 2005
O.P. RE: Timer in a plug-in
Err, read what I said again. ;)
I will have to parse the MSG's. (Which forces me to run the whole time.)
12-22-2005 07:50 PM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Timer in a plug-in
If you put KillTimer() in the TimerProc(), the TimerProc() will only be called once.
[Image: spartaafk.png]
12-22-2005 08:22 PM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Timer in a plug-in
I don't know what you're trying to say... Off course your plugin is running all the time...that's usual for plugins...

If you want to do something every x minutes you just use raceprouk's code, and you place the code you want to execute in it.... You can also make a seperate dll for the code if you want to...
12-23-2005 12:25 AM
Profile E-Mail PM Find Quote Report
Pages: (3): « First [ 1 ] 2 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On