HSPの命令を関数としても使えるようにする
ちょっとした裏技。
最終更新:2017/11/18
初版:2017/11/18
#module #defcfunc f_sendmsg int hnd, int msg, int wp, int lp sendmsg hnd, msg, wp, lp return stat #global sendmsg hwnd,0x000C/*WM_SETTEXT*/,0,"12345" mes f_sendmsg(hwnd,0x000E/*WM_GETTEXTLENGTH*/,0,0)名前が変わるところが気に入りませんね... (筆者個人の感想です。)
#include "hscallbk.as" #undef sendmsg #uselib "" #func MySendMsg "" int, int, int, int #func sendmsg "" sptr, sptr, sptr, sptr setcallbk pSendMsg, MySendMsg, *MySendMsgFunc //関数アドレス変更 ladr=libptr(sendmsg) dupptr lptr, ladr+4*6, 4 lptr= varptr(pSendMsg) sendmsg hwnd,0x000C/*WM_SETTEXT*/,0,"12345" mes sendmsg(hwnd,0x000E/*WM_GETTEXTLENGTH*/,0,0) stop *MySendMsgFunc sendmsg@hsp callbkarg(0), callbkarg(1), callbkarg(2), callbkarg(3) return stat
(C)2019 inonote / 無断転載禁止