Change the standard message box button, simple method for text

xiaoxiao2021-03-06  55

'Code by 魑 魑 魍魉' Mailto: DemonStudio@hotmail.com

Private Declare Function FindWindow Lib "user32" Alias ​​"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Declare Function MessageBox Lib "user32" Alias ​​"MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As LongPrivate Declare Function SetWindowLong Lib "user32" Alias ​​"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPrivate Declare Function SendMessage Lib "user32" Alias ​​"SendMessageA" ( ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPrivate Declare Function FindWindowEx Lib "user32" Alias ​​"FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As string) as long

Private const wm_setfont = & h30private const WM_GETFONT = & H31Private const wm_killfocus = & h8

PRIVATE SUB Command1_Click () Timer1.enabled = True MessageBox Me.hwnd, "I Love You", "BBBB", 0END SUB

PRIVATE SUB FORM_LOAD () Timer1.Iterval = 100 Timer1.enabled = Falsend Sub

Private sub timer1_timer () DIM A, B As longa = FindWindowEx (FindWindow ("# 32770", "bbb"), 0, "button", "OK") B = FINDWINDOWEX (FindWindow "," # 32770 "," bbbb " ), 0, "static", "I love you") '"" is the icon Static window name if a <> 0 THEN SETWINDOWLONG A, -16, & H50008000 SendMessage A, & H8, 0, 0 Text1 = SendMessage Text1.hwnd, & H31, 0, 0) SendMessage A, & H30, ClNG (Text1), 0 SendMessage B, & H30, ClNG (Text1), 0nd iftimer1.enabled = Falsend Sub effect is as follows:

转载请注明原文地址:https://www.9cbs.com/read-119290.html

New Post(0)