Very urgent!!!!! How to add exe program in form1 framework.
Time:11-02
A ready-made program (in addition to the exe file and DLL, dat file), in order to want the function of the program, now the only way to go is the exe embedded in the form to show effect, Seek to add detail steps and code,
Thank you very much,
Please do not copy content on baidu, I already all searched, no scientific solutions,
CodePudding user response:
It is unrealistic to other application UI shown in your form is not difficult, but your program can't communicate with off-the-shelf programs, including data and function of communication, for example, you want to be a software of drawing functions, you want your program to provide data for these two programs, then this program will image data after the flush draw back to your own programs, or directly displayed, is can't do like this, even if do it, or use memory and thread injection method, very trouble. Another possible, but I haven't much support this technology application, OLE,
If the ready-made program is OLE server, then you can through the OLE technology to add a reference to him in VB, which like action object through code that software operation, for example, the Word, you can be in VB [quote] window will Word. Exe, added the Word's program, and then use the provided by the Application, the document object operations such as Word, this is because the Word of the program itself is OLE server, he provides procedures and functions and data communication interface between the can try in VB [quote] window click browse, find exe then try to add him, if can the exe is likely to be OLE, if prompt can't load is certainly not OLE
However, if you say me as long as the ready-made in the software interface embedded in his own form, do not need to function and data communication, it is good to the implementation, ideas are as follows:
(1) first of all, you need a handle "finder", baidu search this word has a heap of (2) start your existing software, for example, you want to put the software "ABC [XXX]" window inserted in your program, use the handle to query device to capture this window (handle basic usage of query, press a button, and then move the mouse to need to form, finder will to check the data in the window, didn't find this function, change a), check the window class name, this is the part 1, 2, the primary purpose of Findwindow (3) statement in your own programs API function (specific statement baidu "findwindow") Findwindow (4) call function is introduced to find the name of the class before as a parameter, the API function can be found in accordance with what you give the class name of the window, and returns a handle to the window and see if returned to handle and to query device, the same can do down, (5) statement in your own programs API function SetParent function (specific statement baidu "SetParent") 6 call SetParent function, will own a handle to the window (for example, is a handle to the window Form1 Form1. The attributes of the HWND value) and to handle as two parameters passed into the function, can be reset "ABC [XXX]" the window of the parent window of the window to you, so that "ABC [XXX]" window is embedded into your window,
Basically said that, but think you should want two programs have data or the function of communication, because you said "to want the function of the program," that if not OLE give it up, basically can't, or wait for more advanced great god ~ ~