Advertisement
Java_Volume1 VB function enhancement #96023

Hooking Message Boxes!

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

AI

Ringkasan AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kode Sumber
original-source
This code can change the caption of buttons.
This is how it works:
<BR>
<BR>
First, you need to "Hook" the message box. This allows you to change button captions and stuff.
<BR>
<BR>
Then, you need to do a FindWindow on the message box dialog, FindWindow("#32770", "Title"). This will retrieve the hWnd of the Message Box.
<BR>
<BR>
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").
<BR>
<BR>
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 :).
Komentar Asli (3)
Dipulihkan dari Wayback Machine