My programming is full of mud. All disorganized. just take a look at this .elseif ax==IDM_CLOSEPROJECT
.if ProjectFlag==FALSE
invoke MessageBox,hMainWindow,addr szNoProjectOpened,addr szAttention,MB_OK
.else
invoke MessageBox,hMainWindow,addr szKeepChanges,addr szAttention,MB_YESNO
.if eax==IDYES
invoke SaveFiles
.endif
mov ecx,noMdiChild
or ecx,ecx
jz dont_build
invoke CreateFile,addr szProjectBuffer,GENERIC_WRITE,\
FILE_SHARE_WRITE,0,CREATE_ALWAYS,\
FILE_ATTRIBUTE_NORMAL,0
mov hProject,eax
invoke BuildProjectFile,hMainWindow
invoke MessageBoxA,0,addr ProjectFileBuffer,0,MB_OK
invoke CountBytes2,addr ProjectFileBuffer
invoke WriteFile,hProject,addr ProjectFileBuffer,ecx,\
addr noBytesWritten,0
invoke CloseHandle,hProject
mov ecx,noMdiChild
or ecx,ecx
jz no_close
loop_32:
push ecx
invoke SendMessage,hMdi,WM_MDINEXT,0,TRUE
invoke SendMessage,hMdi,WM_MDIGETACTIVE,0,0
mov hCurrentWindow,eax
invoke GetWindowLong,eax,GWL_USERDATA
mov edi,eax
test [edi.MdiStruct].dwFlags,IDF_UNTITLED
jz skip_32
dec noUntitledChild
skip_32:
invoke LocalFree,[edi.MdiStruct].lpTextBuffer
invoke SendMessage,hMdi,WM_MDIDESTROY,hCurrentWindow,0
pop ecx
dec ecx
dec noMdiChild
cmp ecx,0
jne loop_32
no_close:
.if ProjectFlag==TRUE
invoke SetWindowText,hMainWindow,addr MainWindowName
invoke ClearMemory,addr ProjectFileBuffer,sizeof ProjectFileBuffer
invoke ClearMemory,addr MdiStructs,sizeof MdiStruct*20
mov ProjectFlag,FALSE
jmp _end
.endif
dont_build:
mov ProjectFlag,FALSE
.endif