Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private toto As Long Private Sub Command1_Click() toto = FindWindow(vbNullString, "Clavier visuel") ShowWindow toto, 0 MsgBox "caché" ShowWindow toto, 1 MsgBox "montré" End Sub
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long Private Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) Private toto As Long Private Sub Command1_Click() Dim lStyle As Long, agauche As Long, enhaut As Long Dim tR As RECT toto = FindWindow(vbNullString, "Clavier visuel") GetWindowRect toto, tR lStyle = GetWindowLong(toto, -16) lStyle = lStyle And Not &H20000 SetWindowLong toto, -16, lStyle agauche = 0 enhaut = 0 SetWindowPos toto, 0, agauche, enhaut, tR.Right - tR.Left, tR.Bottom - tR.Top, &H20 MsgBox "je l'ai ici mis en haut et à gauche de ton écran et j'ai fait sauter son bouton de réduction" ShowWindow toto, 0 MsgBox "caché" ShowWindow toto, 1 MsgBox "montré" End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question