LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
static HWND hIP;
switch (iMessage) {
case WM_CREATE: {
INITCOMMONCONTROLSEX icex;
hWndMain=hWnd;
icex.dwSize=sizeof(icex);
icex.dwICC=ICC_INTERNET_CLASSES;
InitCommonControlsEx(&icex);
hIP=CreateWindow(WC_IPADDRESS, NULL,WS_BORDER | WS_CHILD | WS_VISIBLE,
50,50,200,25,hWnd,NULL,g_hInst,NULL);
}
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_LBUTTONDOWN: {
DWORD Address;
SendMessage(hIP,IPM_GETADDRESS,0,(LPARAM)&Address);
... FIRST_IPADDRESS(Address) ... SECOND_IPADDRESS(Address) ... THIRD_IPADDRESS(Address) ... FOURTH_IPADDRESS(Address)) ...
}
return 0;
case WM_RBUTTONDOWN:
SendMessage(hIP,IPM_SETADDRESS,0,0x11223344);
return 0;
...
}
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}