Okay guys, yesterday I read this post at aqua xp.
It's talking about a guy that is doing a port of iCal to OD. The thing is, he is using some script to achieve this.
But this got me to the idea of writing a program that would do some kind of "docklet injection" to OD.
So I began to write a little program.
The following is for developers:
Okay, to achieve this, I need to hook the WindProc of an item. The this can't be done with SetWindowLong, because the window is in another process. So we have to write a dll that contains the new WindowProc and inject it to the process via CreateRemoteThread().
Then, we force CreateRemoteThread() to call LoadLibrary(), which loads the dll into the process memory (ie OD) and call the DllMain() function inside the Dll.
In the DllMain() we just have to do a SetWindowLong() to hook the old WindowProc.
With this we can hook some events:
- Left and right Click down/up events (WM_*BUTTON*) -> On*ButtonClick in docklets
- Paint event (WM_PAINT) -> OnPaint in docklets
But, we still to have control to the title and the icon.
To control the title, we have to find in the process memory where thoses are stored and replace them.
For the icon, I think OD operates like this:
- Load the PNG, which returns a HBITMAP
- Display the HBITMAP
So, we could change the HBITMAP in the memory, and replace with ours. But, to draw the original HBITMAP, OD must draw itself, so maybe a good WM_PAINT hooking would do the trick.
The others functions (OnCreate etc...) would be handled by the dll, or by a third party program.
And also we have to handle the real Y'z dock API.
So maybe this would require a docklet recomp, using a different lib, but this remains to be seen ![]()
To others:
This would make a total docklet compatibility for OD.
So I'm looking for some persons who are familiar to memory manipulation and are ready to get in the adventure ![]()
Regards,
siwu
Aqua-Soft Forums