Archive: nsDialogs with timer support


nsDialogs with timer support
Inspired by this thread:
http://forums.winamp.com/showthread....hreadid=296985

I created nsDialogs modification that adds timer support to nsDialogs. With it is possible to call NSIS functions without user interaction.

Mod adds two new functions to nsDialogs:

nsDialogs::CreateTimer time_in_milliseconds function_address
On sucess it will push timer id and on failure "error" to the the stack. Timer id will be also waiting on the stack when the callback function is called.

nsDialogs::DestroyTimer timer_id
Simply kills the timer specified by the timer id. Doesn't push anything on the stack.

ps. I build the plug-in with MinGW so it's linked to msvcrt.dll and the file size is slightly bigger.

PaR

Wow, I *LOVE* the idea!!!

I haven't looked at the code yet, but I am curious, when you get the first callback from the timer, can you reschedule a new timer to have to call back into your function again?
(ie, so we get kind of a "heartbeat" thing going?)

Thanks!
Scott


That's the default behavior the timer will continue "looping" until as you call nsDialogs::DestroyTimer or you leave the page. But you can call nsDialogs::DestroyTimer from the callback to make it run just once.

I don't recomend using nsDialogs::CreateTimer after the page shown even though it works.

PaR


that is freaking cool man thanks


But is extending nsDialogs the way to do this? Why not a stand alone plugin so you could use it on all pages? (I made a subclass plugin that could do this a while back, but never really completed and released it)


so for kicks im trying to compile nsdialogs i get several errors about missing stuff like
undefined reference to `SetTextColor@8'
(.text+0x6ef): undefined reference to `popint@0'
undefined reference to `pushstring@4'
undefined reference to `pushint@4'
undefined reference to `g_stringsize'
undefined reference to `g_stringsize'
anyone know what i need to do to fix this? using mingw also thanks


@ZmAn3
Looks like you are missing some source files. Download NSIS source code to get rest of the files needed to build nsDialogs.

PaR


well i have it all and i have the windows xp sdk installed
and i open a command prompt and and goto nsdialogs dir and type gcc nsdialogs.c and thats when i get those errors no biggie i guess i dont understand c anyway about once a year i decide i wanna play with it and i always get compile errors no matter what i use the only thing ive ever been able to compile is nsweb plugin with visual C++ and i had to remove the libtiny line in that code even thou i had the libtiny file