fixed some warnings when compiling with msvc

svn path=/trunk/; revision=19740
This commit is contained in:
Christoph von Wittich 2005-11-29 01:48:25 +00:00
parent c5ad74b166
commit abe7b48501
7 changed files with 12 additions and 12 deletions

View file

@ -287,8 +287,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
_tcsncpy(pChildWnd->szPath, buffer, MAX_PATH); _tcsncpy(pChildWnd->szPath, buffer, MAX_PATH);
pChildWnd->nSplitPos = 250; pChildWnd->nSplitPos = 250;
pChildWnd->hWnd = hWnd; pChildWnd->hWnd = hWnd;
pChildWnd->hTreeWnd = CreateTreeView(hWnd, pChildWnd->szPath, TREE_WINDOW); pChildWnd->hTreeWnd = CreateTreeView(hWnd, pChildWnd->szPath, (HMENU) TREE_WINDOW);
pChildWnd->hListWnd = CreateListView(hWnd, LIST_WINDOW/*, pChildWnd->szPath*/); pChildWnd->hListWnd = CreateListView(hWnd, (HMENU) LIST_WINDOW/*, pChildWnd->szPath*/);
SetFocus(pChildWnd->hTreeWnd); SetFocus(pChildWnd->hTreeWnd);
break; break;
} }

View file

@ -248,7 +248,7 @@ LRESULT CALLBACK DwordEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
{ {
WNDPROC oldwndproc; WNDPROC oldwndproc;
oldwndproc = (WNDPROC)GetWindowLongPtr(hwnd, GWL_USERDATA); oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWL_USERDATA);
switch (uMsg) switch (uMsg)
{ {
@ -301,7 +301,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
/* subclass the edit control */ /* subclass the edit control */
hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA); hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
oldproc = (WNDPROC)GetWindowLongPtr(hwndValue, GWL_WNDPROC); oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwndValue, GWL_WNDPROC);
SetWindowLongPtr(hwndValue, GWL_USERDATA, (DWORD_PTR)oldproc); SetWindowLongPtr(hwndValue, GWL_USERDATA, (DWORD_PTR)oldproc);
SetWindowLongPtr(hwndValue, GWL_WNDPROC, (DWORD_PTR)DwordEditSubclassProc); SetWindowLongPtr(hwndValue, GWL_WNDPROC, (DWORD_PTR)DwordEditSubclassProc);

View file

@ -867,7 +867,7 @@ HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
PHEXEDIT_DATA hed; PHEXEDIT_DATA hed;
hed = (PHEXEDIT_DATA)GetWindowLongPtr(hWnd, (DWORD_PTR)0); hed = (PHEXEDIT_DATA)(LONG_PTR)GetWindowLongPtr(hWnd, (DWORD_PTR)0);
switch(uMsg) switch(uMsg)
{ {
case WM_ERASEBKGND: case WM_ERASEBKGND:

View file

@ -474,7 +474,7 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
} }
HWND CreateListView(HWND hwndParent, int id) HWND CreateListView(HWND hwndParent, HMENU id)
{ {
RECT rcClient; RECT rcClient;
HWND hwndLV; HWND hwndLV;
@ -484,7 +484,7 @@ HWND CreateListView(HWND hwndParent, int id)
hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"), hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"),
WS_VISIBLE | WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS, WS_VISIBLE | WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS,
0, 0, rcClient.right, rcClient.bottom, 0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)id, hInst, NULL); hwndParent, id, hInst, NULL);
if (!hwndLV) return NULL; if (!hwndLV) return NULL;
/* Initialize the image list, and add items to the control. */ /* Initialize the image list, and add items to the control. */

View file

@ -144,7 +144,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
DWORD dwError = GetLastError(); DWORD dwError = GetLastError();
} */ } */
hFrameWnd = CreateWindowEx(WS_EX_WINDOWEDGE, (LPCTSTR)(int)hFrameWndClass, szTitle, hFrameWnd = CreateWindowEx(WS_EX_WINDOWEDGE, (LPCTSTR)(UlongToPtr(hFrameWndClass)), szTitle,
WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, hMenuFrame, hInstance, NULL/*lpParam*/); NULL, hMenuFrame, hInstance, NULL/*lpParam*/);

View file

@ -99,14 +99,14 @@ extern BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCTSTR keyName);
extern BOOL ExportRegistryFile(HWND hWnd); extern BOOL ExportRegistryFile(HWND hWnd);
/* listview.c */ /* listview.c */
extern HWND CreateListView(HWND hwndParent, int id); extern HWND CreateListView(HWND hwndParent, HMENU id);
extern BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath); extern BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath);
extern LPCTSTR GetValueName(HWND hwndLV, int iStartAt); extern LPCTSTR GetValueName(HWND hwndLV, int iStartAt);
extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result); extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result);
extern BOOL IsDefaultValue(HWND hwndLV, int i); extern BOOL IsDefaultValue(HWND hwndLV, int i);
/* treeview.c */ /* treeview.c */
extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id); extern HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, HMENU id);
extern BOOL RefreshTreeView(HWND hWndTV); extern BOOL RefreshTreeView(HWND hWndTV);
extern BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem); extern BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem);
extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv); extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);

View file

@ -572,7 +572,7 @@ done:
* Returns the handle to the new control if successful, or NULL otherwise. * Returns the handle to the new control if successful, or NULL otherwise.
* hwndParent - handle to the control's parent window. * hwndParent - handle to the control's parent window.
*/ */
HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id) HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, HMENU id)
{ {
RECT rcClient; RECT rcClient;
HWND hwndTV; HWND hwndTV;
@ -582,7 +582,7 @@ HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id)
hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, NULL, hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, NULL,
WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_EDITLABELS, WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_EDITLABELS,
0, 0, rcClient.right, rcClient.bottom, 0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)id, hInst, NULL); hwndParent, id, hInst, NULL);
/* Initialize the image list, and add items to the control. */ /* Initialize the image list, and add items to the control. */
if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName)) { if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName)) {
DestroyWindow(hwndTV); DestroyWindow(hwndTV);