SDL Input in an existing window |
Nathaniel J Fries
|
SDL_CreateWindowFrom IIRC
|
|||||||||||
|
Section
|
Sounds promising but it causes the parent application to crash.
It specifically breaks on the line: SDL_Window *w = SDL_CreateWindowFrom(hWnd); Dump file tells me the exception: The thread tried to read from or write to a virtual address for which it does not have appropriate access.
|
|||||||||||||
|
Nathaniel J Fries
|
Is this window in another application? If that's the case, then I am fairly confident I know the root of the issue but am unaware of a work-around that would not require modifying SDL (SDL modifies storage reserved for the window, since this is in another process it would cause an access violation); but I'm unsure as to why you'd be attempting this if that were the case.
|
|||||||||||
|
Section
|
It is a seperate application of which I'm injecting into. I'm using it to try and learn about modifying existing application functionality. There's no specific end goal project, I'm just interested in learning it. An example would be the various mods for roguelikes. Such as a dwarf fortress mod that reads the base game data from the application and provides isometric or 3d graphics over the standard display. I can get CEGUI to draw over the existing window on an external application with a DLL hook, and was hoping to use SDL's simple yet effective input management to pass the input to CEGUI from the same window. |
|||||||||||||
|
SDL Input in an existing window |
Patrick Baggett
Guest
|
If you are trying to hook into an existing window in a different app and have the hWnd of the window, try CreateRemoveThread() and AttachThreadInput(). You may need to hook into an existing DLL to allow for code injection. After that, you can simply send messages from that thread to your app. Not quite as straightforward, but could work.
Patrick On Thu, Jun 2, 2011 at 3:46 AM, Section wrote:
|
|||||||||||||
|
Re: SDL Input in an existing window |
Nathaniel J Fries
|
That would work fine if he were using windows API directly. In the case of SDL, this will still cause problems because of SDL's use of GetWindowWord/Long/LongPtr |
|||||||||||||
|