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:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Timer in a plug-in
quote:
Originally posted by Itsme-HcK
That will make my plug-in run all the time, while it is only supposed to be called once in the <number> minutes...

Your plugin (or at least a process of your plugin) will indeed always run. There is no way around in (in whatever language) as that is exactly what a timer does; it constantly needs a process to run, the process of the timer (what the timer process calls when it fires is another matter, that process doesn't need to be run all the time)...

Calling an external DLL for this is not better. True, you could do that, but even then a process needs to be running all the time. So why call an external process (with all the disadvantgaes of syncronization, or detecting when it needs to end, or whatever) while you can do this from your plugin itself (with the advantage that you have far less troubles, if not none, with syncronizations, etc), and above all, it already runs all time anyways...

quote:
Originally posted by Itsme-HcK
Err, read what I said again. ;)
I will have to parse the MSG's. (Which forces me to run the whole time.)
you parse messages (or whatever you want) in the TimerProc. TimerProc is only fired/called when a timeout occurs.



EDIT: damn, J-Thread was first :p (I always say refresh a thread before replying, but I often forget to do that also)

This post was edited on 12-23-2005 at 12:47 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-23-2005 12:44 AM
Profile PM Find Quote Report
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
33 / Male / –
Joined: Nov 2005
O.P. RE: Timer in a plug-in
Oh my.
You guys should READ. :|
What I'm saying is that, when I use the timer, I have to run the DLL ALL the time. So, when it's called, it will not execute that function, for it's still running the first function.
12-23-2005 01:45 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Timer in a plug-in
quote:
Originally posted by Itsme-HcK
Oh my.
You guys should READ. :|
we do... and your question has been answered several times though.

quote:
Originally posted by Itsme-HcK
What I'm saying is that, when I use the timer, I have to run the DLL ALL the time. So, when it's called, it will not execute that function, for it's still running the first function.
The TimerProc is a callback-function, an assyncronical function, just as events are, it is executed when a timeout occurs.

If you have programmed something which takes all the idle time (aka processing power) of the CPU so events, callbacks, etc can't be executed, you actually entirly lock out (hang) the program which calls you DLL and maybe even Windows itself and nothing will run anymore, meaning your code is bad to start with.

Did you read and fully understand the link raceprouk has given?
Timers on MSDN
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-23-2005 03:00 PM
Profile PM Find Quote Report
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
33 / Male / –
Joined: Nov 2005
O.P. RE: Timer in a plug-in
Does MsgPlus parse my msg's too, then?
12-23-2005 03:26 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Timer in a plug-in
depends on what you actually want and what you mean by "messages".

Plus! doesn't "parse" messages from your plugin. It is the other way around, it send messages to your plugin so your plugin can parse them and return back a result.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-23-2005 04:16 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Timer in a plug-in
quote:
Originally posted by Itsme-HcK
Oh my.
You guys should READ. :|
What I'm saying is that, when I use the timer, I have to run the DLL ALL the time. So, when it's called, it will not execute that function, for it's still running the first function.
We do read, as Cookie said, and until now you hadn't explained what you were talking about.
In fact, yous till haven't explained everything fully: what's this 'first function'?
[Image: spartaafk.png]
12-23-2005 06:01 PM
Profile PM Web Find Quote Report
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
33 / Male / –
Joined: Nov 2005
O.P. RE: Timer in a plug-in
Gah, ok.
When making a timer with the .net functions (the one you gave teh me), these are added to the message queue (read MSDN if you don't know them, it's the basic of almost every Windows program).
Added to this queue are also clicks with the mouse, actions, menu's, the whole crap. You have to parse those messages, so you can handle them. So, when you do that, the timer function will be called, resulting in a call to my function.
But, if the user doesn't send messages to buddies for say, 15 minutes, my plug-in isn't called the whole time. So isn't my function.
But, if MsgPlus! parses my messages too, that wouldn't be a problem, for MsgPlus! will then have it called. So, does it?
If it's not, I have to make an unending loop to get the results I want, which will probably crash MSN Messenger.
12-23-2005 06:45 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Timer in a plug-in
quote:
Originally posted by Itsme-HcK
Gah, ok.
When making a timer with the .net functions (the one you gave teh me), these are added to the message queue (read MSDN if you don't know them, it's the basic of almost every Windows program).
Added to this queue are also clicks with the mouse, actions, menu's, the whole crap. You have to parse those messages, so you can handle them. So, when you do that, the timer function will be called, resulting in a call to my function.
But, if the user doesn't send messages to buddies for say, 15 minutes, my plug-in isn't called the whole time. So isn't my function.
But, if MsgPlus! parses my messages too, that wouldn't be a problem, for MsgPlus! will then have it called. So, does it?
If it's not, I have to make an unending loop to get the results I want, which will probably crash MSN Messenger.
I don't know about the rest of you but that makes absolutley no sense to me.

Are you trying to say you want a timer on your form to run so that your function is constantly called?

This post was edited on 12-23-2005 at 06:49 PM by matty.
12-23-2005 06:48 PM
Profile E-Mail PM Find Quote Report
(CyBeRDuDe)
Senior Member
****


Posts: 512
Reputation: 21
38 / Male / –
Joined: Jul 2003
RE: Timer in a plug-in
What I can understand from the last post of Itsme-Hck:
If add a plugin to MsgPlus!, it will run ALL the time, until Messenger is closed... If a user does not write to you in 15 minutes, your plugin is still "activated"/running...
This is of course logically to everyone.. Plugins don't just stop running because a person is not using Messenger..
If this is not what you are talking, I also have some sence that you are talking about Hooking or subclassing messages, recieved and sent by Messenger?...
2 Suggestions...
1: Try it out.. Your question seems very easy, though we are not sure we understand what you mean, but you seem to be confident in what's going on...
2: Write a better explantion, maybe come with some examples on what you are trying to achieve...

From what I could understand from the first post, you just want a timer that runs every 30 seconds, no matter what happens?... If so, just set the time in ms to 30000, and use raceprouk's code?...
If this is not what you want, you really need to explain better.. Because people seriously don't understand your post, and what you want to do...
12-23-2005 08:09 PM
Profile E-Mail PM Find Quote Report
Itsme-HcK
Junior Member
**

Avatar
Geek

Posts: 45
33 / Male / –
Joined: Nov 2005
O.P. RE: Timer in a plug-in
Maybe I should try #winprog. :P
Of course, the plug-in runs the whole time, but it is not active.
There is no main function or such, it is only activated when MsgPlus calls a function.
To use Windows timers, you need to be active all the time, and it's not.
So, only if MsgPlus! parses the messages from the DLL, it can be used.
My simple question: Does it?
12-23-2005 08:23 PM
Profile E-Mail PM Web 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