;Библиотека HiAsm cIndex = 0 False equ 0 True equ 1 data_null equ 0 data_int equ 1 data_str equ 2 data_data equ 3 data_combo equ 4 data_list equ 5 data_icon equ 6 data_real equ 7 data_color equ 8 data_script equ 9 data_stream equ 10 data_bitmap equ 11 data_wave equ 12 data_array equ 13 data_comboEx equ 14 data_font equ 15 data_matr equ 16 data_jpeg equ 17 data_menu equ 18 data_code equ 19 data_real_st0 equ 60 crDefault equ 0 crArrow equ 32512 ; IDC_ARROW crIBeam equ 32513 ; IDC_IBEAM crHourGlass equ 32514 ; IDC_WAIT crCross equ 32515 ; IDC_CROSS crUpArrow equ 32516 ; IDC_UPARROW crPen equ 32631 crSizeNWSE equ 32642 ; IDC_SIZENWSE crSizeNESW equ 32643 ; IDC_SIZENESW crSizeWE equ 32644 ; IDC_SIZEWE crSizeNS equ 32645 ; IDC_SIZENS crSizeAll equ 32646 ; IDC_SIZE crNo equ 32648 ; IDC_NO crHandPoint equ 32649 ; IDC_HAND crBusy equ 32650 ; IDC_APPSTARTING crHelp equ 32651 ; IDC_HELP crVScroll equ 32652 crHScroll equ 32653 crScroll equ 32654 crScrollUp equ 32655 crScrollDown equ 32656 crScrollLeft equ 32657 crScrollRight equ 32658 crScrollUL equ 32659 crScrollUR equ 32660 crScrollDL equ 32661 crScrollDR equ 32662 caNone equ 0 caLeft equ 1 caTop equ 2 caRight equ 3 caBottom equ 4 caClient equ 5 spNone equ 0 spRaised equ 1 spLowered equ 2 spFlat equ 3 taLeft equ 0 taRight equ 1 taCenter equ 2 ; array.type = 64 + item.type data_int_array equ 65 data_str_array equ 66 data_data_array equ 67 data_real_array equ 71 macro GetArrayItemType item.t,arr.t { match =65,arr.t \{ item.t equ data_int \} match =66,arr.t \{ item.t equ data_str \} match =67,arr.t \{ item.t equ data_data \} match =71,arr.t \{ item.t equ data_real \} } macro Point@Work Name { macro Name ClassName,Self,Parent,Link,_EID,PID \{ macro Link data,_dt,_exit \\{ \\local ..end,exit,data.type,EID EID equ if _exit eq exit = ..end else exit = _exit end if data.type equ _dt \\match any,_EID \\\{ stdcall __trace,data,data.type,_EID,PID,1 \\\} } macro Point@Var Name,res.type { macro Name ClassName,Self,Parent,Link,EID,PID \{ macro Link result,result.type,data,_dt,_exit \\{ \\local ..end,exit,data.type if _exit eq exit = ..end else exit = _exit end if data.type equ _dt \\match any,res.type \\\{ result.type equ res.type \\\} \\match any,EID \\\{ stdcall __trace,data,data.type,EID,PID,3 \\\} } macro DPoint@Work Name { macro Name ClassName,Self,Parent,Index,Link,_EID,PID \{ macro Link data,_dt,_exit \\{ \\local ..end,exit,data.type,EID EID equ if _exit eq exit = ..end else exit = _exit end if data.type equ _dt \\match any,_EID \\\{ stdcall __trace,data,data.type,_EID,PID,1 \\\} } macro DPoint@Var Name,res.type { macro Name ClassName,Self,Parent,Index,Link,EID,PID \{ macro Link result,result.type,data,_dt,_exit \\{ \\local ..end,exit,data.type if _exit eq exit = ..end else exit = _exit end if data.type equ _dt \\match any,res.type \\\{ result.type equ res.type \\\} \\match any,EID \\\{ stdcall __trace,data,data.type,EID,PID,3 \\\} } macro DPoint@Event Name { macro Name ClassName,Self,Parent,Index \{ macro Self\#.CallEvents data,data.type,_exit \\{ \\local ..end,exit,EID EID equ if _exit eq exit = ..end else exit = _exit end if if Index > 1 Self\#.CallEvents data,data.type,_exit end if } macro DPoint@Data Name { macro Name ClassName,Self,Parent,Index \{ macro Self\#.CallData result,result.type,data,data.type,_exit \\{ \\local ..end,exit,EID EID equ if _exit eq exit = ..end else exit = _exit end if if Index > 1 Self\#.CallData result,result.type,data,data.type,_exit end if } macro Proc@PointWork Name { proc Name#.proc_null Name#.Proc 0,data_null ret endp proc Name#.proc_int val Name#.Proc [val],data_int ret endp proc Name#.proc_str val Name#.Proc [val],data_str ret endp proc Name#.proc_data val Name#.Proc [val],data_data ret endp proc Name#.proc_real Name#.Proc 1,data_real_st0 ret endp proc Name#.proc_bitmap val Name#.Proc [val],data_bitmap ret endp } macro Call@PointWork Name,data,data.type { match =0,data.type \{ stdcall Name#.proc_null \} match =1,data.type \{ stdcall Name#.proc_int,data \} match =2,data.type \{ stdcall Name#.proc_str,data \} match =3,data.type \{ stdcall Name#.proc_data,data \} match =7,data.type \{ fmov_ex 1,data stdcall Name#.proc_real \} match =60,data.type \{ stdcall Name#.proc_real \} match =11,data.type \{ stdcall Name#.proc_bitmap,data \} } macro Proc@PointVar Name { local d0,r0,rt0,d1,r1,rt1,d2,r2,rt2,d3,r3,rt3,d7,r7,rt7,d11,r11,rt11 proc Name#.proc_null Name#.Proc r0,rt0,0,data_null ToData d0,r0,rt0 mov_ex eax,d0 ret endp proc Name#.proc_int val Name#.Proc r1,rt1,[val],data_int ToData d1,r1,rt1 mov_ex eax,d1 ret endp proc Name#.proc_str val Name#.Proc r2,rt2,[val],data_str ToData d2,r2,rt2 mov_ex eax,d2 ret endp proc Name#.proc_data val Name#.Proc r3,rt3,[val],data_data ToData d3,r3,rt3 mov_ex eax,d3 ret endp proc Name#.proc_real Name#.Proc r7,rt7,1,data_real_st0 ToData d7,r7,rt7 mov_ex eax,d7 ret endp proc Name#.proc_bitmap val Name#.Proc r11,rt11,[val],data_bitmap ToData d11,r11,rt11 mov_ex eax,d11 ret endp } macro Call@PointVar Name,result,result.type,data,data.type { match =0,data.type \{ stdcall Name#.proc_null \} match =1,data.type \{ stdcall Name#.proc_int,data \} match =2,data.type \{ stdcall Name#.proc_str,data \} match =3,data.type \{ stdcall Name#.proc_data,data \} match =7,data.type \{ fmov_ex 1,data stdcall Name#.proc_real \} match =60,data.type \{ stdcall Name#.proc_real \} match =11,data.type \{ stdcall Name#.proc_bitmap,data \} result equ eax result.type equ data_data } macro DataSave data,data.type,saveto,saved.type { local std std equ 1 saved.type equ data.type match =2,data.type \{ mov_ex eax,data lea edx,saveto call __strdupnoclear restore std \} match =3,data.type \{ mov_ex eax,data lea edx,saveto call __datadupnoclear restore std \} match =7,data.type \{ ; ToDo restore std \} match =1,std \{ mov_ex saveto,data \} } macro DataClear saved,saved.type { match =2,saved.type \{ lea edx,saved call __strclear \} match =3,saved.type \{ lea edx,saved call __dataclear \} match =7,saved.type \{ ; ToDo \} } macro mov_ex dest,src { local nomem1,nomem2 nomem1 equ 1 nomem2 equ 1 if ~ src eq dest match =[ any, src \{ restore nomem1 \} match =[ any, dest \{ restore nomem2 \} match =dword [ any, src \{ restore nomem1 \} match =dword [ any, dest \{ restore nomem2 \} if nomem1 eq 1 | nomem2 eq 1 mov dest,src else push src pop dest end if end if } macro fmov_ex dest,src { if ~ src eq dest if src eq 0 if dest eq 1 fldz else xor eax,eax mov dword [dest],eax mov dword [dest+4],eax end if else if src eq 1 if ~ dest eq 1 fst qword [dest] end if else if dest eq 1 fld qword [src] else mov eax,dword [src] mov dword [dest],eax mov eax,dword [src+4] mov dword [dest+4],eax end if end if end if } macro ToInteger res,data,data.type { local nomem nomem equ 1 match =0,data.type \{ res equ 0 \} match =1,data.type \{ res equ data \} match =2,data.type \{ mov_ex eax,data stdcall StrToInt,eax,10 res equ eax \} match =3,data.type \{ stdcall DataToInt,data res equ eax \} match =7,data.type \{ match =[ any, data \\{ fld qword data restore nomem \\} match =1, nomem \\{ if ~ data eq 1 fld qword [data] end if \\} sub esp,4 fistp dword [esp] fwait pop eax res equ eax \} match =60,data.type \{ sub esp,4 fistp dword [esp] fwait pop eax res equ eax \} } macro ToString res,data,data.type { local nomem nomem equ 1 match =0,data.type \{ res equ empty_string \} match =1,data.type \{ mov_ex eax,data stdcall IntToStr,eax,__rtl_temp_str,10 res equ eax \} match =2,data.type \{ res equ data \} match =3,data.type \{ mov_ex eax,data stdcall DataToStr,eax,__rtl_temp_str res equ eax \} match =7,data.type \{ match =[ any, data \\{ fld qword data restore nomem \\} match =1, nomem \\{ if ~ data eq 1 fld qword [data] end if \\} stdcall RealToStr,__rtl_temp_str res equ eax \} match =60,data.type \{ stdcall RealToStr,__rtl_temp_str res equ eax \} } macro ToData res,data,data.type { match =0,data.type \{ mov eax,empty_data res equ eax \} match =1,data.type \{ mov_ex eax,data stdcall IntToData,eax,__rtl_temp_data res equ eax \} match =2,data.type \{ mov_ex eax,data stdcall StrToData,eax,__rtl_temp_data res equ eax \} match =3,data.type \{ res equ data \} match =7,data.type \{ mov_ex eax,data stdcall RealToData,eax,__rtl_temp_data res equ eax \} match =60,data.type \{ stdcall RealToData,1,__rtl_temp_data res equ eax \} } macro ToReal res,data,data.type { match =0,data.type \{ res equ empty_real \} match =1,data.type \{ if data eqtype 0 | data eqtype eax mov dword [esp-4],data fild dword [esp-4] else fild dword data end if res equ 1 \} match =2,data.type \{ stdcall StrToReal,data res equ 1 \} match =3,data.type \{ stdcall DataToReal,data res equ 1 \} match =7,data.type \{ res equ data \} match =60,data.type \{ res equ 1 \} } macro ToStream res,data,data.type { local nostream nostream equ 1 match =10,data.type \{ restore nostream res equ data \} match =1,nostream \{ res equ 0 \} } macro ToBitmap res,data,data.type { local nobitmap nobitmap equ 1 match =11,data.type \{ restore nobitmap res equ data \} match =1,nobitmap \{ res equ 0 \} } macro ReadInt res,data,data.type,point,prop { local notused,nodata,nozprop notused equ 1 nodata equ 1 nozprop equ 1 match =1,point#.use \{ local r,rt point r,rt,data,data.type ToInteger res,r,rt restore notused \} match =1,notused \{ res equ prop match =0,prop \\{ restore res restore nozprop ToInteger res,data,data.type match =3,data.type \\\{ if ~ data eq eax mov ecx,data or ecx,ecx jz @f mov ecx,[ecx+4] mov data,ecx end if @@: restore nodata \\\} match =1,nodata \\\{ restore data.type data.type equ data_null \\\} \\} match =1,nozprop \\{ match =2,prop#.type \\\{ restore res stdcall StrToInt,prop,10 res equ eax \\\} match =7,prop#.type \\\{ restore res res equ prop#.AsInt \\\} \\} \} } macro ReadStr res,data,data.type,point,prop { local notused,nodata,nozprop notused equ 1 nodata equ 1 nozprop equ 1 match =1,point#.use \{ local r,rt point r,rt,data,data.type ToString res,r,rt restore notused \} match =1,notused \{ res equ prop match =0,prop \\{ restore res restore nozprop ToString res,data,data.type match =3,data.type \\\{ if ~ data eq eax mov ecx,data or ecx,ecx jz @f mov ecx,[ecx+4] mov data,ecx end if @@: restore nodata \\\} match =1,nodata \\\{ restore data.type data.type equ data_null \\\} \\} match =1,nozprop \\{ match =1,prop#.type \\\{ restore res stdcall IntToStr,prop,__rtl_temp_str,10 res equ eax \\\} match =7,prop#.type \\\{ restore res fld qword [prop] stdcall RealToStr,__rtl_temp_str res equ eax \\\} \\} \} } macro ReadData res,res.type,data,data.type,point,prop { local notused,nodata notused equ 1 nodata equ 1 match =1,point#.use \{ point res,res.type,data,data.type restore notused \} match =1,notused \{ res equ prop res.type equ prop#.type match =0,prop \\{ restore res,res.type res equ data res.type equ data.type match =3,data.type \\\{ if ~ data eq eax mov ecx,data or ecx,ecx jz @f mov ecx,[ecx+4] mov data,ecx end if @@: restore nodata \\\} match =1,nodata \\\{ restore data.type data.type equ data_null \\\} \\} \} } macro ReadReal res,data,data.type,point,prop { local notused,nodata,nozprop notused equ 1 nodata equ 1 nozprop equ 1 match =1,point#.use \{ local r,rt point r,rt,data,data.type ToReal res,r,rt restore notused \} match =1,notused \{ res equ prop match =0,prop \\{ restore res restore nozprop ToReal res,data,data.type match =3,data.type \\\{ if ~ data eq eax mov ecx,data or ecx,ecx jz @f mov ecx,[ecx+4] mov data,ecx end if @@: restore nodata \\\} match =1,nodata \\\{ restore data.type data.type equ data_null \\\} \\} match =1,nozprop \\{ match =1,prop#.type \\\{ restore res push prop fild dword [esp] fwait add esp,4 res equ 1 \\\} match =2,prop#.type \\\{ restore res stdcall StrToReal,prop res equ 1 \\\} match =7,prop#.type \\\{ restore res fld qword [prop] res equ 1 \\\} \\} \} } macro ReadStream res,data,data.type,point,prop { local notused,nodata notused equ 1 nodata equ 1 match =1,point#.use \{ local r,rt point r,rt,data,data.type ToStream res,r,rt restore notused \} match =1,notused \{ res equ prop match =0,prop \\{ restore res ToStream res,data,data.type match =3,data.type \\\{ if ~ data eq eax mov ecx,data or ecx,ecx jz @f mov ecx,[ecx+4] mov data,ecx end if @@: restore nodata \\\} match =1,nodata \\\{ restore data.type data.type equ data_null \\\} \\} \} } macro ReadBitmap res,data,data.type,point,prop { local notused,nodata notused equ 1 nodata equ 1 match =1,point#.use \{ local r,rt point r,rt,data,data.type ToBitmap res,r,rt restore notused \} match =1,notused \{ res equ prop match =0,prop \\{ restore res ToBitmap res,data,data.type match =3,data.type \\\{ if ~ data eq eax mov ecx,data or ecx,ecx jz @f mov ecx,[ecx+4] mov data,ecx end if @@: restore nodata \\\} match =1,nodata \\\{ restore data.type data.type equ data_null \\\} \\} \} } macro _align bound { rb (bound-1)-(($-$$+bound-1) mod bound) } macro StrConst label,value { if used label _align 4 dd -1,label#.size label db value,0 label#.size = $-label-1 _align 4 end if } macro PCharConst label,value { if used label label db value,0 end if } macro implements_IArray obj { _align 4 obj#.IArray: dd obj#.IArray.Set dd obj#.IArray.Get dd obj#.IArray.Count dd obj#.IArray.Add } interface IArray,Set,Get,Count,Add macro implements_IStream obj { _align 4 obj#.IStream: dd obj#.IStream.Seek dd obj#.IStream.GetSize dd obj#.IStream.SetSize dd obj#.IStream.Read dd obj#.IStream.Write dd obj#.IStream.Close } interface IStream,Seek,GetSize,SetSize,Read,Write,Close macro Element cname { macro cname#.GlobalConst ClassName \{ \} macro cname#.GlobalProc ClassName \{ p#cname#.prop.Mode = 0 macro p#cname#.ChildVars \\{ \\} virtual at esi cname#.Vars cname,p#cname,nil end virtual \} macro cname#.GlobalVars ClassName \{ _align 4 \} macro cname#.GlobalInit ClassName \{ \} macro cname#.GlobalDone ClassName \{ \} macro cname#.LocalConst ClassName,Self,Parent \{ \} macro cname#.LocalProc ClassName,Self,Parent \{ \} macro cname#.Vars ClassName,Self,Parent \{ _align 4 Self\#.context = context if dynamic>0 Self\#.offset = $-$$ else Self\#.offset = 0 end if \} macro cname#.Create ClassName,Self,Parent \{ \} macro cname#.PostInit ClassName,Self,Parent \{ \} macro cname#.Destroy ClassName,Self,Parent \{ \} macro cname#.Events ClassName,Self,Parent \{ \} macro cname#.MessageMap ClassName,Self,Parent \{ \} macro mGlobalConst \{ macro cname#.GlobalConst ClassName \\{ cname#.GlobalConst ClassName \} macro mGlobalProc \{ macro cname#.GlobalProc ClassName \\{ cname#.GlobalProc ClassName \} macro mGlobalVars \{ macro cname#.GlobalVars ClassName \\{ cname#.GlobalVars ClassName \} macro mGlobalInit \{ macro cname#.GlobalInit ClassName \\{ cname#.GlobalInit ClassName \} macro mGlobalDone \{ macro cname#.GlobalDone ClassName \\{ cname#.GlobalDone ClassName \} macro mLocalConst \{ macro cname#.LocalConst ClassName,Self,Parent \\{ cname#.LocalConst ClassName,Self,Parent \} macro mLocalProc \{ macro cname#.LocalProc ClassName,Self,Parent \\{ cname#.LocalProc ClassName,Self,Parent \} macro mVars \{ macro cname#.Vars ClassName,Self,Parent \\{ cname#.Vars ClassName,Self,Parent \} macro mCreate \{ macro cname#.Create ClassName,Self,Parent \\{ cname#.Create ClassName,Self,Parent \} macro mPostInit \{ macro cname#.PostInit ClassName,Self,Parent \\{ cname#.PostInit ClassName,Self,Parent \} macro mDestroy \{ macro cname#.Destroy ClassName,Self,Parent \\{ cname#.Destroy ClassName,Self,Parent \} macro mEvents \{ macro cname#.Events ClassName,Self,Parent \\{ cname#.Events ClassName,Self,Parent \} macro mMessageMap \{ macro cname#.MessageMap Self,Parent \\{ cname#.MessageMap Self,Parent \} macro mPointWork Name \{ Point@Work cname#.\#Name \} macro mPointVar Name,res.type \{ Point@Var cname#.\#Name,res.type \} macro mDPointWork Name \{ DPoint@Work cname#.\#Name \} macro mDPointVar Name,res.type \{ DPoint@Var cname#.\#Name,res.type \} macro mDPointEvent Name \{ DPoint@Event cname#.\#Name \} macro mDPointData Name \{ DPoint@Data cname#.\#Name \} macro Dummy \{ } macro mBaseElements { macro Element cls \{ macro Dummy \\{ \} macro mEndElement \{ \} } macro EndBase { purge Element,mEndElement macro Dummy \{ } macro mEndElement { purge mGlobalConst,mGlobalProc,mGlobalVars,mGlobalInit,mGlobalDone, \ mLocalConst,mLocalProc,mVars,mCreate,mPostInit,mDestroy,mEvents,mMessageMap, \ mPointWork,mPointVar,mDPointWork,mDPointVar,mDPointEvent,mDPointData } GlobalConst fix } mGlobalConst GlobalProc fix } mGlobalProc GlobalVars fix } mGlobalVars GlobalInit fix } mGlobalInit GlobalDone fix } mGlobalDone LocalConst fix } mLocalConst LocalProc fix } mLocalProc Vars fix } mVars Create fix } mCreate PostInit fix } mPostInit Destroy fix } mDestroy Events fix } mEvents MessageMap fix } mMessageMap PointWork fix } mPointWork PointVar fix } mPointVar DPointWork fix } mDPointWork DPointVar fix } mDPointVar DPointEvent fix } mDPointEvent DPointData fix } mDPointData EndPoint fix ..end: \match any,EID \\{ stdcall __trace,result,result.type,EID,PID,3 \\} \} End@Point fix ..end: \\match any,EID \\\{ stdcall __trace,result,result.type,EID,PID,3 \\\} \\} \} BaseElements fix } mBaseElements EndElement fix } mEndElement virtual at edx pOFN OPENFILENAME end virtual struct BMPHEADER fh BITMAPFILEHEADER bi BITMAPINFOHEADER ends struct GRNAMESTRUCT flags dd ? hFile dd ? fullName rb 256 filePos dd ? Unknown dd ? ends struct GRPICTINFO hMF dd ? rc RECT inch dd ? ends struct METAFILEPICT mm dd ? xExt dd ? yExt dd ? hMF dd ? ends FIONREAD equ 4004667Fh struct EVENTBUF cmd dd ? ptid dd ? type dd ? data db 128 dup(?) ends struct TIMEVAL tv_sec dd ? tv_usec dd ? ends __resource_file equ 'allres.res' macro DEFINE_GUID lbl,dw1,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8 { if used lbl _align 4 label lbl dd dw1 dw w1,w2 db b1,b2,b3,b4,b5,b6,b7,b8 end if } interface IUnknown,QueryInterface,AddRef,Release macro hiAsm.Const { context = 0 dynamic = 0 nextid = 0 PCharConst button_class,'BUTTON' PCharConst edit_class,'EDIT' PCharConst static_class,'STATIC' PCharConst listbox_class,'LISTBOX' PCharConst combobox_class,'COMBOBOX' PCharConst scrollbar_class,'SCROLLBAR' PCharConst window_class,'TWindow' PCharConst splitter_class,'TSplitter' StrConst empty_string,'' if used FontDPI FontDPI dd -72 end if if used empty_real empty_real dq 0 end if if used empty_data empty_data dd -1,0,0 end if if used __rtl_temp_str __rtl_temp_str dd 0 end if if used __rtl_temp_data __rtl_temp_data dd 0 end if if used math.anglemode math.anglemode dq 1.0 end if if used __trace __trace_on db 0 __dbg_svr_sockaddr sockaddr_in AF_INET,__dbg_svr_port,100007Fh __dbg_cli_sockaddr sockaddr_in AF_INET,__dbg_cli_port,100007Fh end if if used splitter_class Splitter.pattern dw 55h,0AAh,55h,0AAh,55h,0AAh,55h,0AAh end if DEFINE_GUID IID_IUnknown, 0, 0, 0, 0C0h, 0, 0, 0, 0, 0, 0, 46h } macro hiAsm.Vars { _align 4 hinstance dd ? pheap dd ? ScreenDPIy dd ? hoverhwnd dd ? __rtl_temp_rect RECT if used __trace __wsaData WSADATA __debug_sock dd ? __debug_timer dd ? end if if used splitter_class Splitter.brush dd ? Splitter.startPos dd ? Splitter.curPos dd ? Splitter.size.x dd ? Splitter.size.y dd ? end if } macro hiAsm.Init { invoke GetModuleHandle,0 mov [hinstance],eax invoke GetProcessHeap mov [pheap],eax invoke GetDC,0 push eax invoke GetDeviceCaps,eax,90 ;LOGPIXELSY mov [ScreenDPIy],eax invoke ReleaseDC,0 if CoInitialize.use eq 1 invoke CoInitializeEx,0,2 end if if defined StyleXP.ICC invoke InitCommonControlsEx,StyleXP.ICC end if if used __trace invoke WSAStartup,101h,__wsaData invoke socket,AF_INET,SOCK_DGRAM,17 mov [__debug_sock],eax invoke bind,eax,__dbg_svr_sockaddr,sizeof.sockaddr_in xor eax,eax mov [__debug_timer],eax end if if used window_class push window_class push 0 push COLOR_BTNFACE+1 invoke LoadCursor,0,IDC_ARROW push eax push 0 push [hinstance] push 0 push 0 push Window.WindowProc push CS_DBLCLKS+CS_HREDRAW+CS_VREDRAW invoke RegisterClass,esp add esp,40 end if if used splitter_class push splitter_class push 0 push 0 push 0 push 0 push [hinstance] push 0 push 0 push Splitter.WindowProc push CS_DBLCLKS+CS_HREDRAW+CS_VREDRAW invoke RegisterClass,esp add esp,40 invoke CreateBitmap,8,8,1,1,Splitter.pattern invoke CreatePatternBrush,eax mov [Splitter.brush],eax end if } macro hiAsm.Done { if used __trace invoke closesocket,[__debug_sock] invoke WSACleanup end if if CoInitializeEx.use eq 1 invoke CoUninitialize end if } macro Jcond Cond,Lab { if Cond = 0 je Lab else if Cond = 1 jl Lab else if Cond = 2 jg Lab else if Cond = 3 jle Lab else if Cond = 4 jge Lab else if Cond = 5 jne Lab end if } macro Jcond2 Cond,Lab { ; unsigned if Cond = 0 je Lab else if Cond = 1 jb Lab else if Cond = 2 ja Lab else if Cond = 3 jbe Lab else if Cond = 4 jae Lab else if Cond = 5 jne Lab end if } macro Icond Cond,A1,A2 { if Cond = 0 & A1=A2 Cond = 6 else if Cond = 1 & A1A2 Cond = 6 else if Cond = 3 & A1<=A2 Cond = 6 else if Cond = 4 & A1>=A2 Cond = 6 else if Cond = 5 & A1<>A2 Cond = 6 end if if Cond < 6 Cond = -1 end if } struct THIWin hwnd dd ? oldWP dd ? ctlWP dd ? hfont dd ? TextColor dd ? hbrush dd ? Color dd ? TabOrder dd ? Cursor dd ? Border dd ? Align dd ? ColorSp dd ? MinOwn dw ? MinRest dw ? MousePos dd ? HoverProc dd ? Aligning dd ? ends virtual at esi pControl THIWin end virtual macro THIWin.SaveMousePos { mov eax,[lparam] mov [pControl.MousePos],eax } macro OnMessage _msg,Self,event,data,data.type,_exit,before { local cmd,ok,next,exit if _exit eq exit = Self#.exit else exit = _exit end if if Self#.#event#.use eq 1 irp msg,_msg \{ cmp [wmsg],msg je ok \} jmp next ok: if ~ before eq before end if Self#.#event data,data.type,exit jmp exit next: end if } macro Event Self,event,notifycode { local next if Self#.#event#.use eq 1 if notifycode eq cmp [wparam],Self#.id else cmp [wparam],notifycode shl 16 + Self#.id end if jne next macro EndEvent \{ next: end if purge EndEvent \} } macro GetParentData reg,Self,Parent,field { local flag flag equ 1 match =0,Parent \{ xor reg,reg restore flag \} match =1,flag \{ if Self\#.offset>0 & Parent\#.offset>0 & Self\#.context<>Parent\#.context mov reg,[ebx+4] mov reg,[reg+(Parent\#.\#field-Parent)+Parent\#.offset] else mov reg,[Parent\#.\#field] end if \} } macro OPENFILENAME.Init Self,Flags { xor eax,eax lea edx,[Self#.OFN] mov ecx,sizeof.OPENFILENAME call __memset mov [Self#.OFN.lStructSize],sizeof.OPENFILENAME mov eax,[hinstance] mov [Self#.OFN.hInstance],eax mov [Self#.OFN.lpstrFilter],Self#.prop.Filter mov [Self#.OFN.lpstrTitle],Self#.prop.Title mov [Self#.OFN.nMaxFile],512 mov [Self#.OFN.Flags],Flags } macro OPENFILENAME.Clear Self { lea edx,[Self#.OFN.lpstrFile] call __strclear lea edx,[Self#.OFN.lpstrInitialDir] call __strclear }