News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

ResEd info

Started by jcfuller, December 27, 2016, 10:03:37 PM

Previous topic - Next topic

jcfuller

I've been doing some work using ResEd lately.
One of the Menu->Project items is "Save As RadAsm dlg file".
Does anyone know the format of this dlg file or where I might get this information?

Thanks,
  James

ragdog

Hello

You can look on Radasm 2 source code i think this is this structur


DIALOG struct
hwnd dd ? ;Set to TRUE
hdmy dd ? ;Transparent dummy window
oldproc dd ? ;Set to NULL
hpar dd ? ;Set to NULL
hcld dd ? ;Set to NULL
style dd ? ;Set to desired style
exstyle dd ? ;Set to desired ex style
x dd ? ;X position in pixels
y dd ? ;Y position in pixels
ccx dd ? ;Width in pixels
ccy dd ? ;Height in pixels
caption db MaxCap dup(?) ;Caption max 240+1 char
ntype dd ? ;Follows ToolBox buttons Dialog=0, Edit=1, Static=2, GroupBox=3
ntypeid dd ? ;Set to NULL
tab dd ? ;Tab index, Dialog=0, First index=0
id dd ? ;Dialog / Controls ID
idname db 32 dup(?) ;ID Name, max 31 chars
undo dd ? ;Set to NULL
himg dd ? ;Set to NULL
class db 32 dup(?) ;Class fur UDC
DIALOG ends

jcfuller

Thanks ragdog but I don't think(?) that's it. Either the function in ResEd is not working correctly or it's something else.
This is the ResEd rc file and attached is the dlg file.
James


#define IDM_FILE 10001
#define IDM_HELP 10003
#define IDD_DLG1 1000
#define IDC_STC20 1001
#define IDC_INDEX 1002
#define IDC_STC21 1003
#define IDC_COMPANY 1004
#define IDC_STC22 1005
#define IDC_LASTNAME 1006
#define IDC_STC23 1007
#define IDC_FIRSTNAME 1008
#define IDC_STC24 1009
#define IDC_ADDRESS1 1010
#define IDC_ADDRESS2 1011
#define IDC_ADDRESS3 1012
#define IDC_STC25 1013
#define IDC_CITYNAME 1014
#define IDC_STC26 1015
#define IDC_STATENAME 1016
#define IDC_STC27 1017
#define IDC_ZIPCODE 1018
#define IDC_STC28 1019
#define IDC_COUNTRY 1020
#define IDC_STC29 1021
#define IDC_PHONE 1022
#define IDC_STC30 1023
#define IDC_FAX 1024
#define IDC_STC31 1025
#define IDC_EMAIL 1026
#define IDC_STC32 1027
#define IDC_URL 1028
#define IDC_STC33 1038
#define IDC_COMMENTS 1029
#define IDC_PRIOR 1030
#define IDC_NEXT 1031
#define IDC_FIND 1032
#define IDC_ADD 1033
#define IDC_UPDATE 1034
#define IDC_DELETE 1035
#define IDC_PRINT 1036
#ifndef IDCANCEL
  #define IDCANCEL 2
#endif
#define IDC_SBR1 1037

IDD_DLG1 DIALOGEX 10,10,399,270
CAPTION "Address Book"
FONT 10,"Tahoma",400,0,0
STYLE 0x90CA0800
BEGIN
  CONTROL "Record No.",IDC_STC20,"Static",0x50000202,303,5,60,8
  CONTROL "0 / 0",IDC_INDEX,"Static",0x50001201,366,4,25,10
  CONTROL "Company",IDC_STC21,"Static",0x50000202,5,19,60,8
  CONTROL "",IDC_COMPANY,"Edit",0x50010000,68,17,323,12,0x00000200
  CONTROL "Last Name",IDC_STC22,"Static",0x50000202,5,33,60,8
  CONTROL "",IDC_LASTNAME,"Edit",0x50010000,68,31,139,11,0x00000200
  CONTROL "First",IDC_STC23,"Static",0x50000202,219,33,18,8
  CONTROL "",IDC_FIRSTNAME,"Edit",0x50010000,241,31,150,12,0x00000200
  CONTROL "Address",IDC_STC24,"Static",0x50000202,5,48,60,8
  CONTROL "",IDC_ADDRESS1,"Edit",0x50010000,68,46,323,12,0x00000200
  CONTROL "",IDC_ADDRESS2,"Edit",0x50010000,68,61,323,12,0x00000200
  CONTROL "",IDC_ADDRESS3,"Edit",0x50010000,68,76,323,12,0x00000200
  CONTROL "City",IDC_STC25,"Static",0x50000202,5,93,60,8
  CONTROL "",IDC_CITYNAME,"Edit",0x50010000,68,91,116,12,0x00000200
  CONTROL "State/Province",IDC_STC26,"Static",0x50000202,188,93,50,8
  CONTROL "",IDC_STATENAME,"Edit",0x50010000,241,91,45,12,0x00000200
  CONTROL "Zip or Postal Code",IDC_STC27,"Static",0x50000202,5,109,60,8
  CONTROL "",IDC_ZIPCODE,"Edit",0x50010000,68,107,40,12,0x00000200
  CONTROL "Country",IDC_STC28,"Static",0x50000202,126,109,25,8
  CONTROL "",IDC_COUNTRY,"ComboBox",0x50210103,156,107,129,100
  CONTROL "Phone",IDC_STC29,"Static",0x50000202,5,127,60,8
  CONTROL "",IDC_PHONE,"Edit",0x50010000,68,125,150,12,0x00000200
  CONTROL "Fax",IDC_STC30,"Static",0x50000202,219,127,18,8
  CONTROL "",IDC_FAX,"Edit",0x50010000,241,125,150,12,0x00000200
  CONTROL "Email",IDC_STC31,"Static",0x50000202,5,144,60,8
  CONTROL "",IDC_EMAIL,"Edit",0x50010000,68,142,150,12,0x00000200
  CONTROL "www",IDC_STC32,"Static",0x50000202,219,144,18,8
  CONTROL "",IDC_URL,"Edit",0x50010000,241,142,150,12,0x00000200
  CONTROL "Comments",IDC_STC33,"Static",0x50000202,5,160,60,8
  CONTROL "",IDC_COMMENTS,"Edit",0x503110C4,68,158,323,65,0x00000200
  CONTROL "<<  Prior",IDC_PRIOR,"Button",0x50010000,10,233,40,14
  CONTROL "Next  >>",IDC_NEXT,"Button",0x50010000,55,233,40,14
  CONTROL "Find",IDC_FIND,"Button",0x50010000,105,233,40,14
  CONTROL "Add",IDC_ADD,"Button",0x50010000,155,233,40,14
  CONTROL "Update",IDC_UPDATE,"Button",0x50010000,200,233,40,14
  CONTROL "Delete",IDC_DELETE,"Button",0x50010000,245,233,40,14
  CONTROL "Print",IDC_PRINT,"Button",0x50010000,295,233,40,14
  CONTROL "Close",IDCANCEL,"Button",0x50010000,345,233,40,14
  CONTROL "",IDC_SBR1,"msctls_statusbar32",0x56000003,3,249,24,9
