Tools Links Login

Hooking Message Boxes!

Download the article code. My last upload didnt go through for some reason ... !

Original Author: Andy Matteson

Code

This code can change the caption of buttons.
This is how it works:




First, you need to "Hook" the message box. This allows you to change button captions and stuff.




Then, you need to do a FindWindow on the message box dialog, FindWindow("#32770", "Title"). This will retrieve the hWnd of the Message Box.




After that you need to get the hWnd of the buttons (or use the SetDlgItemText API function). To get the hWnd of the button, you do FindWindow("Button", "Button Caption").




Then you just need to send the WM_SETTEXT message to set the text of the button, and you're done! You have your custom message box. If I'm right, I think that's how it goes, as I'm just reciting from my brain right now. If I made a mistake, just download my article zip. It does everything right. No mistakes there :).

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 87 times

Categories

Visual Basic 6

Attachments

Hooking_Me574042252002.zip
Posted: 9/3/2020 3:45:00 PM
Size: 8,547 bytes


Comments

No comments have been added for this post.

You must be logged in to make a comment.