有谁知事件ID:pbm_custom01 到pbm_custom75的具体信息???

fys_syf 2002-03-12 08:46:44
有谁知事件ID:pbm_custom01 到pbm_custom75的具体信息?
...全文
539 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
McdullMini 2002-03-12
  • 打赏
  • 举报
回复
受益非浅
killerdanny 2002-03-12
  • 打赏
  • 举报
回复
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
What is an Event ID in PowerBuilder? How can I use it?
////////////////////////////////////////////////////////

An event ID is really a Windows message ID. Most windows "events" are mapped by PowerBuilder to a PB-specific Event ID. Of course, there are exceptions to this rule, but I won't get into those.

When an action occurs, like clicking on a button, Windows sends a message to the application, and PB in turn sends it to the object. If the object has script for that message (i.e., that Event ID), it is executed. Not all windows messages, like the timer event, can be activated my the user.

When you create a new event, you are really mapping a Windows message to the custom event. You can select one of the standard PB events (such as pbm_rbuttondown, which is Right Mouse Button Down), or a custom event such as pbm_custom01. Windows / PowerBuilder reserves 75 events for this purpose. There is no action that a user can take to trigger a custom event - it must be called, or triggered, from another event or function.

For the sake of completeness, there is an Other event (pbm_other) that get's called if the message Windows sends does not directly map to any event defined for that object. I suggest not normally using this event since it get's called all the time.

Lastly, the PowerBuilder manuals do not describe all the possible events. To see what a specific event does, you'll have to reference a Windows API guide - just strip off the pbm_ of the Event ID and look it up. Please note that not ALL events are described in the API manuals since PB creates some of it's own

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
I created a user-defined event and mapped it to pbm_custom01. How can I trigger that event from another PowerBuilder application?
//////////////////////////////////////////////////////////////////

Well, you need the handle of the window where the event was declared. In 32-bit PB, you will pretty much need to pass it on the command line via Handle(This) to the other PB application (if you start it using the Run() command) or get it to the other application some how.

With that in mind, just use the code "Send(Application_Handle, EventID , 0, 0)" where EventID is 1023 + the the XX in pbm_customXX. For example, if you want to trigger pbm_custom51, then the EventID is 1023 + 51 = 1074.

看看老外的回答吧,一般情况下这些事件ID没有用途
fys_syf 2002-03-12
  • 打赏
  • 举报
回复
还是不太懂,能说说wm_user和wm_user+74的含义吗?谢谢(;
2000pinbo 2002-03-12
  • 打赏
  • 举报
回复
同意同意
vcpb 2002-03-12
  • 打赏
  • 举报
回复
pbm_custom01对应windows的 WM_USER
WM_USER =1024
用户自定义事件

User-Defined Event PowerBuilder Event ID
WM_USER pbm_custom01
. .
. .
WM_USER + 74 pbm_custom75
PB9以上的PB版本适用。 使用只有三个函数,很简单。 这是用PBNI编写的控件,VC6的IDE,VC2003的编译器编译,UNICODE版本。 三个函数的使用说明: of_addtip(unsignedlong winhandle, string tip) 添加一个tip。这是必须首先调用的函数,即:在使用其他两个函数前,必须先调用此函数。 winhandle:窗口句柄,操作tip的窗口的句柄,tip的图标即用此窗口的图标。 tip: tip的字符内容。 of_modifytip(string title, string info) 修改tip的内容,并且动态将修改的内容立即显示。参数的含义明显。 of_deletetip() 删除tip. 对tip图标上的鼠标操作的处理: 原理是:图标上的所有windows消息,都会转发到参数winhandle所代表的窗口,作为该窗口的WM_USER消息,即触发该窗口的pbm_custom01事件pbm_custom01事件的lparm参数指定tip图标的windows消息号。 具体作法:在参数winhandle所代表的窗口的pbm_custom01事件中写代码,检测lparm的值,以判断鼠标进行了哪种操作,如:lparm为517(WM_RBUTTONUP),表示鼠标弹起。 pbm_custom01中的示例代码: //start CONSTANT long WM_MOUSEMOVE = 512 CONSTANT long WM_LBUTTONDOWN = 513 CONSTANT long WM_LBUTTONUP = 514 CONSTANT long WM_LBUTTONDBLCLK = 515 CONSTANT long WM_RBUTTONDOWN = 516 CONSTANT long WM_RBUTTONUP = 517 CONSTANT long WM_RBUTTONDBLCLK = 518 CONSTANT long WM_USER = 1024 CONSTANT long NIN_BALLOONSHOW =(WM_USER + 2) CONSTANT long NIN_BALLOONHIDE =(WM_USER + 3) CONSTANT long NIN_BALLOONTIMEOUT =(WM_USER + 4) CONSTANT long NIN_BALLOONUSERCLICK =(WM_USER + 5) m_base lm_menu CHOOSE CASE lparam CASE WM_MOUSEMOVE // CASE WM_LBUTTONDOWN //鼠标左键按下 CASE WM_LBUTTONUP //鼠标左键弹起 CASE WM_LBUTTONDBLCLK //鼠标左键双击 CASE WM_RBUTTONDOWN // SetFocus ( this ) lm_menu = CREATE m_base lm_menu.PopMenu(PointerX(),PointerY()) DESTROY lm_menu CASE WM_RBUTTONUP // CASE WM_RBUTTONDBLCLK // CASE NIN_BALLOONSHOW // CASE NIN_BALLOONHIDE // CASE NIN_BALLOONTIMEOUT // CASE NIN_BALLOONUSERCLICK // CASE ELSE Beep(0) END CHOOSE //end 注意事项: 经测试,本PBNI如果与其他非UNICODE版的PBNI同用时,会显示乱码。无解。 如有BUG,敬请及时告知。 本控件的讨论贴: http://topic.csdn.net/u/20090510/20/14a57e09-02ca-44df-8f9b-e3811678360d.html

401

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