flat assembler
Message board for the users of flat assembler.

flat assembler > Main > Sorry. But i not found examples how using FEDIT.DLL

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 476
I want use only FEDIT.DLL in my window program, witch highlighting text.
I not need compile code to asm. A mean whithout FASM.dll
Only for text.

Interesting simple sample how use FEDIT.DLL.
And where is get last version FEDIT.DLL ?
Post 21 Jul 2018, 16:38
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7300
Location: Kraków, Poland
The FEDIT.DLL source is in the FASM.DLL package. This is simply a wrapper for the FEDIT control that comes with a standard FASMW package, so you just put FEDIT.ASM in the same directory as FASMW sources and it can be assembled then.

As for the examples, the example that comes with FASM.DLL does not use any syntax highlighting. But you could extract the syntax highlighting function from FASMW.ASM - I have done that and created the attached example.


Description: A quickly patched-up FEDIT example
Download
Filename: feditdemo.zip
Filesize: 14.61 KB
Downloaded: 157 Time(s)

Post 21 Jul 2018, 18:48
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 476
Cool ! Big thanks !
Post 21 Jul 2018, 18:59
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 476
Problem with change fonts. When i am set Broadway font in fasm edit window
chars draw not full and cursor bug with offset next char.

And how change font size ?
And how using FEM_SETRIGHTCLICKMENU ? Please explain in example.
Post 25 Jul 2018, 09:15
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7300
Location: Kraków, Poland
Roman wrote:
Problem with change fonts. When i am set Broadway font in fasm edit window
chars draw not full and cursor bug with offset next char.
The font needs to have a FIXED_PITCH attribute (meaning that it is a monospaced font). Look at the ChooseFont dialog used in FASMW - it has the CF_FIXEDPITCHONLY flag set.

Roman wrote:
And how change font size ?
You set the size up with the other parameters when preparing font with CreateFont.

Roman wrote:
And how using FEM_SETRIGHTCLICKMENU ? Please explain in example.
WPARAM should be the handle of menu (you usually load it from resource with LoadMenu) and LPARAM should be the handle of the window that needs to receive the WM_COMMAND messages from the menu.
Post 25 Jul 2018, 09:34
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 476
About:
FEM_SETPOS mean set text line ? If i have 100 text lines. And i want set carret to 80 line.
FEM_GETPOS
FEM_FINDFIRST
FEM_FINDNEXT
FEM_GETSEARCHTEXT its mean in my buffer copy find text ?

I right understood ?:
Code:
.data
 pString db 'Find word',0
.code
invoke SendMessage,[hwnd],FEM_FINDFIRST,0,pString ;whatch in eax return ?

invoke SendMessage,[hwnd],FEM_SETPOS,0,80 ;this crash
    
Post 21 Feb 2019, 18:02
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7300
Location: Kraków, Poland
FEM_GETPOS/FEM_SETPOS expect FEPOS structure passed through pointer in wparam:
Code:
struct FEPOS
  selectionPosition dd ?
  selectionLine     dd ?
  caretPosition     dd ?
  caretLine         dd ?
ends    

As for FEM_FINDFIRST/FEM_FINDNEXT, they return boolean value, telling whether text has been found or not. The selection and caret are automatically moved to the boundaries of found text.
Post 21 Feb 2019, 18:53
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 476
Problem. FEDIT window back on main window.
And I must press Alt+Tab to see FEDIT window.
When I click on main window FEDIT disappears and I must again press Alt+Tab to see FEDIT window.
How fix this ? "Edit" window work fine and not disappears
Code:
invoke  CreateWindowEx,WS_EX_LAYERED,_fedit,_title,\
WS_VISIBLE+WS_POPUP+WS_VSCROLL+WS_HSCROLL+ FES_CONSOLECARET+FES_AUTOINDENT+FES_OPTIMALFILL+FES_TIMESCROLL, \
                               128,128,512,512,NULL,NULL,[wc.hInstance],NULL
    


Last edited by Roman on 22 Feb 2019, 05:19; edited 1 time in total
Post 22 Feb 2019, 05:00
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 476
I fix.
WS_EX_LAYERED+WS_EX_TOPMOST
Now work fine.
Post 22 Feb 2019, 05:15
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7300
Location: Kraków, Poland
Unless you do something unusual, you should create FEDIT as a child of your main window:
Code:
invoke  CreateWindowEx,WS_EX_LAYERED,_fedit,_title,WS_CHILD+\
WS_VISIBLE+WS_POPUP+WS_VSCROLL+WS_HSCROLL+ FES_CONSOLECARET+FES_AUTOINDENT+FES_OPTIMALFILL+FES_TIMESCROLL, \
                               128,128,512,512,[main_hwnd],NULL,[wc.hInstance],NULL    
WS_EX_TOPMOST only makes sense for something like a floating toolbox.
Post 22 Feb 2019, 10:11
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 476
How get selected text from FEDIT ?
I know WM_COPY.

Is exist another way get selected text ?

And how work invoke SendMessage,[hwnd_fedit],FEM_GETWORDATCARET,2,TextBuffer ?
Post 25 Feb 2019, 08:36
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7300
Location: Kraków, Poland
Yes, to get the selected text exactly, WM_COPY is the only way. Alternatively you can use FEM_GETPOS to find the line numbers and then FEM_GETLINELENGTH/FEM_GETLINE to get contents of individual lines.

For FEM_GETWORDATCARET wparam is the length of the buffer and lparam points to the buffer. The buffer is filled with a single word that the cursor is currently at (for example F1 key in fasmw uses this function).
Post 25 Feb 2019, 09:44
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.