Controlling Ozeki SMS with Windows Messages

Ozeki SMS can be controlled from any Windows application with the help of Windows Messages. This feature makes it possible to show or hide the main form of the application, to terminate the application or to display the message composer window. 

Here is a short example on how to do this. The following example uses three windows API calls, (FindWindow, PostMessage, SetForeGroundWindow), which are available in almost every programming language. The following example displays the Message Composer form by sending a windows message to the SMS Server. The example is written in Pascal.

Procedure showMessageComposer;
var
   hSMSForm : HWND;
Begin
   hSMSForm := FindWindow('TOzsmForm',nil);
   if (hSMSForm>0) then begin
      PostMessage (hSMSForm, WM_APP+803, 0, 0);
      SetForeGroundWindow(hSMSForm);
     
   end else begin
      Showmessage('Cannot find SMS server');
   end;
End;

The above shown example sends the WM_APP+803 message to the SMS Server. There are other messages you can use. 

WM_APP+801 Show Main Form
WM_APP+802 Hide Main Form
WM_APP+803 Show Message Composer Window
WM_APP+805 Close SMS Server Application

Here you can find an example created in Borland Delphi 6.0 to demonstrate this feature. The example includes an EXE demo and the source code.

Download it by clicking on the following link: smsDemo.zip


 

More information