D
Deleted member 208
Guest
Anh chị @vothanhthu và @NhanSu cho em hỏi:
-Hàm SetWindowText này để làm gì?
Theo thông tin em đọc thì em hiểu là thay đổi UserForm Cation. Nhưng em thử thì không được.
Vậy, hàm này để làm gì vậy ạ?
-Hàm SetWindowText này để làm gì?
Theo thông tin em đọc thì em hiểu là thay đổi UserForm Cation. Nhưng em thử thì không được.
Vậy, hàm này để làm gì vậy ạ?
Mã:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" _
(hWnd As Long, _
lpString As LongPtr) As Long
Private Sub UserForm_Initialize()
Dim hWnd&, sUnicode$
hWnd = FindWindow("ThunderDFrame", Caption) ' Tim HWnd cua UserForm
sUnicode = Range("A1").Value 'Noi chua chuoi unicode
SetWindowText hWnd, StrPtr(sUnicode)
End Sub