END



jcfuller


I dug around and found The RadAsm 2 help file where it lists the format. It starts with a header.

James


HSE

In RaResEd.asm:
.elseif eax==DEM_EXPORTDLG
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
push esi
push edi
mov esi,eax
invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,256*1024
mov edi,eax
push eax
mov [edi].RADLGHEAD.ver,101
mov [edi].RADLGHEAD.changed,FALSE
invoke strcpy,addr [edi].RADLGHEAD.class,addr [esi].DLGHEAD.class
invoke strcpy,addr [edi].RADLGHEAD.menuid,addr [esi].DLGHEAD.menuid
invoke strcpy,addr [edi].RADLGHEAD.font,addr [esi].DLGHEAD.font
mov eax,[esi].DLGHEAD.fontsize
mov [edi].RADLGHEAD.fontsize,eax
mov eax,[esi].DLGHEAD.fontht
mov [edi].RADLGHEAD.fontht,eax
mov [edi].RADLGHEAD.undo,FALSE
mov eax,[esi].DLGHEAD.ctlid
mov [edi].RADLGHEAD.ctlid,eax
mov [edi].RADLGHEAD.hmnu,NULL
mov [edi].RADLGHEAD.htlb,NULL
mov [edi].RADLGHEAD.hstb,NULL
mov [edi].RADLGHEAD.locked,FALSE
mov [edi].RADLGHEAD.hfont,NULL
mov [edi].RADLGHEAD.charset,0
mov [edi].RADLGHEAD.italic,FALSE
mov [edi].RADLGHEAD.weight,0
add esi,sizeof DLGHEAD
add edi,sizeof RADLGHEAD
.while [esi].DIALOG.hwnd
.if [esi].DIALOG.hwnd!=-1
mov [edi].RADIALOG.hwnd,1
mov [edi].RADIALOG.hdmy,NULL
mov [edi].RADIALOG.oldproc,NULL
mov [edi].RADIALOG.hpar,NULL
mov [edi].RADIALOG.hcld,NULL
mov eax,[esi].DIALOG.style
mov [edi].RADIALOG.style,eax
mov eax,[esi].DIALOG.exstyle
mov [edi].RADIALOG.exstyle,eax
mov eax,[esi].DIALOG.x
mov [edi].RADIALOG.x,eax
mov eax,[esi].DIALOG.y
mov [edi].RADIALOG.y,eax
mov eax,[esi].DIALOG.ccx
mov [edi].RADIALOG.ccx,eax
mov eax,[esi].DIALOG.ccy
mov [edi].RADIALOG.ccy,eax
.if [esi].DIALOG.ntype==23
invoke strcpyn,addr [edi].RADIALOG.caption,addr [esi].DIALOG.class,32
.else
invoke strcpyn,addr [edi].RADIALOG.caption,addr [esi].DIALOG.caption,RAMaxCap
.endif
mov eax,[esi].DIALOG.ntype
mov [edi].RADIALOG.ntype,eax
mov eax,[esi].DIALOG.ntypeid
mov [edi].RADIALOG.ntypeid,eax
mov eax,[esi].DIALOG.tab
mov [edi].RADIALOG.tab,eax
mov eax,[esi].DIALOG.id
mov [edi].RADIALOG.id,eax
invoke strcpyn,addr [edi].RADIALOG.idname,addr [esi].DIALOG.idname,32
mov [edi].RADIALOG.undo,NULL
mov [edi].RADIALOG.himg,NULL
add edi,sizeof RADIALOG
.endif
add esi,sizeof DIALOG
.endw
pop eax
push eax
sub edi,eax
push edi
mov edi,eax
invoke CreateFile,lParam,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
mov hFile,eax
pop edx
invoke WriteFile,hFile,edi,edx,addr dwbytes,NULL
invoke CloseHandle,hFile
pop eax
invoke GlobalFree,eax
pop edi
pop esi
.endif
xor eax,eax
jmp Ex
Equations in Assembly: SmplMath

jcfuller

Thank you gentlemen.
  I am now able to parse a dlg file.

James