* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
-#include <windows.h>
-#include <commctrl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <tchar.h>
-
-#include "hexedit.h"
-
+#include <regedit.h>
typedef struct
{
HWND hWndSelf;
HLOCAL hBuffer;
DWORD style;
DWORD MaxBuffer;
- DWORD ColumnsPerLine;
- DWORD nLines;
- DWORD nVisibleLinesComplete;
- DWORD nVisibleLines;
+ INT ColumnsPerLine;
+ INT nLines;
+ INT nVisibleLinesComplete;
+ INT nVisibleLines;
INT Position;
INT LineHeight;
INT CharWidth;
SCROLLINFO si;
RECT rcClient;
BOOL SbVisible;
- DWORD bufsize, cvislines;
+ INT bufsize, cvislines;
GetClientRect(hed->hWndSelf, &rcClient);
hed->style = GetWindowLong(hed->hWndSelf, GWL_STYLE);
static VOID
HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWORD Last, RECT *rc)
{
- DWORD x, dx, dy, linestart;
+ DWORD dx, dy, linestart;
+ INT x;
PBYTE buf, current, end, line;
UINT bufsize;
TCHAR hex[3], addr[17];
{
if(hed->hBuffer)
{
- while(LocalUnlock(hed->hBuffer));
+ //while(LocalUnlock(hed->hBuffer));
LocalFree(hed->hBuffer);
}
SCROLLINFO si;
RECT rc;
HBITMAP hbmp, hbmpold;
- DWORD nLines, nFirst;
+ INT nLines, nFirst;
HFONT hOldFont;
HDC hTempDC;
DWORD height;
break;
case VK_RIGHT:
- if(hed->Position < bufsize)
+ if(hed->Position < (INT)bufsize)
{
if(++hed->CaretCol > hed->ColumnsPerLine)
{
break;
case VK_DOWN:
- if(hed->Position <= bufsize)
+ if(hed->Position <= (INT)bufsize)
{
if(hed->CaretLine < hed->nLines - 1)
{
hed->Position += hed->ColumnsPerLine;
hed->CaretLine++;
- if(hed->Position > bufsize)
+ if(hed->Position > (INT)bufsize)
{
hed->Position = bufsize;
hed->CaretLine = (hed->nLines > 0 ? hed->nLines - 1 : 0);
{
PHEXEDIT_DATA hed;
- hed = (PHEXEDIT_DATA)GetWindowLongPtr(hWnd, (DWORD_PTR)0);
+ hed = (PHEXEDIT_DATA)(LONG_PTR)GetWindowLongPtr(hWnd, (DWORD_PTR)0);
switch(uMsg)
{
case WM_ERASEBKGND: