Is it possible to send a MessageBox to a program that will display it like its own MessageBox?
i thought maybe to use FindWindow to get the hWnd and use SendMessage to somehow send a MessageBox, but then i thought why would it even display it and now I'm not even sure its possible without a dll or some kinda hook.
is there an easy way to do this?
thanks ahead.
hi
You can patch a Msgbox to a other program with:
1.Add a section
2.Change the entrypoint to this section
3.Write in this offset entrypoint the Msgbox
I'm not sure that in this forum is allowed, so I will not post a example.
greets
ragdog
Hello,
The more simple way is creating a new message (in the called window) with:
Quote
invoke RegisterWindowMessage,addr MyMessage ;MyMessage db "WM_MYMESSAGE",0
mov NumMyMessage,eax
The caller can send the message to all windows or only to a particular window.
The called window use the message as all windows messages and can put it in a message box.
See winhelp for samples and references.
If you are the original creator of the program then adding a MessageBox to it should be easy.
If you are not the original creator then you should not change it.
Maybe the program has a plug-in system that you could use or maybe not. Or maybe you are capable of writing your own program that will do what the original program does and more.
Unless you have a very valid reason both legally and morally I suggest that you do not inject code into another application, you do not hook API's and you do not change it's start code by adding an extra section.
Some of those actions can be interpreted as malware and some are in the shadow area.
On those forums we are more concerned with creation of ASM programs and routines rather than taking over somebody else's work or walking in the shadows.
This answers my question, thank you.
and no, I'm not looking to inject code into a 3rd party app, just wandered to know how this can be done.