您的足迹:首页 > 我的代码 >aardio/AAU 通知提醒窗口不抢占主窗口焦点

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*/); 看自己有什么具体的应用需求吧。
本博客所有文章如无特别注明均为原创。作者:恶猫复制或转载请以超链接形式注明转自 恶猫的博客
原文地址《aardio/AAU 通知提醒窗口不抢占主窗口焦点

相关推荐

WRITTEN BY

avatar

发表评论

路人甲 表情
看不清楚?点图切换 Ctrl+Enter快速提交

网友评论(0)

恶猫的博客 -记录自己日常,代码,美图,电影,音乐,新闻,只是个人博客而已

浙ICP备15011757号-4 网站地图 联系我