commctl32 datetime styles synchronization fix
Siim Karus
siim04 at ut.ee
Fri Jan 6 13:21:31 CST 2006
As I was testing with OSE (binary: http://www.ut.ee/~siim04/OSE/OSE.exe ,
source: http://www.ut.ee/~siim04/OSE/OSE.cpp), I found that style information
returned by GetWindowLongPtr differs from what is stored in DATETIME_INFO
structure (infoPtr). I added some synchronizational lines (a call to
SetWindowLongPtr and a copy from window create structure). There seems to be
some strange problem with setting DTS_SHORTDATEFORMAT flag never reaches
DATETIME_StyleChanged . It seems the flag is being cancelled before it ever
reaches DATETIME control :(.
Siim Karus
-------------- next part --------------
Index: wine/dlls/comctl32/datetime.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/datetime.c,v
retrieving revision 1.62
diff -u -p -r1.62 datetime.c
--- wine/dlls/comctl32/datetime.c 8 Nov 2005 12:52:35 -0000 1.62
+++ wine/dlls/comctl32/datetime.c 4 Jan 2006 20:52:10 -0000
@@ -1157,6 +1157,11 @@ DATETIME_StyleChanged(DATETIME_INFO *inf
DestroyWindow(infoPtr->hUpdown);
infoPtr->hUpdown = 0;
}
+
+ if(lpss->styleNew != newStyle)
+ {
+ return SetWindowLongPtrW(infoPtr->hwndSelf,GWL_STYLE,lpss->styleNew);
+ }
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
return 0;
@@ -1193,6 +1198,9 @@ DATETIME_Create (HWND hwnd, LPCREATESTRU
DATETIME_StyleChanged(infoPtr, GWL_STYLE, &ss);
DATETIME_SetFormatW (infoPtr, 0);
+
+ lpcs->style = ss.styleNew;
+ infoPtr->dwStyle = lpcs->style;
/* create the monthcal control */
infoPtr->hMonthCal = CreateWindowExW (0, SysMonthCal32W, 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: siim04.vcf
Type: text/x-vcard
Size: 165 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060106/36fa2b3f/siim04.vcf
More information about the wine-patches
mailing list