51 dwValueLength =
_tcslen(lpRawValue) + 1;
83 if (dwNameLength == 0 || dwValueLength == 0)
112 return dwValueLength;
126 if (NumberOfItems == 0)
132 dwValueLength = NumberOfItems - 1;
134 for (
i = 0;
i < NumberOfItems;
i++)
141 dwValueLength +=
_tcslen(szData);
158 for (
i = 0;
i < NumberOfItems;
i++)
171 return dwValueLength;
186 for (iItem = 0; iItem < iCount; iItem++)
230 DWORD dwSelectedValueIndex)
237 lvi.pszText =
_T(
"");
238 lvi.iItem = dwSelectedValueIndex;
280 for (lpToken =
_tcstok(lpTemp,
_T(
";")),
i = 0;
285 lvi.pszText = lpToken;
335 bi.hwndOwner = hwndDlg;
381 DWORD dwSrcIndex, dwDestIndex, dwLastIndex;
387 dwDestIndex = bMoveUp ? (dwSrcIndex - 1) : (dwSrcIndex + 1);
389 if ((bMoveUp && dwSrcIndex > 0) || (!bMoveUp && dwSrcIndex < dwLastIndex))
679 if (pnmv->item.iItem == -1)
702 if (
_tcscmp(szOldDir, szNewDir) == 0)
728 if (lpnmlv->
iItem != -1)
738 if (lpnmlv->
iItem == -1)
899 if (dwValueLength == 0)
1025 DWORD dwMaxValueNameLength;
1026 DWORD dwMaxValueDataLength;
1054 &dwMaxValueNameLength,
1055 &dwMaxValueDataLength,
1079 if (lpExpandData ==
NULL)
1087 for (
i = 0;
i < dwValues;
i++)
1089 dwNameLength = dwMaxValueNameLength + 1;
1090 dwDataLength = dwMaxValueDataLength + 1;
1113 VarData->
dwType = dwType;
1126 memset(&lvi, 0x00,
sizeof(lvi));
1128 lvi.lParam = (
LPARAM)VarData;
1129 lvi.pszText = VarData->
lpName;
1202 _T(
"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"));
1346 memset(&lvi, 0x00,
sizeof(lvi));
1398 y += (
cy - DlgData->
cyOld + 1) / 2;
1400 y -= (DlgData->
cyOld -
cy + 1) / 2;
1626 memset(&lvi, 0x00,
sizeof(lvi));
1629 for (
i = 0;
i < nItemCount;
i++)
1666 DWORD dwMaxValueNameLength;
1670 TCHAR szBuffer[256];
1673 memset(&lvi, 0x00,
sizeof(lvi));
1706 &dwMaxValueNameLength,
1715 if (dwValueCount > 0)
1719 if (aValueArray !=
NULL)
1722 for (
i = 0;
i < dwValueCount;
i++)
1745 for (
i = 0;
i < dwValueCount;
i++)
1747 if (aValueArray[
i] !=
NULL)
1785 lvi.iItem = ++iItem;
1846 DlgData->cxOld =
rect.right -
rect.left;
1847 DlgData->cyOld =
rect.bottom -
rect.top;
1850 DlgData->cxMin =
rect.right -
rect.left;
1851 DlgData->cyMin =
rect.bottom -
rect.top;
VOID ResourceMessageBox(HINSTANCE hInstance, HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
#define RegCloseKey(hKey)
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define OFN_FILEMUSTEXIST
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
static VOID OnNewVariable(HWND hwndDlg, INT iDlgItem)
static LRESULT CALLBACK ListViewSubclassProc(HWND hListBox, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
static VOID OnEnvironmentDlgResize(HWND hwndDlg, PENVIRONMENT_DIALOG_DATA DlgData, DWORD cx, DWORD cy)
INT_PTR CALLBACK EnvironmentDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static DWORD GatherDataFromEditBox(HWND hwndDlg, PVARIABLE_DATA VarData)
static BOOL OnNotify(HWND hwndDlg, NMHDR *phdr)
struct _VARIABLE_DATA * PVARIABLE_DATA
static BOOL DetermineDialogBoxType(LPTSTR lpRawValue)
static BOOL OnEndLabelEdit(NMLVDISPINFO *pnmv)
static VOID AddValuesToList(HWND hwndDlg, PEDIT_DIALOG_DATA DlgData)
static VOID AddEmptyItem(HWND hwndListView, DWORD dwSelectedValueIndex)
static INT GetSelectedListViewItem(HWND hwndListView)
static VOID OnEnvironmentEditDlgResize(HWND hwndDlg, PEDIT_DIALOG_DATA DlgData, DWORD cx, DWORD cy)
struct _ENVIRONMENT_DIALOG_DATA * PENVIRONMENT_DIALOG_DATA
static DWORD GatherDataFromListView(HWND hwndListView, PVARIABLE_DATA VarData)
static VOID GetEnvironmentVariables(HWND hwndListView, HKEY hRootKey, LPTSTR lpSubKeyName)
static VOID SetAllVars(HWND hwndDlg, INT iDlgItem)
static VOID OnEditVariable(HWND hwndDlg, INT iDlgItem)
static VOID BrowseRequiredFile(HWND hwndDlg)
static VOID SetEnvironmentDialogListViewColumns(HWND hwndListView)
static BOOL OnBeginLabelEdit(NMLVDISPINFO *pnmv)
static VOID OnDeleteVariable(HWND hwndDlg, INT iDlgItem)
static VOID MoveListItem(HWND hwndDlg, PEDIT_DIALOG_DATA DlgData, BOOL bMoveUp)
static BOOL OnNotifyEditVariableDlg(HWND hwndDlg, PEDIT_DIALOG_DATA DlgData, NMHDR *phdr)
static VOID OnInitEnvironmentDialog(HWND hwndDlg)
static INT_PTR CALLBACK EditVariableDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID ReleaseListViewItems(HWND hwndDlg, INT iDlgItem)
struct _VARIABLE_DATA VARIABLE_DATA
struct _ENVIRONMENT_EDIT_DIALOG_DATA * PEDIT_DIALOG_DATA
static VOID BrowseRequiredFolder(HWND hwndDlg, PEDIT_DIALOG_DATA DlgData)
struct _ENVIRONMENT_EDIT_DIALOG_DATA EDIT_DIALOG_DATA
struct _ENVIRONMENT_DIALOG_DATA ENVIRONMENT_DIALOG_DATA
#define IDC_BUTTON_EDIT_TEXT
#define IDC_USER_VARIABLE_GROUP
#define IDS_ENVIRONMENT_WARNING_TITLE
#define IDC_VARIABLE_NAME
#define IDC_SYSTEM_VARIABLE_GROUP
#define IDC_SYSTEM_VARIABLE_EDIT
#define IDC_BUTTON_BROWSE_FILE
#define IDS_ENVIRONMENT_WARNING
#define IDC_BUTTON_MOVE_DOWN
#define IDC_SYSTEM_VARIABLE_LIST
#define IDC_BUTTON_MOVE_UP
#define IDC_SYSTEM_VARIABLE_NEW
#define IDC_BUTTON_BROWSE_FOLDER
#define IDD_EDIT_VARIABLE
#define IDC_USER_VARIABLE_DELETE
#define IDC_SYSTEM_VARIABLE_DELETE
#define IDD_EDIT_VARIABLE_FANCY
#define IDS_FILE_BROWSE_FILTER
#define IDC_LIST_VARIABLE_VALUE
#define IDC_USER_VARIABLE_LIST
#define IDC_USER_VARIABLE_NEW
#define IDC_BUTTON_DELETE
#define IDC_VARIABLE_VALUE
#define IDC_USER_VARIABLE_EDIT
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
GLint GLint GLint GLint GLint GLint y
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
unsigned __int3264 UINT_PTR
#define REG_OPTION_NON_VOLATILE
_Out_opt_ int _Out_opt_ int * cy
#define ListView_InsertItem(hwnd, pitem)
#define ListView_SetItemState(hwndLV, i, data, mask)
#define ListView_EditLabel(hwndLV, i)
#define ListView_InsertColumn(hwnd, iCol, pcol)
#define ListView_GetEditControl(hwndLV)
_In_ SUBCLASSPROC _In_ UINT_PTR uIdSubclass
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
#define ListView_GetColumnWidth(hwnd, iCol)
#define ListView_SetColumnWidth(hwnd, iCol, cx)
#define LVS_EX_FULLROWSELECT
#define ListView_GetItemCount(hwnd)
#define LVN_BEGINLABELEDIT
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
struct tagNMLISTVIEW * LPNMLISTVIEW
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
#define ListView_Update(hwndLV, i)
_In_ SUBCLASSPROC _In_ UINT_PTR _In_ DWORD_PTR dwRefData
#define ListView_DeleteItem(hwnd, i)
#define LVSCW_AUTOSIZE_USEHEADER
#define ListView_GetItem(hwnd, pitem)
#define SHBrowseForFolder
#define BIF_NEWDIALOGSTYLE
#define SHGetPathFromIDList
ITEMIDLIST UNALIGNED * LPITEMIDLIST
DWORD dwSelectedValueIndex
#define ExpandEnvironmentStrings
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
#define SetWindowLongPtrW
#define SendDlgItemMessage
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)