But if you don't use the mouse to click the CHtmlView, can't correct the enter key to submit
PS: I tried mouse_event was used to simulate the mouse to click, too, a mystery,
Thank you ~
CodePudding user response:
CHtmlView filling forms and simulate the click eventCodePudding user response:
Thank moderator reply, these all did, even with all kinds of simulation methods are not line, want to use the mouse to click the first CHtmlView web space, have the effect,CodePudding user response:
You call the COM interface to operate elements, does not trigger the corresponding event, such as you to call the submit will not trigger the onsubmit, you to change the check box or radio button option will not start onchangeOperation, the more you trigger involves all the corresponding event is not feasible, many operations will trigger multiple events at the same time, for example, if you change the focus will trigger an element of an onfocus, onblur another element, as well as the corresponding onfocusin and onfocusout, relatively simple solution is to look at a script exception is where a line before and then on the way up to see what event to trigger,
Triggering event can use IHTMLElement3: : FireEvent, before use IHTMLDocument4: : CreateEventObject create events, events that created a lot of attribute value is empty, the script if access to the window. What attributes of the event (such as MouseEvent. Button or MouseEvent. X/y), if you want to manually set the,
If your browser controls is Internet explorer 9 model in IDocumentEvent/IDOMEvent and IEventTarget the API, IE11 there some event types, such as onclick instead MouseEvent parameter MSPointerEvent, if your browser compatibility mode and control site looking forward to, also may be abnormal,
Some websites have the robot, this is more trouble, each site is different and often change,