Scripts plugin
- Author
- Message
-
Offline
- Posts: 670
- Joined: Thu Jun 03, 2010 8:47 am
- Location: Сочи, Хоста
- Contact:
-
Offline
- Posts: 670
- Joined: Thu Jun 03, 2010 8:47 am
- Location: Сочи, Хоста
- Contact:
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Instructor
After calling AkelPad.MessageBox (extended version), the dialog box, from which the method has been called (hWndDlg), disappears.
After calling AkelPad.MessageBox (extended version), the dialog box, from which the method has been called (hWndDlg), disappears.
Code: Select all
AkelPad.MessageBox(hWndDlg, "That is the question", "Message Box",
32 /*MB_ICONQUESTION*/, 0,
1 /*IDOK*/, "&OK", 1 /*BMB_DEFAULT*/,
2 /*IDCANCEL*/, "&Cancel", 0);
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
KDJ
Different threads SendMessage can cause GUI freeze.
One of the way avoiding this is hide dialog:
Different threads SendMessage can cause GUI freeze.
One of the way avoiding this is hide dialog:
Code: Select all
oSys.Call("user32::ShowWindow", hWndDlg, 0 /*SW_HIDE*/);
AkelPad.MessageBox(hWndDlg, "That is the question", "Message Box",
32 /*MB_ICONQUESTION*/, 0,
1 /*IDOK*/, "&OK", 1 /*BMB_DEFAULT*/,
2 /*IDCANCEL*/, "&Cancel", 0);
oSys.Call("user32::ShowWindow", hWndDlg, 5 /*SW_SHOW*/);
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Instructor
It seems to me, that there is no need to hide dialog window, because it is hidden automatically after MessageBox (extended) call.
But I wanted to, in order to dialog box will be visible at all times.
Below I put the script that shows differences in the behavior of standard and extended MessageBox:
It seems to me, that there is no need to hide dialog window, because it is hidden automatically after MessageBox (extended) call.
But I wanted to, in order to dialog box will be visible at all times.
Below I put the script that shows differences in the behavior of standard and extended MessageBox:
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
KDJ
There is no sense to make it visible because you will have GUI freezed. Extended dialog runs from main thread and you call it from its owner - Scripts dialog thread. This will cause GUI thread conflict.
You can try it by your own:
There is no sense to make it visible because you will have GUI freezed. Extended dialog runs from main thread and you call it from its owner - Scripts dialog thread. This will cause GUI thread conflict.
You can try it by your own:
Last edited by Instructor on Sun May 06, 2012 12:19 pm, edited 1 time in total.
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
Добавлено: методы AkelPad.CallA, AkelPad.CallW, AkelPad.CallExA, AkelPad.CallExW.
Added: AkelPad.CallA, AkelPad.CallW, AkelPad.CallExA, AkelPad.CallExW methods.
Scripts plugin v10.8
Added: AkelPad.CallA, AkelPad.CallW, AkelPad.CallExA, AkelPad.CallExW methods.
Scripts plugin v10.8
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
It works a little better, but:Instructor wrote:KDJ
There is no sense to make it visible because you will have GUI freezed. Extended dialog runs from main thread and you call it from its owner - Scripts dialog thread. This will cause GUI thread conflict.
You can try it by your own:
- is very complicated to use,
- if you switch to another window, AkelPad hangs.
-
Offline
- Posts: 2247
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
Я так понимаю, они манипулируют вот этими?Added: AkelPad.CallA, AkelPad.CallW, AkelPad.CallExA, AkelPad.CallExW methods.
Code: Select all
#define PDS_STRANSI 0x20000000 //Flag is set if caller passes Ansi strings in external call arguments (PLUGINDATA.lParam).
#define PDS_STRWIDE 0x40000000 //Flag is set if caller passes Unicode strings in external call arguments (PLUGINDATA.lParam).
//If PDS_STRANSI and PDS_STRWIDE not specified then one of these flags will be set automatically depending on Windows version.
Что мне(плагинам) делать, если вдруг придет с тем что не поддерживается? У меня у плагинов стоит всегда ставится PDS_NOANSI, а кто-то возьмет и пришлет с PDS_STRANSI. Как минимум, что мне ставить в PLUGINDATA::nUnload ?
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
FeyFre
Так можно:
Так можно:
Code: Select all
//If plugin already loaded, stay in memory and don't change active status
if (pd->bInMemory) pd->nUnload=UD_NONUNLOAD_UNCHANGE;
return;