當(dāng)前位置:首頁(yè) > IT技術(shù) > 其他 > 正文

aardio 嵌入 其他應(yīng)用程序
2022-05-11 11:09:22

aardio 嵌入 其他應(yīng)用程序

需求

這個(gè)chrome殼不能進(jìn)行拖拽和縮放,所以再套一個(gè)殼,可以再分屏的時(shí)候用

import win.ui;
/*DSG{{*/
winform = win.form(text="數(shù)字化加工 - 一定先關(guān)閉內(nèi)部的chrome,再關(guān)閉本程序";right=959;bottom=591)
winform.add(
custom={cls="custom";text="自定義控件";left=767;top=13;right=1373;bottom=467;z=2};
static={cls="static";left=0;top=0;right=959;bottom=591;db=1;dl=1;dr=1;dt=1;z=1}
)
/*}}*/

import winex; 
import process;

var exeUrl = "C:Program Filesdpsys數(shù)字化加工系統(tǒng)win64.exe"
pid = process.execute(exeUrl)
//win.delay(5000)
chwnd = winex.waitVisible(,,,,,pid)
//win.delay(5000)
// 讓外部窗口成為自身的懸浮窗口,吸附并可顯示在外面
//winform.custom.orphanWindow(,chwnd)


//process.executeWaitInput(exeUrl);//運(yùn)行記事本
//var prcs = process(exeUrl);

//win.delay(5000)

//var hwnd1 = winex.find("SunAwtToolkit",,prcs.id);

//var hwndNotepad,hNotepadEdit = winex.wait(,,"SunAwtToolkit","<RichEditD2DPT>|<Edit>");//查找句柄
//SunAwtFrame
//SunAwtToolkit




//懸浮影子窗口:外部進(jìn)程窗口附加到 winform.static 并如影隨形的自適應(yīng)縮放調(diào)整位置
winex.orphanWindow(winform.static,chwnd)

//退出程序前讓記事本退出
winform.onClose = function(hwnd,message,wParam,lParam){
   if(!winex.closeAndWait(chwnd)) return 1; 
}



/*
prcs=process(exeUrl);
for hwnd,title,tid,pid in winex.each(  ) {
    if(pid == prcs.id){
     io.open()
     io.print("窗口句柄",string.format("%x",hwnd),"窗口類(lèi)",win.getClass(hwnd),"進(jìn)程ID",prcs.id,'
')
    }
}
*/

//窗口句柄        3023e4  窗口類(lèi)  SunAwtToolkit   進(jìn)程ID  32356



//process.executeWaitInput(exeUrl);//運(yùn)行記事本


//


//var hwndNotepad,hNotepadEdit = winex.wait(,,"Chrome_RenderWidgetHostHWND", "SunAwtToolkit");//查找句柄
//var hwndNotepad,hNotepadEdit = winex.wait(,,"SunAwtToolkit");//查找句柄


//懸浮影子窗口:外部進(jìn)程窗口附加到 winform.static 并如影隨形的自適應(yīng)縮放調(diào)整位置
//winex.orphanWindow(mainForm.static,hwndNotepad)

winform.show();
return win.loopMessage();

更新了一版 ini 配置exe地址的

import win.ui;
/*DSG{{*/
winform = win.form(text="數(shù)字化加工 - 一定先關(guān)閉內(nèi)部的chrome,再關(guān)閉本程序";right=959;bottom=591)
winform.add(
custom={cls="custom";text="自定義控件";left=767;top=13;right=1373;bottom=467;z=2};
static={cls="static";left=0;top=0;right=959;bottom=591;db=1;dl=1;dr=1;dt=1;z=1}
)
/*}}*/

import winex; 
import process;
import fsys.ini
ini=fsys.ini("config.ini") // 編碼格式要GBK ansi, utf8會(huì)有亂碼
sec = ini.getSection("appSection")
//sec.app
//io.open()
//io.print(sec.app)

//import inet.url;
//sec.app = "C:Program Filesdpsys數(shù)字化加工系統(tǒng)win64.exe"
//sec.save()
//var exeUrl = string.fromto(sec.app, 936, 65001) // "C:Program Filesdpsys數(shù)字化加工系統(tǒng)win64.exe"
var exeUrl = sec.app
pid = process.execute(exeUrl)
io.print(exeUrl)
//win.delay(5000)
chwnd = winex.waitVisible(,,,,,pid)
//win.delay(5000)
// 讓外部窗口成為自身的懸浮窗口,吸附并可顯示在外面
//winform.custom.orphanWindow(,chwnd)


//process.executeWaitInput(exeUrl);//運(yùn)行記事本
//var prcs = process(exeUrl);

//win.delay(5000)

//var hwnd1 = winex.find("SunAwtToolkit",,prcs.id);

//var hwndNotepad,hNotepadEdit = winex.wait(,,"SunAwtToolkit","<RichEditD2DPT>|<Edit>");//查找句柄
//SunAwtFrame
//SunAwtToolkit




