きたないですが・・・
#uselib "user32.dll"
#func global SetWindowPos "SetWindowPos" sptr,sptr,sptr,sptr,sptr,sptr,sptr
#define global SetWindowLong SetWindowLongA
#func global SetWindowLongA "SetWindowLongA" sptr,sptr,sptr
#define global GetWindowLong GetWindowLongA
#func global GetWindowLongA "GetWindowLongA" sptr,sptr
#func global InvalidateRect "InvalidateRect" sptr,sptr,sptr
#define global CreateWindowEx CreateWindowExA
#func global CreateWindowExA "CreateWindowExA" sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr
#func global SetParent "SetParent" sptr,sptr
#define global GetWindowText GetWindowTextA
#func global GetWindowTextA "GetWindowTextA" sptr,sptr,sptr
#uselib "gdi32.dll"
#func global GetStockObject "GetStockObject" sptr
#func global SetBkColor "SetBkColor" sptr,sptr
#func global SetTextColor "SetTextColor" sptr,sptr
#func global SetBkMode "SetBkMode" sptr,sptr
#define global WM_CTLCOLORSTATIC 0x0138 //スタティック
#define global WM_CTLCOLOREDIT 0x0133 //エディットボックスinput
#define global GWL_EXSTYLE $FFFFFFEC
#define global WS_EX_TOPMOST $00000008
#define global SWP_SHOWWINDOW 0x0040
#define global SWP_NOSIZE 0x0001
#define global SWP_NOMOVE 0x0002
#define global WS_CHILD 0x40000000
#define global WHITE_BRUSH 0 //ホワイトブラシ
#define global NULL_BRUSH 5
#define global WS_VISIBLE 0x10000000
#define global GWL_STYLE -16
#define global WM_ERASEBKGND 0x0014 //自動で背景を削除されないようにする
#define ctype crgb(%1,%2,%3) (%1|(%2<<8)|(%3<<16))
#module
#deffunc objvisible int p1,int p2
if p2=1{
SetWindowPos p1,0,0,0,0,0,SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE
}else{
SetWindowPos p1,0,0,0,0,0,SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE
}
return
#global
syscolor 15 : boxf
aa="" : bb=""
sysfont 17
mref bm, 67 : hfont=bm(38)
pos 10,10
input aa,100,21,256
haa=objinfo(stat,2)
pos 10,50
input bb,100,21,256
hbb=objinfo(stat,2)
GetStockObject WHITE_BRUSH
hwhite=stat
GetStockObject NULL_BRUSH
hnull=stat
pos 12,12
winobj "STATIC","検索ボックス",0,WS_VISIBLE|WS_CHILD,100,18
hs=objinfo(stat,2)
//statictext "検索ボックス",90,18
//hs=objinfo(stat,2)
sendmsg hs, $30, hfont, 1
oncmd gosub *ON_WM_CTLCOLORSTATIC,WM_CTLCOLORSTATIC
oncmd gosub *ON_WM_CTLCOLOREDIT,WM_CTLCOLOREDIT
oncmd gosub *ON_WM_ERASEBKGND,WM_ERASEBKGND
stop
*ON_WM_ERASEBKGND
return
*ON_WM_CTLCOLORSTATIC
if lparam=hs{
objsel -1
losel=stat
if (objinfo(stat,2)!haa)&(aa=""){
SetBkColor wparam,crgb(255,255,255)
SetTextColor wparam,crgb(180,180,180)
sdim buf,256
GetWindowText hs,varptr(buf),256
if buf="": sendmsg hs,$c,0,"検索ボックス"
return hwhite
}else{
sendmsg hs,$c,0,""
SetBkMode wparam,$1
return hnull
}
}
return
*ON_WM_CTLCOLOREDIT
hsel=lparam
rect=0,0,80,18
InvalidateRect hs,varptr(rect),0
return