Jump to content

help rich edit control


wolf9228
 Share

Recommended Posts

How could imports a Bitmap image into a rich edit control

#include<WinAPI.au3>
#include<Guiconstants.au3>
#include<guiedit.au3>
#Include <Clipboard.au3>
$EM_GETPARAFORMAT = ($WM_USER + 61)
$library = _WinAPI_LoadLibrary("msftedit.dll") 
ConsoleWrite($library & @CRLF)
$RichEditClass = "RichEdit50W" 
$handle = GUICreate("", 500, 500)
$richedit = _WinAPI_CreateWindowEx (0, $RichEditClass, "",BitOR($WS_CHILD,$WS_VISIBLE ,$WS_BORDER ,$WS_HSCROLL ,$WS_VSCROLL ,$ES_AUTOHSCROLL _
,$ES_AUTOVSCROLL , $ES_MULTILINE ,256 ,32768 ,16777216), 0, 0, 400, 400, $handle,Default,1,Default)
;$IRichEditOle = DllCall("msftedit.dll", "int", "ImportDataObject", "int",_ClipBoard_GetData ())

;_SendMessage($EM_GETPARAFORMAT,0,0)
GUISetState(@SW_SHOW)

Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

http://msdn2.microsoft.com/en-us/library/b...351(VS.85).aspx

IRichEditOle::ImportDataObject Method

The IRichEditOle::ImportDataObject method imports a clipboard object into a rich edit

control, replacing the current selection.

HRESULT ImportDataObject( LPDATAOBJECT lpdataobj,

CLIPFORMAT cf,

HGLOBAL hMetaPict

);

http://msdn2.microsoft.com/en-us/library/b...041(VS.85).aspx

EM_GETOLEINTERFACE Message

The EM_GETOLEINTERFACE message retrieves an IRichEditOle object that a client can use

to access a rich edit control's Component Object Model (COM) functionality.

http://msdn2.microsoft.com/en-us/library/b...306(VS.85).aspx

IRichEditOle Interface

The IRichEditOle interface exposes the COM functionality of a rich edit

control. The interface can be obtained by sending the EM_GETOLEINTERFACE message.

This interface has the following methods.

IRichEditOle Members

IRichEditOle Members

ActivateAs The IRichEditOle::ActivateAs method handles Activate As behavior by unloading all

objects of the old class, telling OLE to treat those objects as objects of the new class, and

reloading the objects. If objects cannot be reloaded, they are deleted.

ContextSensitiveHelp The IRichEditOle::ContextSensitiveHelp method tells a rich edit control

that it should transition into or out of context-sensitive help mode. A rich edit control

calls the ContextSensitiveHelp method of any in-place object which is currently

active if a state change is occurring.

ConvertObject The IRichEditOle::ConvertObject method converts an object to a new type. This

call reloads the object but does not force an update; the caller must do this.

GetClientSite The IRichEditOle::GetClientSite method retrieves an IOleClientSite interface to

be used when creating a new object. All objects inserted into a rich edit control must use client

site interfaces returned by this function. A client site may be used with exactly one object.

GetClipboardData The IRichEditOle::GetClipboardData method retrieves a clipboard object for a

range in an edit control.

GetLinkCount The IRichEditOle::GetLinkCount method returns the number of objects in a rich edit

control that are links.

GetObject Retreives information, stored in a REOBJECT structure, about an object

in a rich edit control.

GetObjectCount The IRichEditOle::GetObjectCount method returns the number of objects currently

contained in a rich edit control.

HandsOffStorage The IRichEditOle::HandsOffStorage method tells a rich edit control to release its

reference to the storage interface associated with the specified object. This call does not call

the object's IRichEditOle::HandsOffStorage method; the caller must do that.

ImportDataObject The IRichEditOle::ImportDataObject method imports a clipboard object into a rich

edit control, replacing the current selection.

InPlaceDeactivate The IRichEditOle::InPlaceDeactivate method tells a rich edit control to

deactivate the currently active in-place object, if any.

InsertObject The IRichEditOle::InsertObject method inserts an object into a

rich edit control.

SaveCompleted The IRichEditOle::SaveCompleted method tells a rich edit control that

the most recent save operation has been completed and that it should hold onto a

different storage for the object.

SetDvaspect The IRichEditOle::SetDvaspect method sets the aspect that a rich edit

control uses to draw an object. This call does not change the drawing information

cached in the object; this must be done by the caller. The call does cause

the object to be redrawn.

SetHostNames The IRichEditOle::SetHostNames method sets the host names to be given to

objects as they are inserted to a rich edit control. The host names are used in the user

interface of servers to describe the container context of opened objects.

SetLinkAvailable The IRichEditOle::SetLinkAvailable method sets the value of the link-available

bit in the object's flags. The link-available bit defaults to TRUE. It should be set to FALSE if any errors occur on the link which would indicate problems connecting to the linked object or application. When those problems are repaired, the bit should be set to TRUE again.

Interface Information

Minimum DLL Version msftedit.dll

Inherits from IUnknown

Header Richole.h

Minimum operating systems Windows 95, Windows NT 4.0

http://www.codeproject.com/KB/docview/Tabl...age_editor.aspx

An example editor with table and image support

Posted Image

Edited by wolf9228

صرح السماء كان هنا

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...