Hi
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?
Thanks
bye Fabi
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?
Ok, I should look closer at the source :) It's wine internal. Am I on the safe side if I mask the upper flags (0x4..., 0x8...) out?
Thanks
bye Fabi
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?
Ok, I should look closer at the source :) It's wine internal. Am I on the safe side if I mask the upper flags (0x4..., 0x8...) out?
Three is the number, now I finally come to the reason of my questions :)
In our application we have a streaming mechanism where we save all info about a window (title, size, position, styles...) so upon loading we can recreate it exactly as it was before. On Windows I get some styles back, save them and can use them to create the window with
CreateWnd(Text, ExtStyle, Style, WndRect, MinPos, Parent);
On wine the extended styles are different as described above. If I now try to create a window with these different flags it fails for both Windows and wine. But it works if I mask them 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.
Thanks
bye Fabi
Hi,
On Mon, Dec 15, 2003 at 02:32:39PM +0100, Fabian Cenedese wrote:
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?
Ok, I should look closer at the source :) It's wine internal. Am I on the safe side if I mask the upper flags (0x4..., 0x8...) out?
Three is the number, now I finally come to the reason of my questions :)
In our application we have a streaming mechanism where we save all info about a window (title, size, position, styles...) so upon loading we can recreate it exactly as it was before. On Windows I get some styles back, save them and can use them to create the window with
CreateWnd(Text, ExtStyle, Style, WndRect, MinPos, Parent);
On wine the extended styles are different as described above. If I now try to create a window with these different flags it fails for both Windows and wine. But it works if I mask them 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.
Greetings,
Andreas Mohr
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;
Hi,
On Mon, Dec 15, 2003 at 03:44:02PM +0100, Fabian Cenedese wrote:
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.
Well, I'm afraid not too many people are familiar enough with Wine to be able to tell it by heart whether there's a problem. Actually probably only one particular person ;-) I guess it's simply a matter of making sure it gets fixed and creating facts, and if those facts turn out to break some other code, then it's tough luck and this code will have to be changed to call another (newly created?) internal function. DLL separation might bite us here, though (if it's happening in a different DLL with thus only the standard GetWindow...() functions being available).
Here it is.
Thanks!
"Andreas Mohr" andi@rhlx01.fht-esslingen.de wrote:
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.
Since the constructs like
if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_MANAGED) bla-bla;
are extensively used internally in Wine itself (for instance in the x11drv code) that's not a solution at all.