Z
zjlqtx110110
Unregistered / Unconfirmed
GUEST, unregistred user!
我想做个电话弹屏的功能,即当电话打入时,应用程序会自动从拖盘上弹出。可在回调时却没任何反映。那位大侠请帮我看一下。我用的是USB接口的来电显示盒作为电话与电脑的连接。下面时该来电显示盒的API过程和函数; procedure Setup_Tel(DataWORD;B:integer);stdcall; external 'Sandu.dll'; 设定回调函数:(C++) void WINAPI Setup_Tel(void (__stdcall * fPost2User)(unsigned int),int getall=FALSE) 功能:设定回调函数 参数:1 fPost2User 回调函数地址;2 getall=0(默认) 返回值:1 成功;0 失败。 VB函数原型:Declare Sub Setup_Tel Lib "SANDU.DLL" (ByVal fPost2User As Long, ByVal getall As Long) function Begin_Tel(Port:integer;powerchar:char):integer;stdcall ; external 'Sandu.dll'; 1.开启“来电通”函数 :(C++) int WINAPI Begin_Tel(int port,Char app) 功能:开启“来电通” 参数:1 port 端口号,ap 保留 返回值:1 成功;0 失败。 VB函数原型:Declare Function Begin_Tel Lib "SANDU.DLL" (ByVal port As Long, ByVal ap As Long) As Long Delphi函数参考:function Begin_Tel(DIDN:integer;powerchar:Char):integer;stdcall ; far external 'Sandu.dll'; 以下是实现代码: procedure Test(aPort: integer);stdcall; var lpDataNotifyIconData; // TelNum: pchar; begin if aPort = 0 then begin mainform.IniDevList(nil); end else begin if IsIconic(mainform.Handle)=True then begin lpData := new(PNotifyIconDataA); lpData.cbSize := 88;//SizeOf(PNotifyIconDataA); lpData.Wnd := Mainform.Handle; lpData.hIcon := Mainform.Icon.Handle; lpData.uCallbackMessage := WM_BARICON; lpData.uID :=0; lpData.szTip := 'Samples'; lpData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP; Shell_NotifyIcon(NIM_DELETE,lpData); dispose(lpData); Mainform.Visible := True; end; end; end; procedure Tmainform.IniDevList(Sender: TObject); begin if Begin_Tel(1, #1) = 1 then ldtzt:=1 else ldtzt:=0; procedure Tmainform.FormCreate(Sender: TObject); begin IniDevList(nil); Setup_Tel(DWORD(@Test), 1); end;