highlighter.js
Added detection of files masks from *.coder files in new format.
Posted: Fri Apr 06, 2012 8:57 pm
by KDJ
FeyFre wrote:Попробовал немного поиграться с DialogBoxIndirectParam, но к сожалению ничего не получается(хорошо что хоть не падает) Без доработки со стороны плага не получится этот вызов не заработает(как и другие вызова которые требуют CALLBACK функции)
Can I use DialogBoxIndirect function in the script?
Posted: Sat Apr 07, 2012 8:43 am
by FeyFre
KDJ, with some limitations you can.
First of all, callback function (DLGPROC) should be global function(i.e. defined somewhere globally in script in form "function name(hwnd,msg,wparam,lparam)" ) not dynamic.
The it must be registered with RegisterCallback. Since RegisterCallback has limitation of 4 simultaneously registered functions, a number of different dialogs will be limited too.
As for me, I'm not happy with this limitation. In most cases I shall use dynamic functions and/or closures and/or Function variables but for now I cannot.
You can try yourself. But this is not main concern. Main concern is routine to format DLGTEMPLATE structure in memory which is required as parameter of *Indirect API calls.
Real functions are DialogBoxIndirectParamA/W with 4 arguments. The last argument is user-defined value of type LPARAM which will be passed to into DIALOGPROC with WM_INITDIALOG message. So DialogBoxIndirectA/W just set this argument to zero.
So in your case there is wasn't any call because Scritps plugin did not found any DialogBoxIndirectA/W function in user32.dll and just returned zero.
(DialogBoxA/W is also macro for DialogBoxParamA/W).
2. About DLGTEMPLATE structure - here. And I shall advice you to use Unicode variant in all cases(not only because it is deprecated and ugly). And one - just try to load DialogBox withou any controls first, and only then tru with other controls, in order to avoid overlapped errors.
By the way, rename DialogBoxIndirectCallback into DlgProc or something similar - it is more readable and matches references in MSDN and manuals.
Posted: Sat Apr 07, 2012 7:10 pm
by KDJ
FeyFre
Well, I didn't notice that it is a macro.
Thank you very much.
Posted: Sat Apr 07, 2012 10:00 pm
by Andrey_A_A
KDJ
можно попросить...
в скрипте Translator.js сделать ещё параметр, который позволял бы открывать переводчик сразу с содержимым буфера обмена
к примеру:
Call("Scripts::Main", 1, "Translator.js", "en ru" "1")