Re: No Win32Lib Drag and Drop example OR IS THERE ??
- Posted by euphoric (admin) Nov 04, 2011
- 3634 views
Selgor said...
Drag an icon or file and put it in a specific place.
The following code lets you drag and drop a file icon onto the textbox control and have that icon's path displayed in the textbox.
include Win32Lib.ew constant Window1 = createEx( Window, "Window1", 0, Default, Default, 371, 119, 0, 0 ) constant txt_FileName = createEx( EditText, "", Window1, 24, 16, 308, 32, 0, 0 ) procedure txt_FileName_onDragAndDrop (integer self, integer event, sequence params)--params is ( int id, seq FileName ) if length(params[2]) > 0 then setText( txt_FileName, params[2] ) end if end procedure setHandler( txt_FileName, w32HDragAndDrop, routine_id("txt_FileName_onDragAndDrop")) WinMain( Window1,Normal )