Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question'Pour changer le titre Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As Long) As Long Private Sub Command1_Click() Dim HwndWin As Long 'Obtenir le handle HwndWin = FindWindow("TrayClockWClass", "") HwndWin = FindWindowEx(HwndWin, 0, "BUTTON", 0) 'Changer le texte ! SetWindowText HwndWin, Text1.Text End Sub
HwndWin = FindWindow("TrayNotifyWnd", "") HwndWin = FindWindowEx(HwndWin, 0, "TrayClockWClass", 0)
HwndWin = FindWindow("TrayNotifyWnd", "") HwndWin = FindWindowEx(HwndWin, 0, "TrayClockWClass", 0)
HwndWin = FindWindow("Shell_TrayWnd", "") HwndWin = FindWindowEx(HwndWin, 0, "TrayClockWClass", 0)
Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Sub text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Unload Me End Sub Private Sub Form_Load() Dim hWnd As Long hWnd = FindWindow("Shell_TrayWnd", vbNullString) hWnd = FindWindowEx(hWnd, 0, "TrayNotifyWnd", vbNullString) hWnd = FindWindowEx(hWnd, 0, "TrayClockWClass", vbNullString) SetParent Text1.hWnd, hWnd End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) SetParent Text1.hWnd, Me.hWnd End Sub Private Sub Timer1_Timer() Text1.Text = Timer End Sub