Have Child Script Update Parent Box
Keywords: custom static control BoxOpen from Parent to Child
Question:
I am trying to use the box open command and want to use the same windows for all child apps. How would I accomplish this?I use the main application as a wrapper\launcher and the child exe's to do the actual work.
Answer:
If you only need to update the box text you could create a custom static control and pass its handle to the child scripts so they can update it.Something like:
;MAIN SCRIPT ;x , y : position in pixels ;w , h : width & height in pixels ;txt : initial text ;style : additional style , set to 0 or use api values #definefunction createstatic(x,y,w,h,txt,style) hwnd=dllhwnd("") hinst=dllhinst("") user32=strcat(dirwindows(1),"user32.dll") return dllcall(user32,long:"CreateWindowExA",long:0,lpstr:"Static",lpstr:txt,long:1073741824|268435456|style,long:x,long:y,long:w,long:h,long:hwnd,long:0,long:hinst,long:0) ;WS_CHILD|WS_VISIBLE #endfunction BoxColor(1,"192,192,192",0) ;same as static hstatic=createstatic(10,10,100,25,"",0) boxopen("","") call("update.wbt",hstatic) ;run("update.exe",hstatic) ;end main ;CHILD SCRIPT (update.wbt) for x=1 to 10 IntControl(22,param1,12,0,x) ;WM_SETTEXT timedelay(1) next ;end child