Sub CreateStickyNoteAndPaste2()
' Launch Sticky Notes
Shell "explorer.exe shell:appsFolder\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App", vbNormalFocus
' Wait for Sticky Notes to appear
Dim hwndStickyNote As LongPtr
Do While hwndStickyNote = 0
hwndStickyNote = FindWindowExW(0, 0, "ApplicationFrameWindow", vbNullString)
DoEvents
Loop
' Find the Sticky Notes window
hwndStickyNote = FindWindowExW(hwndStickyNote, 0, "Windows.UI.Core.CoreWindow", vbNullString)
' Set Sticky Notes as the foreground window
SetForegroundWindow hwndStickyNote
' Find the edit control
Dim hwndEdit As LongPtr
hwndEdit = FindWindowExW(hwndStickyNote, 0, "Edit", vbNullString)
' Click on the edit control to give it focus
SendMessageW hwndEdit, &HF5, 0, ByVal 0&
' Open the clipboard
OpenClipboard hwndEdit
' Retrieve the clipboard data
Dim hData As LongPtr
hData = GetClipboardData(&HCF)
' Close the clipboard
CloseClipboard
' Paste the data into the edit control
SendMessageW hwndEdit, &H302, 0, ByVal hData
End Sub