Sample program of application software for business use
Install “SipTsr.exe”, and execute the following program.
// CallSip.cpp : Defines the entry point for the application.//
#include <Winuser.h> #include "stdafx.h"
#define IDC_BTN_TEN | 1 |
#define IDC_BTN_TEXT | 2 |
#define IDC_EDIT | 3 |
HINSTANCE hInst; | // The current instance |
TCHAR ClassName[] = TEXT( "CallSip"); | // Class name of this program |
TCHAR ClassName_TSR[] = TEXT("SipTsr"); | // Class name of "SipTsr" |
HWND hbCallTen; |
|
HWND hbCallText; |
|
HWND heText; |
|
BOOL CallSip( HWND, WPARAM); |
|
// ***************************************************************************************//
// | WndProc | // |
//***************************************************************************************//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_COMMAND:
if ( HIWORD(wParam) == BN_CLICKED) { CallSip( hWnd, LOWORD(wParam)); SetFocus( heText);
}
break;
case WM_CREATE:
hbCallTen = CreateWindow( TEXT("button"),
( WS_CHILD WS_VISIBLE BS_PUSHBUTTON), 20, 80, 90, 30, hWnd, (HMENU)IDC_BTN_TEN, (HANDLE)hInst, NULL);
hbCallText = CreateWindow( TEXT("button"), TEXT("Text Area"),
( WS_CHILD WS_VISIBLE BS_PUSHBUTTON), 120, 80, 90, 30, hWnd, (HMENU)IDC_BTN_TEXT, (HANDLE)hInst, NULL);
heText = CreateWindow( TEXT("edit"), TEXT("\0"),
( WS_CHILD WS_VISIBLE WS_BORDER ES_NOHIDESEL), 20, 40, 200, 20, hWnd, (HMENU)IDC_EDIT, hInst, NULL);
break;
case WM_DESTROY: PostQuitMessage(0); return 0;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
// ***************************************************************************************//
// | InitApplication | // |
//***************************************************************************************//
BOOL InitApplication (HINSTANCE hInstance)
{
WNDCLASSW wc;
31