nomainwin WindowWidth=640:WindowHeight=480 UpperLeftX=1:UpperLeftY=1 open "Texteditor" for window as #1 print #1, "trapclose [quit]" hT=CreateTextEdit(hwnd(#1), 1, 1, 630, 432) wait [quit] close #1 end Function CreateTextEdit(hW, x, y, w, h) style = _WS_CHILDWINDOW OR _WS_BORDER _ OR _WS_VISIBLE or _ES_MULTILINE or _WS_VSCROLL hInst=GetWindowLong(hW, _GWL_HINSTANCE) calldll #user32, "CreateWindowExA",_ 0 as long,"EDIT" as ptr,_ "" as ptr, style as long,_ x as long,y as long,w as long,h as long,_ hW as ulong, 0 as long, hInst as ulong,_ 0 as long, CreateTextEdit as ulong end function Function GetWindowLong(hW, type) calldll #user32, "GetWindowLongA", _ hW as ulong, type as long,_ GetWindowLong as ulong End Function
|
nomainwin WindowWidth=640:WindowHeight=480 UpperLeftX=1:UpperLeftY=1 open "Texteditor" for window as #1 print #1, "trapclose [quit]" hT=CreateTextEdit(hwnd(#1), 1, 1, 630, 432) timer 100,[setfocus] wait [setfocus] calldll #user32, "SetFocus", hT as ulong, r as long wait [quit] close #1 end Function CreateTextEdit(hW, x, y, w, h) style = _WS_CHILDWINDOW OR _WS_BORDER _ OR _WS_VISIBLE or _ES_MULTILINE or _WS_VSCROLL hInst=GetWindowLong(hW, _GWL_HINSTANCE) calldll #user32, "CreateWindowExA",_ 0 as long,"EDIT" as ptr,_ "" as ptr, style as long,_ x as long,y as long,w as long,h as long,_ hW as ulong, 0 as long, hInst as ulong,_ 0 as long, CreateTextEdit as ulong end function Function GetWindowLong(hW, type) calldll #user32, "GetWindowLongA", _ hW as ulong, type as long,_ GetWindowLong as ulong End Function