summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdejong <mdejong>2005-12-10 01:42:01 (GMT)
committermdejong <mdejong>2005-12-10 01:42:01 (GMT)
commit19c205379f4bd33606ed447a19d1040881f12020 (patch)
treeed46ca0b99f2be7b32fff520459b47df06f77602
parent4ddd58307b04e25e740d0388a99d530cd18bf715 (diff)
downloadtk-19c205379f4bd33606ed447a19d1040881f12020.zip
tk-19c205379f4bd33606ed447a19d1040881f12020.tar.gz
tk-19c205379f4bd33606ed447a19d1040881f12020.tar.bz2
* win/tkWinWm.c (WinSetIcon): Don't check result
of SetClassLong() or SetClassLongPtr() since it was generating an incorrect error and the MSDN docs indicate that the result need not be checked.
-rw-r--r--ChangeLog8
-rw-r--r--win/tkWinWm.c49
2 files changed, 24 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index eb0900c..2e6f6ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2005-12-09 Mo DeJong <mdejong@users.sourceforge.net>
+ * win/tkWinWm.c (WinSetIcon): Don't check result
+ of SetClassLong() or SetClassLongPtr() since
+ it was generating an incorrect error and
+ the MSDN docs indicate that the result need
+ not be checked.
+
+2005-12-09 Mo DeJong <mdejong@users.sourceforge.net>
+
* win/configure: Regen.
* win/tcl.m4 (SC_CONFIG_CFLAGS): Define MACHINE
for gcc builds. The lack of a definition of this
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index cb423b7..80df397 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.106 2005/12/02 13:42:29 dkf Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.107 2005/12/10 01:42:01 mdejong Exp $
*/
#include "tkWinInt.h"
@@ -1091,41 +1091,24 @@ WinSetIcon(
}
} else {
ThreadSpecificData *tsdPtr;
-
- if (
-#ifdef _WIN64
- !SetClassLongPtr(hwnd, GCLP_HICONSM,
- (LPARAM)GetIcon(titlebaricon, ICON_SMALL))
-#else
- !SetClassLong(hwnd, GCL_HICONSM,
- (LPARAM)GetIcon(titlebaricon, ICON_SMALL))
-#endif
- ) {
- /*
- * For some reason this triggers, even though it seems to be
- * successful. This is probably related to the WNDCLASS vs
- * WNDCLASSEX difference. Anyway it seems we have to ignore
- * errors returned here.
- */
-
- /*
- Tcl_AppendResult(interp,"Unable to set new small icon",NULL);
- return TCL_ERROR;
- */
- }
-
- if (
+ /*
+ * Don't check return result of SetClassLong() or
+ * SetClassLongPtr() since they return the previously
+ * set value which is zero on the initial call or in
+ * an error case. The MSDN documentation does not
+ * indicate that the result needs to be checked.
+ */
#ifdef _WIN64
- !SetClassLongPtr(hwnd, GCLP_HICON,
- (LPARAM)GetIcon(titlebaricon, ICON_BIG))
+ SetClassLongPtr(hwnd, GCLP_HICONSM,
+ (LPARAM)GetIcon(titlebaricon, ICON_SMALL));
+ SetClassLongPtr(hwnd, GCLP_HICON,
+ (LPARAM)GetIcon(titlebaricon, ICON_BIG));
#else
- !SetClassLong(hwnd, GCL_HICON,
- (LPARAM)GetIcon(titlebaricon, ICON_BIG))
+ SetClassLong(hwnd, GCL_HICONSM,
+ (LPARAM)GetIcon(titlebaricon, ICON_SMALL));
+ SetClassLong(hwnd, GCL_HICON,
+ (LPARAM)GetIcon(titlebaricon, ICON_BIG));
#endif
- ) {
- Tcl_AppendResult(interp, "Unable to set new icon", NULL);
- return TCL_ERROR;
- }
tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->iconPtr != NULL) {