winform.custom嵌入外部exe程序

admin2021-12-26  134

import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add(
custom={cls="custom";text="自定义控件";left=6;top=5;right=755;bottom=464;db=1;dl=1;dr=1;dt=1;z=1}
)
/*}}*/

import process
var prcs = process("notepad.exe")
var cHwnd = prcs.waitMainWindow();
//var cHwnd = prcs.getMainWindow()
win.setParent(cHwnd,winform.custom.hwnd)

var style = 0/*_WS_OVERLAPPED*/ | 0x40000/*_WS_THICKFRAME*/ | 0x800000/*_WS_BORDER*/ | 0x400000/*_WS_DLGFRAME*/ | 0xC00000/*_WS_CAPTION*/
win.modifyStyle( cHwnd,style,0x80000000/*_WS_POPUP*/)

winform.adjust = function( cx,cy,wParam ) {	 
 	var x,y,w,h = winform.custom.getPos(true)
 	win.setPos(cHwnd,0,0,w,h)	 
};

winform.show();
winform.width-=1

win.loopMessage();

感谢巴克队长提供代码

转载请注明原文地址: http://www.aardio.net/read-278.html
最新回复(1)
aardio问答
aardio编程语言