@Bornish: Fantastic, man. No change of files on hd. That's what I wanted to hear. What a relieve. *phew*
That was competent and detailed research. *Applause*
I'll give you a rep as soon as I'm through again. :)
Printable View
@Bornish: Fantastic, man. No change of files on hd. That's what I wanted to hear. What a relieve. *phew*
That was competent and detailed research. *Applause*
I'll give you a rep as soon as I'm through again. :)
Thanks Bornish for your explanation!. Now, i can understand meaning of the hex string.
If you change position of
Public Sub zSubclass_Text_Proc(ByVal bBefore As Boolean, ByRef bHandled As Boolean, ByRef lReturn As Long, ByRef lng_hWnd As Long, ByRef uMsg As Long, ByRef wParam As Long, ByRef lParam As Long)
you will not subclass the usercontrol and you can meet an error.
Nobody can help me?.
Ditto from me.Quote:
Originally Posted by WoF
Great work. I never understand how people are able to retranslate native into asm . There is obviously no fixed len between this parts of code so oe time its 55 then its 89E5 ... When I look at this
I cannot see any regular pattern for example 2 figures, 4 figures, 6 figures, .. this fits two times then its not this way.. so how does anyone find back from native to asm ?? Really astonished this man get my full admiration. :thumb:Code:"55" & " 89E5" & "83C4F8" & "57" & "31C0" & "8945FC" & "8945F8" & "EB0E" & "E800000000" & _
"83F802" & "7421" & "85C0" & "7424" & "E830000000" & _
"837DF800" & "750A" & "E838000000" & _
"E84D000000" & _
"5F" & "8B45FC" & "C9" & "C21000" & _
Thanks everyone for the nice comments. It feels good to see your work appreciated.
@JonnyPoet: regarding the translation of native code into asm, I did not do it manually. Any disassembler will be able to do it for you. You can even write one of your own (I did), since it is all fully documented (for example Intel provides a fantastic documentation on their IA32 and IA64). In this case, the simplest way to do it is to insert at the beginning of the hex string a breakpoint, which will stop execution in any debugger, which will then show you everything: the assembly listing, the code bytes for each instruction, the addresses at which the instructions reside (so you can see the control flow changes). How to insert a breakpoint? A breakpoint is an interuption "int 3" for which the hex representation is "CC". Why are the instructions of different sizes? Because it depends on the number /content type of parameters it needs to take, similar to function prototypes. It is actually possible for a human brain to work with hex representations of 32-bit assembly without much help from an automated tool, but I don't think that anyone can do that on 64-bit implementations. Still, you never know... even that nowadays ppl aren't much interested in low-level implementations. The tendency is to have everything taken care about the automated tools. I prefer to stay in between. ;)
Best of luck,
Although I'M calmed down a little now, I'd rather know what this patch achieves. Where are these patches applied to? Why are references made to "VB6" and to "user32"?
Is it sure that no files are changed? I fear I have to reinstall my Visual Studio because of strange behaviour with my application.
First, you should insert the piece of code that chimdangsung forgot to copy from the original author of this subclassing tehnique. Then, make sure you do not modify the control's virtual function table, since it is using a fixed offset to call the replacement method which handle the intercepted messages. Then, I believe it is safe enough for your environment. What I can tell you for sure, that is not malicious code, and was not intended to harm your computer in any way. Those DLLs are not modified, not even in memory (also not on the hdd). Those DLLs are not even loaded, because the code assumes that are already loaded, and simply retrieves their handle. Why? The code needs the addresses for "SetWindowLongA" and "CallWindowProcA" functions exported by "user32.dll". The "EbMode" function (undocumented one, probably) is exported by "vba6.dll" or "vba5.dll", depending on the version of the IDE used. I would assume that normal subclassing was replaced by this tricky (as well as buggy) method using embeded code, because VB IDE is unstable (known fact) with subclassed controls, as well as multithreading.Quote:
Originally Posted by WoF
Don't have much time now to re-write this code as I would consider bug-safe, in order to test it with VC++ debugger and log the window messages with Spy++, and maybe find the reason for OP's problem.
Regards,
Thanks again.
Gives me the feeling I've got to look elsewhere for a reason for my problems.
My trouble was handled after rebootingQuote:
Originally Posted by WoF
I have modified the subclassing code in order to test this control's behaviour. The only thing I've noticed is that tab-switching isn't working properly, and may be caused by how the messages are processed in the subclassing procedure. The replacement procedure is handling WM_SETFOCUS, but ignores the parameter received (recall that WM_SETFOCUS is sent both when focus is received and lost). Also, there's an event "UserControl_EnterFocus" which has been commented out. When WM_CHAR is received with Tab key, the focus is manually changed to the parent window of the usercontrol. All these are messing the normal behaviour of Z-ordering. If anyone would like to try to find how to correct this behaviour, I have uploaded this version which executed safely on my computer (both as standalone exe as well as in IDE mode). Instead of debugging this implementation, I would prefer to write another usercontrol with the same functionality (unicode textbox), subclassed with no embedding of native code, and that properly handles tab-switching.
Regards,
Thanks Bornish!. I 'll research to fix this bug.
Hi all,
First, I want to thanks to all of your for discussing and helping me at this thread. Finally, I fixed this bug and here my source code (file attachment)
Thanks to my friends so much!.
Best Regard!
Congrats!Quote:
Originally Posted by chimdangsung
So now, you can change the thread to [RESOLVED] state. ;)