diff options
author | mdejong <mdejong> | 2005-12-10 01:42:01 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2005-12-10 01:42:01 (GMT) |
commit | 19c205379f4bd33606ed447a19d1040881f12020 (patch) | |
tree | ed46ca0b99f2be7b32fff520459b47df06f77602 /win | |
parent | 4ddd58307b04e25e740d0388a99d530cd18bf715 (diff) | |
download | tk-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.
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinWm.c | 49 |
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) { |