Announcement
Collapse
No announcement yet.
Scintilla with MemoryEx
Collapse
X
-
thanks again Bas, you know I caught the multi threading thing on your facebook page,hows that going?
-
At this time, you can't subclass a window twice using MemoryEx. Maybe in the future, however for now you can't. This is because MemoryEx isn't dynamically creating C functions to set a subclass, which in turn call your Lua function. (DEP - Data execution prevention is standing in the way).Originally posted by Shrek View PostHello again, so what I did wrong with this was to subclass the scintilla window rather than the main application or dialog window, since it has to be the main window that picks up the WM_NOTIFY message I was wondering how I could go about inserting a subclass in to a subclass or checking if a window is subclassed as you can't set a subclass twice on the same window? this is basically so any existing subclasses will still work when the LH module is loaded and given MemoryEx is a dependency its likely there will be a subclass?
Leave a comment:
-
Hello again, so what I did wrong with this was to subclass the scintilla window rather than the main application or dialog window, since it has to be the main window that picks up the WM_NOTIFY message I was wondering how I could go about inserting a subclass in to a subclass or checking if a window is subclassed as you can't set a subclass twice on the same window? this is basically so any existing subclasses will still work when the LH module is loaded and given MemoryEx is a dependency its likely there will be a subclass?
Leave a comment:
-
It sure is, when I highlight syntax, I use scintilla.Originally posted by Shrek View PostBas, its working, thanks again. Is that scintilla you're using in the LH compiler?
Leave a comment:
-
Bas, its working, thanks again. Is that scintilla you're using in the LH compiler?
Leave a comment:
-
Try something like this; The subclass is attached in CreateWindow and removed in DestroyWindow. Do mind though, you can only subclass a hWnd once using the Subclass part of MemoryEx. This means you can only set the subclass function once for all and any Scintilla objects you create.
scintilla.lua
Leave a comment:
-
Thanks Bas, its indeed working, one more thing (cheeky I know
) I intend to wrap this all up in a LH module so before I get carried away is the code stilling I am using good to go with that or do I need to alter the structure?
Leave a comment:
-
I do get the WM_NOTIFY messages, see attachement.
Also, please remember that before you exit the application, you should remove the subclasses from all the windows you subclassed (e.g. in On Shutdown, check this example for that too)Attached Files
Leave a comment:
-
Thanks, I'll test it out this evening after my workday!Originally posted by Shrek View Post[ATTACH]12397[/ATTACH]
It looks like DFH wants everyone to use their own downloader now, I cant delete/edit that post.
Leave a comment:
-
Scintilla.zip
It looks like DFH wants everyone to use their own downloader now, I cant delete/edit that post.
Leave a comment:
-
Thank you, now, the DLL you have uploaded and shared via datafilehost wants me to download a Scintilla.exe file, I do not quite like this, what am I downloading?
Leave a comment:
-
Leave a comment:
-
thanks Baz, you know I had a play around this morning in an attempt to list the uMsg codes:
and 78 (WM_NOTIFY) does not appear no matter if you add text or highlight text or delete text or double click etc so I'm thinking that it already knows its a WM_NOTIFY and instead gives you some sort of other coding structure for example I think adding text is 15 but its difficult to know as you get the on enter and on click and set focus codes also but 123 (WM_CONTEXTMENU) seems to show up even if you dont right click.Code:local s = Subclass.Create(hWnd,function(hWnd,uMsg,wParam,lParam) TextFile.WriteFromString(_DesktopFolder.."\\MyFile.txt",tostring(uMsg).."\n", true); return Subclass.OldWinProc(hWnd, uMsg, wParam, lParam) end)
Leave a comment:
-
@Reteset,
the 'return Subclass.OldWinProc' line calls the previously set callback procedure on the window. It does not set the old callback function back, but it makes sure that all messages you do not handle will be handled by the previous callback function in the chain of callback functions.
Leave a comment:
Leave a comment: