我怎么找不到PNOTIFYICONDATA的帮助?(100分)

  • 主题发起人 主题发起人 lala
  • 开始时间 开始时间
L

lala

Unregistered / Unconfirmed
GUEST, unregistred user!
看到过这样的代码:<br>FPda:PNOTIFYICONDATA;<br>然后是:<br>New(Fpda);<br>&nbsp; With FPda^ do<br>&nbsp; begin<br>&nbsp; &nbsp; uCallbackMessage:=WM_MY_Notify;<br>&nbsp; &nbsp; cbsize:=SizeOf(FPda^);<br>&nbsp; &nbsp; uID:=200;<br>&nbsp; &nbsp; wnd:=Handle;<br>&nbsp; &nbsp; uFlags:=NIF_ICON+NIF_Tip+NIF_MESSAGE;<br>&nbsp; &nbsp;end;<br>我怎么也查不到关于PNOTIFYICONDATA的help档,请予赐教
 
是这样一个结构:(在 ShellAPI.pas 里)<br><br>&nbsp; _NOTIFYICONDATAA = record<br>&nbsp; &nbsp; cbSize: DWORD;<br>&nbsp; &nbsp; Wnd: HWND;<br>&nbsp; &nbsp; uID: UINT;<br>&nbsp; &nbsp; uFlags: UINT;<br>&nbsp; &nbsp; uCallbackMessage: UINT;<br>&nbsp; &nbsp; hIcon: HICON;<br>&nbsp; &nbsp; szTip: array [0..63] of AnsiChar;<br>&nbsp; end;<br><br>到Win32 API 的帮助里查NOTIFYICONDATA,可以知道用法.
 
Hi Lala,<br><br>NotifyIconData contains information that the system needs to process<br>taskbar status area messages.<br><br>&nbsp; PNotifyIconDataA = ^TNotifyIconDataA;<br>&nbsp; PNotifyIconData = PNotifyIconDataA;<br>&nbsp; {$EXTERNALSYM _NOTIFYICONDATAA}<br>&nbsp; _NOTIFYICONDATAA = record<br>&nbsp; &nbsp; cbSize: DWORD;<br>&nbsp; &nbsp; Wnd: HWND;<br>&nbsp; &nbsp; uID: UINT;<br>&nbsp; &nbsp; uFlags: UINT;<br>&nbsp; &nbsp; uCallbackMessage: UINT;<br>&nbsp; &nbsp; hIcon: HICON;<br>&nbsp; &nbsp; szTip: array [0..63] of AnsiChar;<br>&nbsp; end;<br><br>Members<br><br>cbSize - Size of the NOTIFYICONDATA structure.<br><br>hWnd - Handle of the window that receives notification messages<br>associated with an icon in the taskbar status area. <br><br>uID - Application-defined identifier of the taskbar icon.<br><br>uFlags - Array of flags that indicate which of the other members<br>contain valid data. This member can be a combination of these<br>values:<br>&nbsp; NIF_ICON The hIcon member is valid. <br>&nbsp; NIF_MESSAGE The uCallbackMessage member is valid.<br>&nbsp; NIF_TIP The szTip member is valid.<br><br>uCallbackMessage - Application-defined message identifier. The system<br>uses the specified identifier for notification messages that it sends<br>to the window identified by hWnd whenever a mouse event occurs in the<br>bounding rectangle of the icon. <br><br>hIcon - Handle of the icon to add, modify, or delete. <br><br>szTip - Tooltip text to display for the icon.
 
const WM_MY_Notify=WM_USER+1001;<br>var<br>FPda:PNotifyIconData ;<br>HmyIcon:HIcon;<br>begin<br>&nbsp; new(FPda);<br>&nbsp; FPda^.cbsize:=sizeof(TNotifyIcondata);<br>&nbsp; //cbsize为TNotifyIcondata的字节数<br>&nbsp; FPda^.wnd:=frm_main.handle;//建立图标的父窗口的句柄<br>&nbsp; FPda^.uID:=0;//为同组图标的统一标识符<br>&nbsp; FPda^.Uflags:=NIF_MESSAGE or NIF_ICON or NIF_TIP;<br>&nbsp; //表示下面三个参数是否有效(NIF_MESSAGE 表示FPda^.uCallbackMessage是否有效,依次类推)<br>&nbsp; FPda^.uCallbackMessage:=WM_MY_Notify;<br>&nbsp; //定义触发的消息标识<br>&nbsp; FPda^.hicon:=HmyIcon;//定义图标的句柄<br>&nbsp; strcopy(FPda^.sztip,pchar(atip));//定义Mouse放在ICON上的显示的Tip<br>&nbsp; res:=Shell_NotifyIcon(NIM_Add,ptnd);<br>&nbsp; //第一个参数为NIM_Add表示添加ICON;<br>&nbsp; //为NIM_Delete表示删除ICON<br>&nbsp; //为NIM_modify表示变更ICON<br>&nbsp; dispose(FPda);<br>end;<br><br>还不够详细的话,如果你安装了鸟飞4。0 你可以到其菜单中的HELP中的MS SDK HELP FILES<br>子菜单中选择Win32 programmer's reference的帮助里查NOTIFYICONDATA,可以知道详细用法.<br>
 
记住一点PNOTIFYICONDATA中“p....”开始的类型表明一个指针变量,<br>而Api帮助不会提供一个指针的help,它只会提供你一个指向数据块<br>的帮助。所以你应当查NOTIFYICONDATA,而不是PNOTIFYICONDATA。<br>另外,不知道Delphi3中的help是否能查到它,我已经不过D3中联机<br>的api手册了。我用一份在网上down到的api手册,12M,比D3的酷多<br>了。我的这份help中的描述和huizhang提供的是一致的,不过是结构<br>描述是C语法的:<br>typedef struct _NOTIFYICONDATA { // nid &nbsp;<br>&nbsp; &nbsp; DWORD cbSize; <br>&nbsp; &nbsp; HWND hWnd; <br>&nbsp; &nbsp; UINT uID; <br>&nbsp; &nbsp; UINT uFlags; <br>&nbsp; &nbsp; UINT uCallbackMessage; <br>&nbsp; &nbsp; HICON hIcon; <br>&nbsp; &nbsp; char szTip[64]; <br>} NOTIFYICONDATA, *PNOTIFYICONDATA; <br>——不会看不明白吧。 嘻嘻。
 
多人接受答案了。
 
后退
顶部