!netreloadmodule scandir Thread last updated on 2003-10-10 11:26:17

Posted by member 7223 on 2003-10-09 06:08:25

Hi,

As you might know, scandir is a great, usefull module; but it doesn't allow you to change Path on the fly (via !bangs).
Then, you must have to do some scripting to !textreplace stuff and reload scandir like this:
*script bang !wallpaperscan
*script exec !textreplace @$configdir$themevars.rc@ @wallpaperpath @ @&%{args}
*script exec !reload
*script exec !netreloadmodule $scandirmodule$
*script exec !scandir wallpaper
*script ~bang

I use to call this script this way:
!comdlgfolder !wallpaperscan ^@dp^

But this doesn't work :(
In that example, "wallpaperpath" is replace as expected but scandir doesn't seem to be reloaded. I've tried to !netunloadmodule it before, make some pause (10000ms), !netreloadmodule it, etc...

But if I call the script twice, like this:
[!comdlgfolder !wallpaperscan ^@dp^][!pause 250][!comdlgexec !wallpaperscan ^@dp^]

It's works

Is scandir known to have problems to be reload, or what ?

Posted by member 7 on 2003-10-09 11:37:34 link

!reloadmodule and !unloadmodule don't work reliably in scripts using Beta 4. The !Net* equivalents use the same mechansisms internally afaik so they're affected as well. Should be fixed Soon(tm). If you can't wait and want to test the fix ask me in #litestep or #lsdev on irc.freenode.net. ;)

Posted by member 99 on 2003-10-09 12:54:33 link

Hm, I believe !netreloadmodule should block until the module is fully loaded. (otherwise I'd be able to load modules in parallel on startup, which it doesn't) !netunloadmodule otoh, does NOT block. (until !unloadmodule does)

However, I suspect there may be a problem with !reload. iirc omar had trouble with it in a script, and I couldn't get it to update $vars$ at all from lsxcommand. :/

Posted by member 7223 on 2003-10-10 01:00:49 link

I successfully !reload then !netreloadmodule traytasks, taskbar3, tasks in mzscript

Posted by member 7 on 2003-10-10 09:32:03 link

The !reload bug was related to the !re/unloadmodule issue iirc. Blocking won't help btw. Beta 4 automatically translates any string sent in via LM_RELOADMODULE to a HINSTANCE and posts the result to itself.

Posted by member 99 on 2003-10-10 11:26:17 link

Oh... I'm confused.

Obviously it can't do that when the module is first loaded, so I guess startup and !reload would be different cases. :P iow if the module is already loaded !netreloadmodule doesn't really block after all?

Well, since it's changing back I won't worry about it. :)