Extended window flag

Fabian Cenedese Cenedese at indel.ch
Mon Dec 15 08:44:02 CST 2003


>> >>I have an application where I get the styles from a window with
>> >>
>> >>GetWindowLong(m_hWnd, GWL_EXSTYLE);
>> >>
>> >>In Windows I get 0x00000110 but in wine I get 0x40000110. From the wine
>> >>headers (mine seem to old) I get this means 'managed by the system'. Is
>> >>this something wine specific? Do I need to pay attention to this? If it's
>> >>a valid Windows flag why isn't it set in Windows? If it's just wine specific
>> >>can I just mask it out?
>> 
>> As these flags are only wine internal I don't know if it's right to give
>> them to the user. On the other hand (if this is needed/usefull) wine should
>> be capable of disregarding them if they are given to the CreateWnd
>> function. As it is now I need to change my application for wine (which
>> I did to continue work) but that shouldn't be desirable.
>
>I'd say internal Wine flags should definitely get masked out.
>And NOT by your external program, but by Wine itself (since it needs to be
>as compatible with Windows as possible).
>
>Whatever workaround you come up with in your program to make it
>Wine-compatible, rest assured that in > 95% of all cases it's a bad idea:
>we really need to get Wine fixed instead.
>
>Feel free to submit a patch correcting GetWindowLong and similar functions.

I would... but I'm not that familiar with the wine code. I don't know if this
function is also used internally where these flags are needed. But I tried.
Here it is.

bye  Fabi


Index: windows/win.c
===================================================================
RCS file: /home/wine/wine/windows/win.c,v
retrieving revision 1.230
diff -u -r1.230 win.c
--- windows/win.c       11 Dec 2003 05:34:53 -0000      1.230
+++ windows/win.c       15 Dec 2003 14:36:43 -0000
@@ -1880,7 +1880,7 @@
                 switch(offset)
                 {
                 case GWL_STYLE:     retvalue = reply->old_style; break;
-                case GWL_EXSTYLE:   retvalue = reply->old_ex_style; break;
+                case GWL_EXSTYLE:   retvalue = reply->old_ex_style&~(WS_EX_TRAYWINDOW|WS_EX_MANAGED); break;
                 case GWL_ID:        retvalue = reply->old_id; break;
                 case GWL_HINSTANCE: retvalue = (ULONG_PTR)reply->old_instance; break;
                 case GWL_USERDATA:  retvalue = (ULONG_PTR)reply->old_user_data; break;
@@ -1936,7 +1936,7 @@
     {
     case GWL_USERDATA:   retvalue = wndPtr->userdata; break;
     case GWL_STYLE:      retvalue = wndPtr->dwStyle; break;
-    case GWL_EXSTYLE:    retvalue = wndPtr->dwExStyle; break;
+    case GWL_EXSTYLE:    retvalue = wndPtr->dwExStyle&~(WS_EX_TRAYWINDOW|WS_EX_MANAGED); break;
     case GWL_ID:         retvalue = (LONG)wndPtr->wIDmenu; break;
     case GWL_WNDPROC:    retvalue = (LONG)WINPROC_GetProc( wndPtr->winproc, type ); break;
     case GWL_HINSTANCE:  retvalue = (LONG)wndPtr->hInstance; break;





More information about the wine-devel mailing list