Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Last active May 27, 2019 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumatti1/09a2d5353a33daf5d5d73b5a8a25863f to your computer and use it in GitHub Desktop.
Save kumatti1/09a2d5353a33daf5d5d73b5a8a25863f to your computer and use it in GitHub Desktop.
諸般の事情により、久し振りにVBAを使ったなー。
Option Explicit
Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, lParam As Any) As LongPtr
Sub hoge()
Dim hWnd&: hWnd = FindWindow("Notepad", vbNullString)
SendMessage hWnd, &H111, 4, ByVal 0&
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment