📄 addfriend.cpp
字号:
#include <windows.h>
#include "Resource.h"
#include "CmnHdr.h"
TCHAR szNewIP[20];
//////////////////////////////////////////////////////////////////////////////////////
void Addfriend_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
switch(id)
{
case IDCANCEL:
strcpy(szNewIP, "");
EndDialog(hwnd, id);
break;
case IDC_RESOLVE:
// resolve the host name to its corresponding IP address ...
MessageBox(NULL, "Not completed yet ......", "Messenger", 0);
break;
case IDOK:
HWND hwndIP = GetDlgItem(hwnd, IDC_IPADDRESS);
Edit_GetText(hwndIP, szNewIP, sizeof(szNewIP));
EndDialog(hwnd, id);
break;
}
}
BOOL Addfriend_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
chSETDLGICONS(hwnd, IDI_ICON1);
// enumerate the computers in the same local network, and add them to the list ...
return TRUE;
}
int WINAPI AddFriendDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
Addfriend_OnInitDialog(hwnd, NULL, 0);
break;
case WM_COMMAND:
Addfriend_OnCommand(hwnd, wParam, (HWND)lParam, NULL);
break;
}
return(FALSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -