MCD
Joined: 21 Aug 2004
Posts: 602
Location: Germany
|
Okay, I finally got another stuff for FASMW now, which Privalov agreed to add earlier in a PM. Here it goes.
It will make FASMW append the full path of the currently selected file in the file tab control on the bottom to its program title. Thus you don't need to open the save as dialog each time you want to see where your file is actually located. An implementation description follows.
in "FASMW.ASM":
------------
Main window message handler
Old:
----
fmselect:
mov [ei.header.mask],TCIF_PARAM
invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei
invoke GetWindowLong,[hwnd_asmedit],GWL_STYLE
and eax,not WS_VISIBLE
invoke SetWindowLong,[hwnd_asmedit],GWL_STYLE,eax
mov ebx,[ei.hwnd]
mov [hwnd_asmedit],ebx
mov eax,WS_CHILD+WS_HSCROLL+WS_VSCROLL+ES_NOHIDESEL
or eax,[asmedit_style]
invoke SetWindowLong,ebx,GWL_STYLE,eax
invoke SendMessage,ebx,WM_SETFONT,[hfont],0
invoke SendMessage,ebx,AEM_SETTEXTCOLOR,[editor_colors],[editor_colors+4]
invoke SendMessage,ebx,AEM_SETSELCOLOR,[editor_colors+8],[editor_colors+12]
invoke SendMessage,ebx,AEM_SETSYNTAXHIGHLIGHT,asm_syntax_colors,fasm_syntax
invoke SendMessage,ebx,AEM_SETRIGHTCLICKMENU,[hmenu_edit],[hwnd]
invoke SendMessage,[hwnd],WM_SIZE,0,0
invoke ShowWindow,ebx,SW_SHOW
invoke UpdateWindow,ebx
invoke SetFocus,[hwnd]
jmp finish
New:
----
fmselect:
mov [ei.header.mask],TCIF_PARAM
invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei
invoke GetWindowLong,[hwnd_asmedit],GWL_STYLE
and eax,not WS_VISIBLE
invoke SetWindowLong,[hwnd_asmedit],GWL_STYLE,eax
mov ebx,[ei.hwnd]
mov [hwnd_asmedit],ebx
mov eax,WS_CHILD+WS_HSCROLL+WS_VSCROLL+ES_NOHIDESEL
or eax,[asmedit_style]
invoke SetWindowLong,ebx,GWL_STYLE,eax
mov esi,_caption ;start of new code
mov edi,string_buffer
push edi
copy_caption:
lodsb
stosb
or al,al
jnz copy_caption
mov esi,[ei.pszpath]
or esi,esi
jz caption_ok
dec edi
mov eax,' - '
stosd
dec edi
append_path_to_caption:
lodsb
stosb
or al,al
jnz append_path_to_caption
caption_ok:
invoke SetWindowText,[hwnd] ;last new instruction
invoke SendMessage,ebx,WM_SETFONT,[hfont],0
invoke SendMessage,ebx,AEM_SETTEXTCOLOR,[editor_colors],[editor_colors+4]
invoke SendMessage,ebx,AEM_SETSELCOLOR,[editor_colors+8],[editor_colors+12]
invoke SendMessage,ebx,AEM_SETSYNTAXHIGHLIGHT,asm_syntax_colors,fasm_syntax
invoke SendMessage,ebx,AEM_SETRIGHTCLICKMENU,[hmenu_edit],[hwnd]
invoke SendMessage,[hwnd],WM_SIZE,0,0
invoke ShowWindow,ebx,SW_SHOW
invoke UpdateWindow,ebx
invoke SetFocus,[hwnd]
jmp finish
a bit further down at save_file_as
Old:
----
mov [ei.header.pszText],name_buffer
mov [ei.header.mask],TCIF_TEXT+TCIF_PARAM
invoke SendMessage,[hwnd_tabctrl],TCM_SETITEM,ebx,ei
invoke SendMessage,[hwnd],FM_SAVE,ebx,0
New:
----
mov [ei.header.pszText],name_buffer
mov [ei.header.mask],TCIF_TEXT+TCIF_PARAM
invoke SendMessage,[hwnd_tabctrl],TCM_SETITEM,ebx,ei
invoke SendMessage,[hwnd_main],FM_SELECT,ebx,0
invoke SendMessage,[hwnd],FM_SAVE,ebx,0
Someone just say if he/she doesn't like it.
_________________ MCD - the inevitable return of the Mad Computer Doggy
-||__/
.|+-~
.|| ||
|