#include "resource.h"
BOOL CALLBACK MainDlgProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);
HWND hDlgMain;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdParam, int nCmdShow)
{
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), HWND_DESKTOP, MainDlgProc);
return 0;
}
BOOL CALLBACK MainDlgProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
switch (iMessage)
{
case WM_INITDIALOG:
hDlgMain = hDlg;
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
EndDialog(hDlg, IDOK);
return TRUE;
case IDCANCEL:
EndDialog(hDlg, IDCANCEL);
return TRUE;
case IDC_BUTTON_COPY:
switch (HIWORD(wParam))
{
case BN_CLICKED:
TCHAR str[128];
GetDlgItemText(hDlg, IDC_EDIT_INPUT, str, sizeof(str) / sizeof(TCHAR));
SetDlgItemText(hDlg, IDC_EDIT_OUTPUT, str);
SetDlgItemInt(hDlg, IDC_EDIT_CHARNUM, lstrlen(str), FALSE);
return TRUE;
}
return TRUE;
}
return FALSE;
}
return FALSE;
}
'Code > C C++' 카테고리의 다른 글
| [C++] 16진수 문자열을 2진수 문자열로 변환 (0) | 2009.04.19 |
|---|---|
| [MFC] CString Sample (0) | 2009.03.17 |
| [C/C++] Dely (0) | 2008.11.09 |
| [C/C++] Beep (0) | 2008.11.09 |
| [C/C++] Change Cursor Sample Project (0) | 2008.11.06 |
Test.zip