Kana Dynamic IP Updater
Windows Message
Screen shots and information for Kana Dynamic IP Updater v4 is available
Check vulnerability report for Kana Dynamic IP Updater at Secunia (if any)
Question:
Can I get the messages broadcasted by Kana Dynamic IP Updater after an update or everytime its checking the IP address?
Answer:
After checking IP address and doing an update, Kana Dynamic IP Updater broadcasts Windows’ message to all top-level windows in the system. The message is broadcasted through POSTMESSAGE command. The structure and the name of the broadcasted message is explained below.
Message Name
The name of the message broadcasted by Kana Dynamic IP Updater is:
- After checking IP address: DYNDNS_UPDATER_CURRENT_IP
The message contains current IP address as detected by Kana Dynamic IP Updater - After update: DYNDNS_UPDATER_UPDATED_IP
The message contains updated IP address.
Message Command
The message is broadcasted by Kana Dynamic IP Updater by using the following command:
PostMessage(HWND_BROADCAST, Message_Name, wparam, lparam)
- the lower part of wparam contains the first part of IP address.
- the higher part of wparam contains the second part of IP address.
- the lower part of lparam contains the third part of IP address.
- the higher part of lparam contains the last part of IP address.
So, the IP address can be recovered by using WParamLo.WParamHi.LParamLo.LParamHi.
Code Snippet
The following code snippet in Delphi shows how to get the IP address:
const
Msg_Updated_IP = 'DYNDNS_UPDATER_UPDATED_IP';
Msg_Current_IP = 'DYNDNS_UPDATER_CURRENT_IP';
var
CurrentIPMsg : Cardinal;
UpdatedIPMsg : Cardinal;
procedure TForm1.FormCreate(Sender: TObject);
begin
CurrentIPMsg := RegisterWindowMessage(PChar(Msg_Current_IP));
UpdatedIPMsg := RegisterWindowMessage(PChar(Msg_Updated_IP));
Application.OnMessage := UserMessageHandler;
end;
procedure TForm1.UserMessageHandler(var MsgRec: TMsg;
var fHandled: Boolean);
var
IP1 : Word;
IP2 : Word;
IP3 : Word;
IP4 : Word;
begin
if (MsgRec.message = CurrentIPMsg) or
(MsgRec.message = UpdatedIPMsg) then begin
IP1 := LoWord(MsgRec.wParam);
IP2 := HiWord(MsgRec.wParam);
IP3 := LoWord(MsgRec.lParam);
IP4 := HiWord(MsgRec.lParam);
if MsgRec.message = CurrentIPMsg then
EditCurIP.Text := Format('%d.%d.%d.%d', [IP1, IP2, IP3, IP4])
else if MsgRec.message = UpdatedIPMsg then
EditUpdIP.Text := Format('%d.%d.%d.%d', [IP1, IP2, IP3, IP4]);
fHandled := True;
end;
end;
Get more information by using Google search


- A A A
- Back to top
- Last updated: Friday, December 10, 2010 10:24 pm

Post a Comment
Read Comments No comment yet Comment feed