//懸浮影子窗口:外部進(jìn)程窗口附加到 winform.static 并如影隨形的自適應(yīng)縮放調(diào)整位置
winex.orphanWindow(winform.static,chwnd)

//退出程序前讓記事本退出
winform.onClose = function(hwnd,message,wParam,lParam){
   if(!winex.closeAndWait(chwnd)) return 1; 
}



/*
prcs=process(exeUrl);
for hwnd,title,tid,pid in winex.each(  ) {
    if(pid == prcs.id){
     io.open()
     io.print("窗口句柄",string.format("%x",hwnd),"窗口類(lèi)",win.getClass(hwnd),"進(jìn)程ID",prcs.id,'
')
    }
}
*/

//窗口句柄        3023e4  窗口類(lèi)  SunAwtToolkit   進(jìn)程ID  32356



//process.executeWaitInput(exeUrl);//運(yùn)行記事本


//


//var hwndNotepad,hNotepadEdit = winex.wait(,,"Chrome_RenderWidgetHostHWND", "SunAwtToolkit");//查找句柄
//var hwndNotepad,hNotepadEdit = winex.wait(,,"SunAwtToolkit");//查找句柄


//懸浮影子窗口:外部進(jìn)程窗口附加到 winform.static 并如影隨形的自適應(yīng)縮放調(diào)整位置
//winex.orphanWindow(mainForm.static,hwndNotepad)

winform.show();
return win.loopMessage();

關(guān)閉直接殺掉進(jìn)程,因?yàn)閮?nèi)層 還彈框問(wèn)是否關(guān)閉

import win.ui;
/*DSG{{*/
winform = win.form(text="數(shù)字化加工 - 要配置好 app 和 fileName 打開(kāi)和關(guān)閉按鈕才能用";right=959;bottom=591)
winform.add(
custom={cls="custom";text="自定義控件";left=767;top=13;right=1373;bottom=467;z=2};
static={cls="static";left=0;top=0;right=959;bottom=591;db=1;dl=1;dr=1;dt=1;z=1}
)
/*}}*/

import winex; 
import process;
import fsys.ini
ini=fsys.ini("config.ini") // 編碼格式要GBK ansi, utf8會(huì)有亂碼
sec = ini.getSection("appSection")
//sec.app
//io.open()
//io.print(sec.app)

//import inet.url;
//sec.app = "C:Program Filesdpsys數(shù)字化加工系統(tǒng)win64.exe"
//sec.save()
//var exeUrl = string.fromto(sec.app, 936, 65001) // "C:Program Filesdpsys數(shù)字化加工系統(tǒng)win64.exe"
var exeUrl = sec.app
var fileName = sec.fileName
pid = process.execute(exeUrl)
io.print(exeUrl)
//win.delay(5000)
chwnd = winex.waitVisible(,,,,,pid)
//win.delay(5000)
// 讓外部窗口成為自身的懸浮窗口,吸附并可顯示在外面
//winform.custom.orphanWindow(,chwnd)


//process.executeWaitInput(exeUrl);//運(yùn)行記事本
//var prcs = process(exeUrl);

//win.delay(5000)

//var hwnd1 = winex.find("SunAwtToolkit",,prcs.id);

//var hwndNotepad,hNotepadEdit = winex.wait(,,"SunAwtToolkit","<RichEditD2DPT>|<Edit>");//查找句柄
//SunAwtFrame
//SunAwtToolkit




//懸浮影子窗口:外部進(jìn)程窗口附加到 winform.static 并如影隨形的自適應(yīng)縮放調(diào)整位置
winex.orphanWindow(winform.static,chwnd)

//退出程序前讓記事本退出
winform.onClose = function(hwnd,message,wParam,lParam){
	process.kill(fileName)
	//var t = !winex.closeAndWait(chwnd)
	//io.open()
	//io.print(t)
   //if(t) return 1; 
}



/*
prcs=process(exeUrl);
for hwnd,title,tid,pid in winex.each(  ) {
    if(pid == prcs.id){
     io.open()
     io.print("窗口句柄",string.format("%x",hwnd),"窗口類(lèi)",win.getClass(hwnd),"進(jìn)程ID",prcs.id,'
')
    }
}
*/

//窗口句柄        3023e4  窗口類(lèi)  SunAwtToolkit   進(jìn)程ID  32356



//process.executeWaitInput(exeUrl);//運(yùn)行記事本


//


//var hwndNotepad,hNotepadEdit = winex.wait(,,"Chrome_RenderWidgetHostHWND", "SunAwtToolkit");//查找句柄
//var hwndNotepad,hNotepadEdit = winex.wait(,,"SunAwtToolkit");//查找句柄


//懸浮影子窗口:外部進(jìn)程窗口附加到 winform.static 并如影隨形的自適應(yīng)縮放調(diào)整位置
//winex.orphanWindow(mainForm.static,hwndNotepad)

winform.show();
return win.loopMessage();

本文摘自 :https://www.cnblogs.com/

開(kāi)通會(huì)員,享受整站包年服務(wù)立即開(kāi)通 >