HSPからDirectSSTP経由でSSP(デスクトップマスコット)に通知するサンプル
HSPからDirectSSTP経由でSSP(デスクトップマスコット)に通知するサンプル
#include "kernel32.as" #include "user32.as" #define MUTEX_ALL_ACCESS 0x1f0001 #define PAGE_READONLY 0x02 #define ERROR_ALREADY_EXISTS 183 #define FILE_MAP_READ 4 #define WM_COPYDATA 0x004a hSakura = 0 OpenMutex MUTEX_ALL_ACCESS, 0, "ssp" hMX = stat if hMX != 0 { OpenFileMapping FILE_MAP_READ, 0, "Sakura" hObj = stat if hObj != 0 { MapViewOfFile hObj, FILE_MAP_READ, 0, 0, 65536 if stat != 0 { ptr = stat dupptr tmp, ptr+4, 65536, 2 size = strlen(tmp) sdim buf, size memcpy buf, tmp, size, 0, 0 UnmapViewOfFile ptr tmp = 0 bell = "" : poke bell, 0, 1 notesel buf repeat notemax noteget tmp, cnt sdim tmp2, 64, 1 : sdim tmp3, 64, 1 split tmp, bell, tmp2 split tmp2(0), ".", tmp3 if tmp3(1) == "hwnd"{ hSakura = int(tmp2(1)) } loop noteunsel } CloseHandle hObj } CloseHandle hMX } if hSakura != 0{ data = "NOTIFY SSTP/1.1\nSender: テスト\nEvent: onTalk\nScript: \\t\\1\\s[10]\\\s[0]Test!!\\e\nHWnd: "+hwnd+"\nCharset: Shift_JIS\n\n" dim cds, 3 cds(0) = data_id cds(1) = strlen(data) cds(2) = varptr(data) sendmsg hSakura, WM_COPYDATA, hwnd, varptr(cds) mes data }