I have made a small plug-in that allows users to use BoxSearch from
Sokoban++ and Sokoban YASC. It currently is only a small stub program
that simply starts BoxSearch.exe, and automates the mouse clicking to
solve the level. I have put it on my website, so take a look if you
like:
http://www.joriswit.nl/sokoban/
In the case that you are interested in making a "real" plug-in (unlike
the stub program I made): The plug-in interface specification can also
be downloaded from my website: Of course I would really encourage it if
you would make such a plug-in.
http://www.joriswit.nl/sokoban/files/games/devkit.zip
Greetings,
Joris Wit, author of Sokoban++.
I tried the plug-in, but failed. I guess this is because the Chinese
version MFC dll installed on my system. Though I try forcing BoxSearch
to use English interface, But the title of the main window --
controlled by localized MFC -- go on displaying in Chinese. I think
this prevent your plug-in from finding the solver. Do you use
FindWindow() API? Maybe you can enumerate all the window and find the
one with "BoxSearch" as sub-string of the window title.
Thanks to Minglw, I have read your SolverSDK some weeks ago. I plan to
write a "real" plugin in the future, after my current work of
BoxSearch5. I prefer using stub dll, and at the solver side, add
command line support. How could the solver pass back the result? A text
file is a simple answer, but a in-memory method should be better. How
do you think about it?
The plug-in does use FindWindow(), so that does explain it not working
on the chinese version. I have changed it to use the EnumWindows, as
you suggested.
If you want to pass the solution back from a command-line version of
your solver you could "redirect" the standard output of the console
application, like I have done with the rbox solver plugin. This way the
plug-in "reads" the output of the console application. For the rbox
solver I use CreatePipe() to create the channel, and the handles that
CreatePipe returns can be passed to CreateProcess (startupinfo
structure). Then the rbox plugin reads from the pipe. For the rbox
plugin this seems to work ok, but I have to say that I don't think the
code for the rbox plugin is fool-proof.
Success!