Announcement

Collapse
No announcement yet.

Scintilla with MemoryEx

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shrek
    replied
    thanks again Bas, you know I caught the multi threading thing on your facebook page,hows that going?

    Leave a comment:


  • Imagine Programming
    replied
    Originally posted by Shrek View Post
    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?
    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).

    Leave a comment:


  • Shrek
    replied
    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:


  • Imagine Programming
    replied
    Originally posted by Shrek View Post
    Bas, its working, thanks again. Is that scintilla you're using in the LH compiler?
    It sure is, when I highlight syntax, I use scintilla.

    Leave a comment:


  • Shrek
    replied
    Bas, its working, thanks again. Is that scintilla you're using in the LH compiler?

    Leave a comment:


  • Imagine Programming
    replied
    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:


  • Shrek
    replied
    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:


  • Imagine Programming
    replied
    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:


  • Imagine Programming
    replied
    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.
    Thanks, I'll test it out this evening after my workday!

    Leave a comment:


  • Shrek
    replied
    Scintilla.zip

    It looks like DFH wants everyone to use their own downloader now, I cant delete/edit that post.

    Leave a comment:


  • Imagine Programming
    replied
    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:


  • Shrek
    replied
    Here is a better bit of implementing using only MemoryEx with error reporting.

    Scintilla.txt

    Leave a comment:


  • Shrek
    replied
    thanks Baz, you know I had a play around this morning in an attempt to list the uMsg codes:

    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)
    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.

    Leave a comment:


  • Imagine Programming
    replied
    Shrek, I'll have a look at it this afternoon.

    Leave a comment:


  • Imagine Programming
    replied
    @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:

Working...
X