summaryrefslogtreecommitdiffstats
path: root/win/tkWinTest.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinTest.c')
-rw-r--r--win/tkWinTest.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index ed2e3e5..d361ad7 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -273,7 +273,7 @@ TestwineventCmd(
return TCL_ERROR;
}
- hwnd = (HWND) strtol(argv[1], &rest, 0);
+ hwnd = (HWND) INT2PTR(strtol(argv[1], &rest, 0));
if (rest == argv[1]) {
hwnd = FindWindow(NULL, argv[1]);
if (hwnd == NULL) {
@@ -390,7 +390,7 @@ TestfindwindowObjCmd(
AppendSystemError(interp, GetLastError());
r = TCL_ERROR;
} else {
- Tcl_SetObjResult(interp, Tcl_NewLongObj((long)hwnd));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(PTR2INT(hwnd)));
}
return r;
@@ -400,7 +400,7 @@ static BOOL CALLBACK
EnumChildrenProc(HWND hwnd, LPARAM lParam)
{
Tcl_Obj *listObj = (Tcl_Obj *)lParam;
- Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewLongObj((long)hwnd));
+ Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewLongObj(PTR2INT(hwnd)));
return TRUE;
}
@@ -426,10 +426,10 @@ TestgetwindowinfoObjCmd(
return TCL_ERROR;
if (tkWinProcs->useWide) {
- cch = GetClassNameW((HWND)hwnd, (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR));
+ cch = GetClassNameW(INT2PTR(hwnd), (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR));
classObj = Tcl_NewUnicodeObj((LPWSTR)buf, cch);
} else {
- cch = GetClassNameA((HWND)hwnd, (LPSTR)buf, sizeof(buf));
+ cch = GetClassNameA(INT2PTR(hwnd), (LPSTR)buf, sizeof(buf));
classObj = Tcl_NewStringObj((LPSTR)buf, cch);
}
if (cch == 0) {
@@ -444,9 +444,9 @@ TestgetwindowinfoObjCmd(
Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("id", -1));
Tcl_ListObjAppendElement(interp, resObj,
- Tcl_NewLongObj(GetWindowLong((HWND)hwnd, GWL_ID)));
+ Tcl_NewLongObj(GetWindowLong(INT2PTR(hwnd), GWL_ID)));
- cch = tkWinProcs->getWindowText((HWND)hwnd, (LPTSTR)buf, cchBuf);
+ cch = tkWinProcs->getWindowText(INT2PTR(hwnd), (LPTSTR)buf, cchBuf);
if (tkWinProcs->useWide) {
textObj = Tcl_NewUnicodeObj((LPCWSTR)buf, cch);
} else {
@@ -457,10 +457,10 @@ TestgetwindowinfoObjCmd(
Tcl_ListObjAppendElement(interp, resObj, textObj);
Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("parent", -1));
Tcl_ListObjAppendElement(interp, resObj,
- Tcl_NewLongObj((long)GetParent((HWND)hwnd)));
+ Tcl_NewLongObj(PTR2INT(GetParent(INT2PTR(hwnd)))));
childrenObj = Tcl_NewListObj(0, NULL);
- EnumChildWindows((HWND)hwnd, EnumChildrenProc, (LPARAM)childrenObj);
+ EnumChildWindows(INT2PTR(hwnd), EnumChildrenProc, (LPARAM)childrenObj);
Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("children", -1));
Tcl_ListObjAppendElement(interp, resObj, childrenObj);