拦截最大化消息,然后设置窗口为 800*600.

import win.ui;
/*DSG{{*/
var winform = win.form(parent=...; text="aardio Form";right=525;bottom=365 )
winform.add(
button={ bottom=360;text="button";left=448;top=336;font=LOGFONT( name="SimSun";h=-12 );z=2;right=520;cls="button" };
richedit={ ah=1;bottom=328;text="richedit";left=8;multiline=1;top=8;font=LOGFONT( name="SimSun";h=-12 );right=520;aw=1;wrap=1;z=1;edge=1;cls="richedit" }
)
/*}}*/




winform.wndproc = function(hwnd,message,wparam,lparam){

select(message) {//判断消息类型

case 0x112/*_WM_SYSCOMMAND*/{
if(wparam == 0xF030/*_SC_MAXIMIZE*/){
win.msgbox("点击了最大化按钮","aardio")
return false;
}else if( wparam == 0x0/*_SIZE_RESTORED*/ ){
win.msgbox("点击了恢复按钮","aardio")
return false;
}else if( wparam == 0xF020/*_SC_MINIMIZE*/ ){
win.msgbox("点击了最小化按钮","aardio")
return false;
}else if(wparam=0xF120/*_SC_RESTORE*/){
//win.msgbox("还原")
if(frmChild){
frmChild.show();
}
}

}
case 0x0007/*_WM_SETFOCUS */{
//console.log("获得焦点");
if(frmChild){
frmChild.show();
}
}


}
//无返回值则继续调用默认回调函数
}



winform.show()
win.loopMessage();

方法二:

用win api就很轻松的解决啦

import win.ui;
/*DSG{{*/
var winform = win.form(parent=...; text="aardio Form";right=349;bottom=249 )
winform.add(
button={ bottom=130;right=254;left=86;top=78;font=LOGFONT( name="宋体";h=-12 );z=1;text="button";cls="button" }
)
/*}}*/

winform.button.oncommand = function(id,event){
GetActiveWindow = ::User32.api("GetActiveWindow","int()")//获得当前活动窗口的句柄
MoveWindow = ::User32.api("MoveWindow","int(int hwnd,int x,int y,int nWidth,int nHeight,int bRepaint)")//设置窗口位置和大小
var hwnd = GetActiveWindow()
/*
*x,y分别是left和top的值,nWidth,nHeight分别是新宽和高,bRepaint为false由窗口自行决定是否重画
*/
var x = 349
var y = 249
var nWidth = 800
var nHeight = 600
var bRepaint = 0 //int类型的参数
var int = MoveWindow(hwnd,x,y,nWidth,nHeight,bRepaint)
win.msgbox(int,"aardio")
}
winform.show()
win.loopMessage();