Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Privacywetgeving
Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.
Public Sub Legen()
DoActionOfficeClipboard "Alles wissen" 'Tekst op de button
Application.CommandBars("Office Clipboard").Visible = False
End Sub
Sub M_snb()
For Each it In Tasks
If InStr(it.Name, "Clipboard") Then
MsgBox it.Name
it.SendWindowMessage &HA1, 2, 0
End If
Next
End Sub
Code:application.displayalerts=false
[SIZE=1]Option Explicit
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) 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.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_LBUTTONDOWN As Long = &H201&
Private Const WM_LBUTTONUP As Long = &H202&
Private Type tWindow
Parent As Long
Handle As Long
Class As String
Title As String
End Type
Private atWindow() As tWindow
Private miatWindow As Long
Private Function EnumChildProc(ByVal hWnd As Long, ByVal lParam As Long) As Long
Dim lpClassName As String
Dim lpWindowText As String
Dim lResult As Long
Dim sClassName As String
Dim sWindowText As String
miatWindow = miatWindow + 1
ReDim Preserve atWindow(1 To miatWindow)
lpClassName = Space(256)
lResult = GetClassName(hWnd, lpClassName, 256)
sClassName = Left(lpClassName, lResult)
lpWindowText = Space(100)
lResult = GetWindowText(hWnd, lpWindowText, 100)
sWindowText = Left(lpWindowText, lResult)
With atWindow(miatWindow)
.Parent = GetParent(hWnd)
.Handle = hWnd
.Class = sClassName
.Title = sWindowText
End With
EnumChildProc = 1
End Function
Public Sub ClearOfficeClipboardMultiLanguage() 'am_2016
'clears the office clipboard in all windows languages
Const sOffice As String = "Office" 'title of root contains "Office"
Dim atWindowIndex(1 To 3) As Long
Dim hWnd As Long
Dim hWndButton As Long
Dim hWndClipboard As Long
Dim iatWindow As Long
Dim lParameter As Long
Dim sClipboard As String
Application.CommandBars("Office Clipboard").Visible = True 'show office clipboard
DoEvents
hWnd = FindWindow("XLMAIN", Application.Caption)
hWnd = FindWindowEx(hWnd, 0, "EXCEL2", "")
EnumChildWindows hWnd, AddressOf EnumChildProc, ByVal 0& 'build windowdata tree
For iatWindow = 1 To miatWindow 'iterate window data tree
If Left(atWindow(iatWindow).Title, Len(sOffice)) = sOffice Then 'begins with "Office"
atWindowIndex(1) = iatWindow
sClipboard = Trim(Mid(atWindow(iatWindow).Title, Len(sOffice) + 1)) 'get "Clipboard" or word in other language
End If
Next
For iatWindow = 1 To miatWindow
If Left(atWindow(iatWindow).Title, Len(sClipboard)) = sClipboard Then 'begins with "Clipboard" or word in other language
atWindowIndex(2) = iatWindow
hWndClipboard = atWindow(iatWindow).Handle
End If
Next
For iatWindow = 1 To miatWindow
If atWindow(iatWindow).Parent = hWndClipboard Then '"Button" is child of "Clipboard"
atWindowIndex(3) = iatWindow
hWndButton = atWindow(iatWindow).Handle
End If
Next
hWnd = FindWindowEx(hWnd, 0, atWindow(atWindowIndex(1)).Class, atWindow(atWindowIndex(1)).Title) 'get window with class and title in their language
hWnd = FindWindowEx(hWnd, 0, atWindow(atWindowIndex(2)).Class, atWindow(atWindowIndex(2)).Title) 'get window with class and title in their language and their amount of clips
hWnd = FindWindowEx(hWnd, 0, atWindow(atWindowIndex(3)).Class, atWindow(atWindowIndex(3)).Title) 'get button
lParameter = 18 * 65536 + 120 'screen coords
PostMessage hWnd, WM_LBUTTONDOWN, 0&, lParameter 'push button
PostMessage hWnd, WM_LBUTTONUP, 0&, lParameter 'release button
Application.CommandBars("Office Clipboard").Visible = False 'hide office clipboard
End Sub[/SIZE]
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.