SendMessageA

構文(VBA)
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
構文(UWSC)
DEF_DLL SendMessageA(long, long, long, string): long: user32.dll
引数
hwnd
wMsg
wParam
lParam
戻り値

プログラム実行例

DLLを使ってメモ帳にメッセージを送信する

DEF_DLL FindWindowA(string, string): long: user32.dll
DEF_DLL FindWindowExA(long, long, string, string): long: user32.dll
DEF_DLL SendMessageA(long, long, long, string): long: user32.dll

EXEC("notepad")

hNotePad = FindWindowA("Notepad", NULL)
hEdit = FindWindowExA(hNotePad, 0, "Edit", NULL)
PRINT SendMessageA(hEdit, 12, 0, "送信するメッセージ")
  1. user32.FindWindowA
  2. user32.FindWindowExA
  3. user32.SendMessageA
  4. EXEC