〖原创〗如何实现程序自动关闭powerbuilder弹出的消息窗口?

    技术2022-05-11  55

    //-新建一窗口,上面放置一按钮对象cb_msg

    cb_msg的click事件代码-Open('msg','这是一个测试关闭消息窗口的例子')

    //---在窗口Local external Functions声明以下API函Function long FindWindowA (String lpClassName , String lpWindowName ) Library "user32.dll" Function boolean IsWindow (Long hwnd ) Library "user32.dll"

    //---窗口的open事件代码Timer(2)//触发关闭消息窗口代码的时间间隔

    //---Timer事件代码Ulong  handleString ls_null

    SetNull(ls_null)//获得该消息窗口的句柄handle = FindWindowA(ls_null,'msg')//字符串"msg"为消息窗口的标题名称

    If Iswindow(handle) Then   //向WINDOWS发送消息关闭窗口,256为wm_keydown消息的整型值   Post(handle,256,13,0)End If


    最新回复(0)