More clean up of the Windows x64 build (trunk only)
This commit is contained in:
+3
-3
@@ -152,7 +152,7 @@ CALLBACK GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
|
|||||||
{
|
{
|
||||||
/* OK button was pressed */
|
/* OK button was pressed */
|
||||||
case IDOK:
|
case IDOK:
|
||||||
data = (struct getlin_data*)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (struct getlin_data*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
SendDlgItemMessage(hWnd, IDC_GETLIN_EDIT, WM_GETTEXT, (WPARAM)sizeof(wbuf), (LPARAM)wbuf );
|
SendDlgItemMessage(hWnd, IDC_GETLIN_EDIT, WM_GETTEXT, (WPARAM)sizeof(wbuf), (LPARAM)wbuf );
|
||||||
NH_W2A(wbuf, data->result, data->result_size);
|
NH_W2A(wbuf, data->result, data->result_size);
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ CALLBACK ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
data = (struct extcmd_data*)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (struct extcmd_data*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
/* OK button ws clicked */
|
/* OK button ws clicked */
|
||||||
@@ -378,7 +378,7 @@ CALLBACK PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
data = (struct plsel_data*)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (struct plsel_data*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam)) {
|
||||||
|
|
||||||
/* OK button was clicked */
|
/* OK button was clicked */
|
||||||
|
|||||||
+6
-6
@@ -213,7 +213,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam
|
|||||||
|
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
{
|
{
|
||||||
data = (PNHMainWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
/* translate arrow keys into nethack commands */
|
/* translate arrow keys into nethack commands */
|
||||||
switch (wParam)
|
switch (wParam)
|
||||||
@@ -524,7 +524,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, UINT wParam, LPARAM lParam
|
|||||||
WM_QUIT somehow */
|
WM_QUIT somehow */
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
free( (PNHMainWindow)GetWindowLong(hWnd, GWLP_USERDATA) );
|
free( (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA) );
|
||||||
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
|
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
|
||||||
|
|
||||||
// PostQuitMessage(0);
|
// PostQuitMessage(0);
|
||||||
@@ -584,7 +584,7 @@ void mswin_layout_main_window(HWND changed_child)
|
|||||||
|
|
||||||
if( GetNHApp()->bAutoLayout ) {
|
if( GetNHApp()->bAutoLayout ) {
|
||||||
GetClientRect(GetNHApp()->hMainWnd, &client_rt);
|
GetClientRect(GetNHApp()->hMainWnd, &client_rt);
|
||||||
data = (PNHMainWindow)GetWindowLong(GetNHApp()->hMainWnd, GWLP_USERDATA);
|
data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
/* get sizes of child windows */
|
/* get sizes of child windows */
|
||||||
wnd_status = mswin_hwnd_from_winid(WIN_STATUS);
|
wnd_status = mswin_hwnd_from_winid(WIN_STATUS);
|
||||||
@@ -754,7 +754,7 @@ LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
int wmId, wmEvent;
|
int wmId, wmEvent;
|
||||||
PNHMainWindow data;
|
PNHMainWindow data;
|
||||||
|
|
||||||
data = (PNHMainWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
wmId = LOWORD(wParam);
|
wmId = LOWORD(wParam);
|
||||||
wmEvent = HIWORD(wParam);
|
wmEvent = HIWORD(wParam);
|
||||||
|
|
||||||
@@ -1039,7 +1039,7 @@ void mswin_select_map_mode(int mode)
|
|||||||
winid map_id;
|
winid map_id;
|
||||||
|
|
||||||
map_id = WIN_MAP;
|
map_id = WIN_MAP;
|
||||||
data = (PNHMainWindow)GetWindowLong(GetNHApp()->hMainWnd, GWLP_USERDATA);
|
data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
/* override for Rogue level */
|
/* override for Rogue level */
|
||||||
#ifdef REINCARNATION
|
#ifdef REINCARNATION
|
||||||
@@ -1130,7 +1130,7 @@ void nhlock_windows( BOOL lock )
|
|||||||
for( i=0; i<MAXWINDOWS; i++ ) {
|
for( i=0; i<MAXWINDOWS; i++ ) {
|
||||||
if( IsWindow(GetNHApp()->windowlist[i].win) && !GetNHApp()->windowlist[i].dead) {
|
if( IsWindow(GetNHApp()->windowlist[i].win) && !GetNHApp()->windowlist[i].dead) {
|
||||||
DWORD style;
|
DWORD style;
|
||||||
style = GetWindowLong(GetNHApp()->windowlist[i].win, GWL_STYLE);
|
style = GetWindowLongPtr(GetNHApp()->windowlist[i].win, GWL_STYLE);
|
||||||
if( lock ) style &= ~WS_CAPTION;
|
if( lock ) style &= ~WS_CAPTION;
|
||||||
else style |= WS_CAPTION;
|
else style |= WS_CAPTION;
|
||||||
SetWindowLongPtr(GetNHApp()->windowlist[i].win, GWL_STYLE, style);
|
SetWindowLongPtr(GetNHApp()->windowlist[i].win, GWL_STYLE, style);
|
||||||
|
|||||||
+7
-7
@@ -106,7 +106,7 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw)
|
|||||||
wnd_size.cy = client_rt.bottom - client_rt.top;
|
wnd_size.cy = client_rt.bottom - client_rt.top;
|
||||||
|
|
||||||
/* set new screen tile size */
|
/* set new screen tile size */
|
||||||
data = (PNHMapWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
data->xScrTile =
|
data->xScrTile =
|
||||||
max(1, (data->bFitToScreenMode? wnd_size.cx : lpsz->cx) / COLNO);
|
max(1, (data->bFitToScreenMode? wnd_size.cx : lpsz->cx) / COLNO);
|
||||||
data->yScrTile =
|
data->yScrTile =
|
||||||
@@ -200,7 +200,7 @@ int mswin_map_mode(HWND hWnd, int mode)
|
|||||||
int oldMode;
|
int oldMode;
|
||||||
SIZE mapSize;
|
SIZE mapSize;
|
||||||
|
|
||||||
data = (PNHMapWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
if( mode == data->mapMode ) return mode;
|
if( mode == data->mapMode ) return mode;
|
||||||
|
|
||||||
oldMode = data->mapMode;
|
oldMode = data->mapMode;
|
||||||
@@ -333,7 +333,7 @@ LRESULT CALLBACK MapWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
|
|||||||
{
|
{
|
||||||
PNHMapWindow data;
|
PNHMapWindow data;
|
||||||
|
|
||||||
data = (PNHMapWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
@@ -427,7 +427,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
PNHMapWindow data;
|
PNHMapWindow data;
|
||||||
RECT rt;
|
RECT rt;
|
||||||
|
|
||||||
data = (PNHMapWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch(wParam) {
|
switch(wParam) {
|
||||||
case MSNH_MSG_PRINT_GLYPH:
|
case MSNH_MSG_PRINT_GLYPH:
|
||||||
{
|
{
|
||||||
@@ -590,7 +590,7 @@ void onPaint(HWND hWnd)
|
|||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
/* get window data */
|
/* get window data */
|
||||||
data = (PNHMapWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
hDC = BeginPaint(hWnd, &ps);
|
hDC = BeginPaint(hWnd, &ps);
|
||||||
|
|
||||||
@@ -750,7 +750,7 @@ void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
int yDelta;
|
int yDelta;
|
||||||
|
|
||||||
/* get window data */
|
/* get window data */
|
||||||
data = (PNHMapWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
switch(LOWORD (wParam))
|
switch(LOWORD (wParam))
|
||||||
{
|
{
|
||||||
@@ -808,7 +808,7 @@ void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
int xDelta;
|
int xDelta;
|
||||||
|
|
||||||
/* get window data */
|
/* get window data */
|
||||||
data = (PNHMapWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMapWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
switch(LOWORD (wParam))
|
switch(LOWORD (wParam))
|
||||||
{
|
{
|
||||||
|
|||||||
+12
-12
@@ -121,7 +121,7 @@ HWND mswin_init_menu_window (int type) {
|
|||||||
|
|
||||||
if( !GetNHApp()->bWindowsLocked ) {
|
if( !GetNHApp()->bWindowsLocked ) {
|
||||||
DWORD style;
|
DWORD style;
|
||||||
style = GetWindowLong(ret, GWL_STYLE);
|
style = GetWindowLongPtr(ret, GWL_STYLE);
|
||||||
style |= WS_CAPTION;
|
style |= WS_CAPTION;
|
||||||
SetWindowLongPtr(ret, GWL_STYLE, style);
|
SetWindowLongPtr(ret, GWL_STYLE, style);
|
||||||
SetWindowPos(ret, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
SetWindowPos(ret, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||||
@@ -143,7 +143,7 @@ int mswin_menu_window_select_menu (HWND hWnd, int how, MENU_ITEM_P ** _selected,
|
|||||||
*_selected = NULL;
|
*_selected = NULL;
|
||||||
ret_val = -1;
|
ret_val = -1;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
/* force activate for certain menu types */
|
/* force activate for certain menu types */
|
||||||
if( data->type == MENU_TYPE_MENU &&
|
if( data->type == MENU_TYPE_MENU &&
|
||||||
@@ -254,7 +254,7 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
|||||||
TCHAR title[MAX_LOADSTRING];
|
TCHAR title[MAX_LOADSTRING];
|
||||||
|
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
@@ -501,7 +501,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
PNHMenuWindow data;
|
PNHMenuWindow data;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch( wParam ) {
|
switch( wParam ) {
|
||||||
case MSNH_MSG_PUTSTR:
|
case MSNH_MSG_PUTSTR:
|
||||||
{
|
{
|
||||||
@@ -659,7 +659,7 @@ void LayoutMenu(HWND hWnd)
|
|||||||
POINT pt_elem, pt_ok, pt_cancel;
|
POINT pt_elem, pt_ok, pt_cancel;
|
||||||
SIZE sz_elem, sz_ok, sz_cancel;
|
SIZE sz_elem, sz_ok, sz_cancel;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
menu_ok = GetDlgItem(hWnd, IDOK);
|
menu_ok = GetDlgItem(hWnd, IDOK);
|
||||||
menu_cancel = GetDlgItem(hWnd, IDCANCEL);
|
menu_cancel = GetDlgItem(hWnd, IDCANCEL);
|
||||||
|
|
||||||
@@ -729,7 +729,7 @@ void SetMenuType(HWND hWnd, int type)
|
|||||||
PNHMenuWindow data;
|
PNHMenuWindow data;
|
||||||
HWND list, text;
|
HWND list, text;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
data->type = type;
|
data->type = type;
|
||||||
|
|
||||||
@@ -764,7 +764,7 @@ void SetMenuListType(HWND hWnd, int how)
|
|||||||
LVCOLUMN lvcol;
|
LVCOLUMN lvcol;
|
||||||
LRESULT fnt;
|
LRESULT fnt;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
if( data->type != MENU_TYPE_MENU ) return;
|
if( data->type != MENU_TYPE_MENU ) return;
|
||||||
|
|
||||||
data->how = how;
|
data->how = how;
|
||||||
@@ -853,7 +853,7 @@ HWND GetMenuControl(HWND hWnd)
|
|||||||
{
|
{
|
||||||
PNHMenuWindow data;
|
PNHMenuWindow data;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
if(data->type==MENU_TYPE_TEXT) {
|
if(data->type==MENU_TYPE_TEXT) {
|
||||||
return GetDlgItem(hWnd, IDC_MENU_TEXT);
|
return GetDlgItem(hWnd, IDC_MENU_TEXT);
|
||||||
@@ -873,7 +873,7 @@ BOOL onMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
lpmis = (LPMEASUREITEMSTRUCT) lParam;
|
lpmis = (LPMEASUREITEMSTRUCT) lParam;
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
GetClientRect(GetMenuControl(hWnd), &list_rect);
|
GetClientRect(GetMenuControl(hWnd), &list_rect);
|
||||||
|
|
||||||
hdc = GetDC(GetMenuControl(hWnd));
|
hdc = GetDC(GetMenuControl(hWnd));
|
||||||
@@ -921,7 +921,7 @@ BOOL onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
/* If there are no list box items, skip this message. */
|
/* If there are no list box items, skip this message. */
|
||||||
if (lpdis->itemID == -1) return FALSE;
|
if (lpdis->itemID == -1) return FALSE;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
item = &data->menu.items[lpdis->itemID];
|
item = &data->menu.items[lpdis->itemID];
|
||||||
|
|
||||||
@@ -1118,7 +1118,7 @@ BOOL onListChar(HWND hWnd, HWND hwndList, WORD ch)
|
|||||||
int curIndex, topIndex, pageSize;
|
int curIndex, topIndex, pageSize;
|
||||||
boolean is_accelerator = FALSE;
|
boolean is_accelerator = FALSE;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
switch( ch ) {
|
switch( ch ) {
|
||||||
case MENU_FIRST_PAGE:
|
case MENU_FIRST_PAGE:
|
||||||
@@ -1435,7 +1435,7 @@ void mswin_menu_window_size (HWND hWnd, LPSIZE sz)
|
|||||||
RECT rt, wrt;
|
RECT rt, wrt;
|
||||||
int extra_cx;
|
int extra_cx;
|
||||||
|
|
||||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
if(data) {
|
if(data) {
|
||||||
control = GetMenuControl(hWnd);
|
control = GetMenuControl(hWnd);
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ LRESULT CALLBACK NHMessageWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
{
|
{
|
||||||
PNHMessageWindow data;
|
PNHMessageWindow data;
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
free(data);
|
free(data);
|
||||||
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
|
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)0);
|
||||||
} break;
|
} break;
|
||||||
@@ -173,7 +173,7 @@ LRESULT CALLBACK NHMessageWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
PNHMessageWindow data;
|
PNHMessageWindow data;
|
||||||
RECT rt;
|
RECT rt;
|
||||||
|
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
xNewSize = LOWORD(lParam);
|
xNewSize = LOWORD(lParam);
|
||||||
yNewSize = HIWORD(lParam);
|
yNewSize = HIWORD(lParam);
|
||||||
@@ -238,7 +238,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
PNHMessageWindow data;
|
PNHMessageWindow data;
|
||||||
|
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch( wParam ) {
|
switch( wParam ) {
|
||||||
case MSNH_MSG_PUTSTR:
|
case MSNH_MSG_PUTSTR:
|
||||||
{
|
{
|
||||||
@@ -382,7 +382,7 @@ void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
int yInc;
|
int yInc;
|
||||||
|
|
||||||
/* get window data */
|
/* get window data */
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
ZeroMemory(&si, sizeof(si));
|
ZeroMemory(&si, sizeof(si));
|
||||||
si.cbSize = sizeof(si);
|
si.cbSize = sizeof(si);
|
||||||
@@ -459,7 +459,7 @@ void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
int xInc;
|
int xInc;
|
||||||
|
|
||||||
/* get window data */
|
/* get window data */
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
ZeroMemory(&si, sizeof(si));
|
ZeroMemory(&si, sizeof(si));
|
||||||
si.cbSize = sizeof(si);
|
si.cbSize = sizeof(si);
|
||||||
@@ -570,7 +570,7 @@ void onPaint(HWND hWnd)
|
|||||||
OldBg = SetBkColor(hdc, message_bg_brush ? message_bg_color : (COLORREF)GetSysColor(DEFAULT_COLOR_BG_MSG));
|
OldBg = SetBkColor(hdc, message_bg_brush ? message_bg_color : (COLORREF)GetSysColor(DEFAULT_COLOR_BG_MSG));
|
||||||
OldFg = setMsgTextColor(hdc, 0);
|
OldFg = setMsgTextColor(hdc, 0);
|
||||||
|
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
GetClientRect(hWnd, &client_rt);
|
GetClientRect(hWnd, &client_rt);
|
||||||
|
|
||||||
@@ -673,7 +673,7 @@ void mswin_message_window_size (HWND hWnd, LPSIZE sz)
|
|||||||
PNHMessageWindow data;
|
PNHMessageWindow data;
|
||||||
RECT rt, client_rt;
|
RECT rt, client_rt;
|
||||||
|
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
if( !data ) return;
|
if( !data ) return;
|
||||||
|
|
||||||
/* -- Calculate the font size -- */
|
/* -- Calculate the font size -- */
|
||||||
@@ -714,7 +714,7 @@ BOOL can_append_text(HWND hWnd, int attr, const char* text )
|
|||||||
RECT draw_rt;
|
RECT draw_rt;
|
||||||
BOOL retval = FALSE;
|
BOOL retval = FALSE;
|
||||||
|
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHMessageWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
/* cannot append if lines_not_seen is 0 (beginning of the new turn */
|
/* cannot append if lines_not_seen is 0 (beginning of the new turn */
|
||||||
if( data->lines_not_seen==0 ) return FALSE;
|
if( data->lines_not_seen==0 ) return FALSE;
|
||||||
@@ -765,7 +765,7 @@ BOOL more_prompt_check(HWND hWnd)
|
|||||||
int remaining_height;
|
int remaining_height;
|
||||||
char tmptext[MAXWINDOWTEXT+1];
|
char tmptext[MAXWINDOWTEXT+1];
|
||||||
|
|
||||||
data = (PNHMessageWindow)GetWindowLong(hWnd, GWLP_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==0 ) return FALSE; /* don't bother checking - nothig to "more" */
|
||||||
if( data->lines_not_seen>=MSG_LINES ) return TRUE; /* history size exceeded - always more */
|
if( data->lines_not_seen>=MSG_LINES ) return TRUE; /* history size exceeded - always more */
|
||||||
|
|||||||
+3
-3
@@ -62,7 +62,7 @@ void mswin_display_RIP_window (HWND hWnd)
|
|||||||
HDC hdc;
|
HDC hdc;
|
||||||
HFONT OldFont;
|
HFONT OldFont;
|
||||||
|
|
||||||
data = (PNHRIPWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHRIPWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
GetNHApp()->hPopupWnd = hWnd;
|
GetNHApp()->hPopupWnd = hWnd;
|
||||||
mapWnd = mswin_hwnd_from_winid(WIN_MAP);
|
mapWnd = mswin_hwnd_from_winid(WIN_MAP);
|
||||||
@@ -122,7 +122,7 @@ LRESULT CALLBACK NHRIPWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
HDC hdc;
|
HDC hdc;
|
||||||
PNHRIPWindow data;
|
PNHRIPWindow data;
|
||||||
|
|
||||||
data = (PNHRIPWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHRIPWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
@@ -229,7 +229,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
PNHRIPWindow data;
|
PNHRIPWindow data;
|
||||||
static int InRipText = 1;
|
static int InRipText = 1;
|
||||||
data = (PNHRIPWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHRIPWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch( wParam ) {
|
switch( wParam ) {
|
||||||
case MSNH_MSG_PUTSTR: {
|
case MSNH_MSG_PUTSTR: {
|
||||||
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;
|
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ LRESULT CALLBACK StatusWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
|
|||||||
HDC hdc;
|
HDC hdc;
|
||||||
PNHStatusWindow data;
|
PNHStatusWindow data;
|
||||||
|
|
||||||
data = (PNHStatusWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHStatusWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case WM_MSNH_COMMAND: {
|
case WM_MSNH_COMMAND: {
|
||||||
@@ -197,7 +197,7 @@ void mswin_status_window_size (HWND hWnd, LPSIZE sz)
|
|||||||
sz->cx = rt.right - rt.left;
|
sz->cx = rt.right - rt.left;
|
||||||
sz->cy = rt.bottom - rt.top;
|
sz->cy = rt.bottom - rt.top;
|
||||||
|
|
||||||
data = (PNHStatusWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHStatusWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
if(data) {
|
if(data) {
|
||||||
hdc = GetDC(hWnd);
|
hdc = GetDC(hWnd);
|
||||||
saveFont = SelectObject(hdc, mswin_get_font(NHW_STATUS, ATR_NONE, hdc, FALSE));
|
saveFont = SelectObject(hdc, mswin_get_font(NHW_STATUS, ATR_NONE, hdc, FALSE));
|
||||||
|
|||||||
+4
-4
@@ -53,7 +53,7 @@ HWND mswin_init_text_window () {
|
|||||||
SetWindowText(ret, "Text");
|
SetWindowText(ret, "Text");
|
||||||
if( !GetNHApp()->bWindowsLocked ) {
|
if( !GetNHApp()->bWindowsLocked ) {
|
||||||
DWORD style;
|
DWORD style;
|
||||||
style = GetWindowLong(ret, GWL_STYLE);
|
style = GetWindowLongPtr(ret, GWL_STYLE);
|
||||||
style |= WS_CAPTION;
|
style |= WS_CAPTION;
|
||||||
SetWindowLongPtr(ret, GWL_STYLE, style);
|
SetWindowLongPtr(ret, GWL_STYLE, style);
|
||||||
SetWindowPos(ret, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
SetWindowPos(ret, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||||
@@ -71,7 +71,7 @@ void mswin_display_text_window (HWND hWnd)
|
|||||||
{
|
{
|
||||||
PNHTextWindow data;
|
PNHTextWindow data;
|
||||||
|
|
||||||
data = (PNHTextWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHTextWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
if( data && data->window_text ) {
|
if( data && data->window_text ) {
|
||||||
HWND control;
|
HWND control;
|
||||||
control = GetDlgItem(hWnd, IDC_TEXT_CONTROL);
|
control = GetDlgItem(hWnd, IDC_TEXT_CONTROL);
|
||||||
@@ -90,7 +90,7 @@ LRESULT CALLBACK NHTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
|
|||||||
PNHTextWindow data;
|
PNHTextWindow data;
|
||||||
TCHAR title[MAX_LOADSTRING];
|
TCHAR title[MAX_LOADSTRING];
|
||||||
|
|
||||||
data = (PNHTextWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHTextWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
@@ -191,7 +191,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
PNHTextWindow data;
|
PNHTextWindow data;
|
||||||
|
|
||||||
data = (PNHTextWindow)GetWindowLong(hWnd, GWLP_USERDATA);
|
data = (PNHTextWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
switch( wParam ) {
|
switch( wParam ) {
|
||||||
case MSNH_MSG_PUTSTR: {
|
case MSNH_MSG_PUTSTR: {
|
||||||
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;
|
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;
|
||||||
|
|||||||
Reference in New Issue
Block a user