vb.net - Execute Context Menu Command in External Application -
i trying write application can select text in textbox within external application, copy clipboard, perform changes programmatically string , send modified string external application. did not write external application , not have access code nor can afford contact developer , have them make changes. external application client-server based , can interact user interface on client side.
the problem running can send keyboard commands application send or delete text, cannot select of text. using keyboard shortcuts ctrl-a, ctrl-shift-home, ctrl-shift-end, etc. not work. triple clicking on text box not work either.
however, can right click on text box , bring context menu , select command "select all". wondering if there way send context menu command application without having have context menu appear.
i want 2 applications appear working seamlessly possible user. have suggestions might work?
to answer specific question:
i wondering if there way send context menu command application without having have context menu appear.
when menu item clicked, issues wm_command message parent window of menu. can use tool spy++ monitor such messages , see command id being sent window, , can code app send same message directly same window. no need display actual menu itself.
however, in particular situation, overkill. if have hwnd of desired edit control, can send wm_gettext , wm_settext messages instead, or use .net's uiautomation interfaces, get/set control's text directly. either way, there no need select text (you can use em_setsel that) or involve clipboard.
Comments
Post a Comment