summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authormdejong <mdejong>2005-12-10 01:42:01 (GMT)
committermdejong <mdejong>2005-12-10 01:42:01 (GMT)
commit783ec7669fda1a91e125c18146c450074753ded5 (patch)
treeed46ca0b99f2be7b32fff520459b47df06f77602 /win
parent643ec9cd35a3cafd941f95d5cdbe625acdbf66bc (diff)
downloadtk-783ec7669fda1a91e125c18146c450074753ded5.zip
tk-783ec7669fda1a91e125c18146c450074753ded5.tar.gz
tk-783ec7669fda1a91e125c18146c450074753ded5.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.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinWm.c49
1 files changed, 16 insertions, 33 deletions
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) {