Author: pschweitzer
Date: Sun Nov 25 20:08:13 2007
New Revision: 30744
URL:
http://svn.reactos.org/svn/reactos?rev=30744&view=rev
Log:
Simplified code
Modified:
trunk/rosapps/downloader/main.c
Modified: trunk/rosapps/downloader/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/main.c?rev=3074…
==============================================================================
--- trunk/rosapps/downloader/main.c (original)
+++ trunk/rosapps/downloader/main.c Sun Nov 25 20:08:13 2007
@@ -364,7 +364,7 @@
&hKey) != ERROR_SUCCESS)
return FALSE;
- SendMessage(GetDlgItem(hwnd, IDC_DOWNLOAD_FOLDER_EDIT), WM_GETTEXT,
sizeof(szBuf)/sizeof(TCHAR), (LPARAM)szBuf);
+ GetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, szBuf, sizeof(szBuf) / sizeof(TCHAR));
if (GetFileAttributes(szBuf) == 0xFFFFFFFF)
if (!CreateDirectory((LPCTSTR)szBuf,NULL))
{
@@ -380,7 +380,7 @@
(DWORD)(sizeof(szBuf) / sizeof(TCHAR))))
return FALSE;
- SendMessage(GetDlgItem(hwnd, IDC_UPDATE_SERVER_EDIT), WM_GETTEXT,
sizeof(szBuf)/sizeof(TCHAR), (LPARAM)szBuf);
+ GetDlgItemText(hwnd, IDC_UPDATE_SERVER_EDIT, szBuf, sizeof(szBuf) / sizeof(TCHAR));
if (RegSetValueEx(hKey,
L"UpdateServer",
0,
@@ -390,7 +390,7 @@
return FALSE;
DWORD dwValue;
- if (SendMessage(GetDlgItem(hwnd, IDC_DELINST_FILES_CHECKBOX), BM_GETCHECK, 0, 0) ==
BST_CHECKED)
+ if (SendDlgItemMessage(hwnd, IDC_DELINST_FILES_CHECKBOX, BM_GETCHECK, 0, 0) ==
BST_CHECKED)
dwValue = 0x1;
else
dwValue = 0x0;
@@ -436,7 +436,7 @@
(LPBYTE)&Buf,
&dwSize) == ERROR_SUCCESS)
{
- SendMessage(GetDlgItem(hwnd, IDC_DOWNLOAD_FOLDER_EDIT), WM_SETTEXT, -1, (LPARAM)Buf);
+ SetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, Buf);
}
else
{
@@ -466,7 +466,7 @@
{
if (GetFileAttributes(DPath) == 0xFFFFFFFF)
if (!CreateDirectory((LPCTSTR)DPath,NULL)) return FALSE;
- SendMessage(GetDlgItem(hwnd, IDC_DOWNLOAD_FOLDER_EDIT), WM_SETTEXT, -1,
(LPARAM)DPath);
+ SetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, DPath);
}
}
@@ -478,7 +478,7 @@
(LPBYTE)&Buf,
&dwSize) == ERROR_SUCCESS)
{
- SendMessage(GetDlgItem(hwnd, IDC_UPDATE_SERVER_EDIT), WM_SETTEXT, -1, (LPARAM)Buf);
+ SetDlgItemText(hwnd, IDC_UPDATE_SERVER_EDIT, Buf);
}
else
{
@@ -492,7 +492,7 @@
return FALSE;
else
{
- SendMessage(GetDlgItem(hwnd, IDC_UPDATE_SERVER_EDIT), WM_SETTEXT, -1, (LPARAM)Buf);
+ SetDlgItemText(hwnd, IDC_UPDATE_SERVER_EDIT, Buf);
}
}
@@ -506,7 +506,7 @@
&dwSize) == ERROR_SUCCESS)
{
if (dwValue == 0x1)
- SendMessage(GetDlgItem(hwnd, IDC_DELINST_FILES_CHECKBOX), BM_SETCHECK, 1, 1);
+ SendDlgItemMessage(hwnd, IDC_DELINST_FILES_CHECKBOX, BM_SETCHECK, 1, 1);
}
else
{
@@ -545,7 +545,7 @@
SHGetPathFromIDList(lpItemList, szPath);
if (_tcslen(szPath) == 0) return FALSE;
- SendMessage(GetDlgItem(hwnd, IDC_DOWNLOAD_FOLDER_EDIT), WM_SETTEXT, -1,
(LPARAM)szPath);
+ SetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, szPath);
return TRUE;
}