flat assembler
Message board for the users of flat assembler.
Index
> Windows > [solved] I try paste text to fasm IDE But not work. |
Author |
|
bitRAKE 22 Jul 2023, 12:03
Did you try "FEDIT"? That is where "FASMW_IDE32" sends its WM_PASTE message. I don't think "FASMW_IDE32" processes the WM_PASTE message itself.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
22 Jul 2023, 12:03 |
|
Roman 22 Jul 2023, 12:04
FEDIT NOT FOUND.
IF I TRY FindWindow, "FEDIT", 0 I get eax=0 |
|||
22 Jul 2023, 12:04 |
|
bitRAKE 22 Jul 2023, 12:11
Hm, I think, send IDM_PASTE (to "FASMW_IDE32") and it will send the WM_PASTE message for you.
Code: IDM_PASTE = 1205 |
|||
22 Jul 2023, 12:11 |
|
Roman 22 Jul 2023, 12:21
I try
Invoke FindWindow, "FASMW_IDE32", 0 Invoke SendMessages, eax, IDM_PASTE, 0,0 I NOT SEE ANY TEXT IN FASMWIDE But if I pressed ctrl+v I get text from win clipboard in fasmw |
|||
22 Jul 2023, 12:21 |
|
bitRAKE 22 Jul 2023, 12:28
The IDE source code is not on github, so here is the code that does the paste:
Code: wm_paste: test [editor_mode],FEMODE_READONLY jnz ignore call make_undopoint cmp [was_selection],0 je paste_secureselection_ok test [editor_style],FES_SECURESEL jnz paste_secureselection_ok call delete_block paste_secureselection_ok: invoke OpenClipboard,NULL invoke GetClipboardData,CF_TEXT or eax,eax jnz do_paste invoke CloseClipboard jmp ignore do_paste: or [clipboard_opened],-1 push eax invoke GlobalLock,dword [esp] mov esi,eax call insert_block jc paste_failed pop ebx invoke GlobalUnlock,ebx invoke CloseClipboard mov [clipboard_opened],0 test [editor_style],FES_SECURESEL jz no_selection_after_paste mov eax,[caret_line] mov ecx,[caret_line_number] mov edx,[caret_position] xchg eax,[selection_line] xchg ecx,[selection_line_number] xchg edx,[selection_position] mov [caret_line],eax mov [caret_line_number],ecx mov [caret_position],edx jmp text_changed no_selection_after_paste: mov [selection_line],0 jmp text_changed paste_failed: call undo_changes pop ebx invoke GlobalUnlock,ebx invoke CloseClipboard mov [clipboard_opened],0 jmp text_changed |
|||
22 Jul 2023, 12:28 |
|
Roman 22 Jul 2023, 12:43
Windows 10
I show my video. Fasm not want get text from my program. When i press ctrl+v fasm get text from win clipboard. Last edited by Roman on 22 Jul 2023, 20:15; edited 1 time in total |
|||
22 Jul 2023, 12:43 |
|
bitRAKE 22 Jul 2023, 12:58
Roman wrote: But if I pressed ctrl+v I get text from win clipboard in fasmw Without seeing all the code all I can do is advise double checking the correct steps are followed to put data on the clipboard. The video doesn't show your application changing the text on the clipboard and I don't want to make that assumption. We would like to see your application changing clipboard text for itself and also for manually pasting into the IDE. That would reinforce the idea that process isolation is blocking clipboard in some way. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
22 Jul 2023, 12:58 |
|
Roman 22 Jul 2023, 13:02
Quote:
Where is see FEM_GETMODE ? I not found FEM_GETMODE value in fasm sources Code: ;maybe this help invoke SendMessage,[FasmHwnd],FEM_GETMODE,0,0 xor eax,FES_SMARTTABS invoke SendMessage,[FasmHwnd],FEM_SETMODE,eax,0 invoke SendMessage,[FasmHwnd],FEM_ISUNMODIFIED,0,0 |
|||
22 Jul 2023, 13:02 |
|
bitRAKE 22 Jul 2023, 13:15
FEDIT.ASH is the interface definition for the edit control. It has all the external constants needed to use the control. For "FEDIT" - which you couldn't get a handle for.
|
|||
22 Jul 2023, 13:15 |
|
Roman 22 Jul 2023, 13:22
When i open fasmw editor and run my program.
Fasmw editor closed when i do invoke SendMessage,[FasmHwnd],FEM_GETMODE,0,0 |
|||
22 Jul 2023, 13:22 |
|
AsmGuru62 22 Jul 2023, 14:31
In today's Windows the sending of a message between two processes (your program is process #1 and FASM IDE is a process #2) is a very strict operation.
The stuff like that was possible in Win95 or Windows XP, but not today. The better question is why do you need your program to paste the text into FASM IDE? Why not do it the old way: 1. Switch to program where you 'Copy' the text 2. Switch to FASM IDE and use CTRL+V I am guessing -- you are writing some kind of code generator and then you want this generated code from your program to appear inside FASM IDE. Nice, but it will not work with SendMessage API. Unless, you will use WM_COPYDATA message, but then you will have to make FASM IDE to respond to the WM_COPYDATA and do the paste there. For that you may want to add some code into FASM IDE and rebuild it. |
|||
22 Jul 2023, 14:31 |
|
Roman 22 Jul 2023, 14:34
Quote:
I think about this variant. This variant work fine. I select and copy text in richedit window , than put this text to FASMWIDE (ctrl+v) This work fine. |
|||
22 Jul 2023, 14:34 |
|
bitRAKE 22 Jul 2023, 15:36
AsmGuru62 wrote: In today's Windows the sending of a message between two processes (your program is process #1 and FASM IDE is a process #2) is a very strict operation. Roman, try the attached program.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||||||||||
22 Jul 2023, 15:36 |
|
Furs 22 Jul 2023, 16:56
AsmGuru62 wrote: In today's Windows the sending of a message between two processes (your program is process #1 and FASM IDE is a process #2) is a very strict operation. Maybe it won't work if they run under different privilege levels or users, though, but that's not the topic. |
|||
22 Jul 2023, 16:56 |
|
Roman 22 Jul 2023, 17:55
Thanks bitRAKE !
Now work WM_PASTE. But PASTE only in first FASMW_IDE window ! Last edited by Roman on 26 Jul 2023, 11:32; edited 1 time in total |
|||
22 Jul 2023, 17:55 |
|
bitRAKE 26 Jul 2023, 04:58
Roman wrote: Now work WM_PASTE. But PASTE only in first FASMW_IDE window ! How you implement the logic will depend on the intended workflow. I imagine something like refresh the list and gray out all submit buttons (forcing the user to select a new target FEDIT). _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
26 Jul 2023, 04:58 |
|
Tomasz Grysztar 26 Jul 2023, 07:39
You can use FASMW's custom messages FM_GETSELECTED and FM_GETHANDLE to get the handle of edit window for currently selected tab:
Code: FM_SELECT = WM_USER + 4 FM_ASSIGN = WM_USER + 5 FM_GETSELECTED = WM_USER + 6 FM_GETASSIGNED = WM_USER + 7 FM_GETHANDLE = WM_USER + 8 invoke FindWindow, "FASMW_IDE32", 0 test eax,eax jz .no_ide mov ebx,eax invoke SendMessage, ebx, FM_GETSELECTED, 0, 0 invoke SendMessage, ebx, FM_GETHANDLE, eax, 0 invoke SendMessage, eax, WM_PASTE, 0, 0 |
|||
26 Jul 2023, 07:39 |
|
Roman 26 Jul 2023, 07:59
Thanks Tomasz.
Work perfect! New update.
Last edited by Roman on 04 Sep 2023, 10:09; edited 12 times in total |
|||||||||||
26 Jul 2023, 07:59 |
|
Roman 31 Jul 2023, 13:03
Problem.
FasmwIDE 1.73 not saved any file with any name , after my program past text. When I closed my program FasmwIDE 1.73 saved file fine. My program using win clipboard. What is wrong ? My program each 100 Milliseconds do this. This could be problem ? Code: invoke FindWindow, "FASMW_IDE32", 0 test eax,eax jz .no_ide mov ebx,eax invoke SendMessage, ebx, FM_GETSELECTED, 0, 0 invoke SendMessage, ebx, FM_GETHANDLE, eax, 0 .no_ide: Yes this a problem and fasmIDE not save file for this code. I checked now. I put this code in wndproc when happened message WM_COMMAND, now work well. |
|||
31 Jul 2023, 13:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.