win32_gui: gettting x64 build to work
This commit is contained in:
+17
-15
@@ -161,9 +161,9 @@ LRESULT CALLBACK NHMessageWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
||||
case WM_DESTROY:
|
||||
{
|
||||
PNHMessageWindow data;
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
free(data);
|
||||
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
|
||||
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)0);
|
||||
} break;
|
||||
|
||||
case WM_SIZE:
|
||||
@@ -174,7 +174,7 @@ LRESULT CALLBACK NHMessageWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
||||
PNHMessageWindow data;
|
||||
RECT rt;
|
||||
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
|
||||
xNewSize = LOWORD(lParam);
|
||||
yNewSize = HIWORD(lParam);
|
||||
@@ -239,7 +239,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PNHMessageWindow data;
|
||||
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
switch( wParam ) {
|
||||
case MSNH_MSG_PUTSTR:
|
||||
{
|
||||
@@ -273,7 +273,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
/* get the input */
|
||||
while (!okkey) {
|
||||
char c = mswin_nhgetch();
|
||||
int c = mswin_nhgetch();
|
||||
|
||||
switch (c)
|
||||
{
|
||||
@@ -378,12 +378,14 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
PNHMessageWindow data;
|
||||
SCROLLINFO si;
|
||||
int yInc;
|
||||
|
||||
/* get window data */
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cbSize = sizeof(si);
|
||||
@@ -460,7 +462,7 @@ void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
int xInc;
|
||||
|
||||
/* get window data */
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cbSize = sizeof(si);
|
||||
@@ -564,14 +566,13 @@ void onPaint(HWND hWnd)
|
||||
TCHAR wbuf[MAXWINDOWTEXT+2];
|
||||
size_t wlen;
|
||||
COLORREF OldBg, OldFg;
|
||||
int do_more = 0;
|
||||
|
||||
hdc = BeginPaint(hWnd, &ps);
|
||||
|
||||
OldBg = SetBkColor(hdc, message_bg_brush ? message_bg_color : (COLORREF)GetSysColor(DEFAULT_COLOR_BG_MSG));
|
||||
OldFg = setMsgTextColor(hdc, 0);
|
||||
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
|
||||
GetClientRect(hWnd, &client_rt);
|
||||
|
||||
@@ -652,6 +653,9 @@ void onPaint(HWND hWnd)
|
||||
|
||||
void onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
PNHMessageWindow data;
|
||||
SIZE dummy;
|
||||
|
||||
@@ -660,7 +664,7 @@ void onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
if( !data ) panic("out of memory");
|
||||
ZeroMemory(data, sizeof(NHMessageWindow));
|
||||
data->max_text = MAXWINDOWTEXT;
|
||||
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
|
||||
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)data);
|
||||
|
||||
/* re-calculate window size (+ font size) */
|
||||
mswin_message_window_size(hWnd, &dummy);
|
||||
@@ -674,7 +678,7 @@ void mswin_message_window_size (HWND hWnd, LPSIZE sz)
|
||||
PNHMessageWindow data;
|
||||
RECT rt, client_rt;
|
||||
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
if( !data ) return;
|
||||
|
||||
/* -- Calculate the font size -- */
|
||||
@@ -715,7 +719,7 @@ BOOL can_append_text(HWND hWnd, int attr, const char* text )
|
||||
RECT draw_rt;
|
||||
BOOL retval = FALSE;
|
||||
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
|
||||
/* cannot append if lines_not_seen is 0 (beginning of the new turn */
|
||||
if( data->lines_not_seen==0 ) return FALSE;
|
||||
@@ -760,13 +764,11 @@ BOOL more_prompt_check(HWND hWnd)
|
||||
HDC hdc;
|
||||
HGDIOBJ saveFont;
|
||||
RECT client_rt, draw_rt;
|
||||
BOOL retval = FALSE;
|
||||
int visible_lines = 0;
|
||||
int i;
|
||||
int remaining_height;
|
||||
char tmptext[MAXWINDOWTEXT+1];
|
||||
|
||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
|
||||
if( data->lines_not_seen==0 ) return FALSE; /* don't bother checking - nothig to "more" */
|
||||
if( data->lines_not_seen>=MSG_LINES ) return TRUE; /* history size exceeded - always more */
|
||||
|
||||
Reference in New Issue
Block a user