您的足迹:首页
>
我的代码
>aardio/AAU 通知提醒窗口不抢占主窗口焦点
import win.ui;
/*DSG{{*/
var winform = ..win.form(text="aardio form";right=599;bottom=399)
winform.add(
button={cls="button";text="button";left=222;top=187;right=399;bottom=234;z=1}
)
/*}}*/
code = /**
import win.ui;
import win.ui.shadow;
/*DSG{{*/
var winform = ..win.form(text="通知提醒";right=340;bottom=430;mode="popup")
winform.add()
/*}}*/
popWindow = function(winform){
var sx,sy = win.getScreen();
var rect = win.getWorkArea();
var posX = sx- winform.width-7;
var posY = rect.height();
winform.modifyStyleEx(0x10000000/*_WS_VISIBLE*/,0x8000000/*_WS_EX_NOACTIVATE*/ | 0x8000000/*_WS_DISABLED*/)
winform.wndproc = function(hwnd,message,wParam,lParam){
if(message == 0x21/*_WM_MOUSEACTIVATE*/){
return 0x3/*_MA_NOACTIVATE*/;
}
if(message == 0xA1/*_WM_NCLBUTTONDOWN*/){
if(wParam == 20){
winform.close()
}
return 0x3/*_MA_NOACTIVATE*/;
}
}
winform.setPos(posX,posY,,,,0x10/*_SWP_NOACTIVATE*/);
winform.show(0x4/*_SW_SHOWNOACTIVATE*/);
var tick = 0;
winform.onClose = function(hwnd,message,wParam,lParam){
var tick = winform.height;
var cY = winform.top;
while(true){
tick--;
if tick <= 0 break ;
winform.setPos(posX, posY - tick,,,,0x10/*_SWP_NOACTIVATE*/);
win.delay(0);
}
}
while(true){
tick++;
if tick >= winform.height break ;
winform.setPos(posX,posY-tick,,,,0x10/*_SWP_NOACTIVATE*/);
win.delay(0);
}
}
popWindow(winform);
win.loopMessage();
return winform;
**/
winform.button.oncommand = function(id,event){
form = winform.loadForm(code)
}
winform.show()
win.loopMessage();
源码出自。大葫芦娃。。是一个弹出的消息提醒窗口。不抢主窗体焦点。。
换个方法
winform.show(0x4/*_SW_SHOWNOACTIVATE*/); 看自己有什么具体的应用需求吧。
发表评论