hi,
once i got this crash. i have ve filled a bug report:
http://bugs.winehq.com/show_bug.cgi?id=1503
now, inspired with a notice made by Andreas Mohr..:
Ah, WAIT!! Watcom has: ./h/nt/winuser.h:#define SBM_GETRANGE 0x00E3 /*not in win3.1 */
.i decided to dig into some details. and i've stopped at one unclear state. wine has a patch in cvs:
http://www.winehq.org/hypermail/wine-patches/2003/03/0052.html
which says:
As discussed with Alexandre, this patch makes the GetScroll* API functions send a message to the Window in the case of SB_CTL scroll bars.
- if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) - { - if (lpMin) lpMin = 0; - if (lpMax) lpMax = 0; - return FALSE; - } - if (lpMin) *lpMin = infoPtr->minVal; - if (lpMax) *lpMax = infoPtr->maxVal; - return TRUE; + /* Refer SB_CTL requests to the window */ + if (nBar == SB_CTL) + return SendMessageA(hwnd, SBM_GETRANGE, (WPARAM)lpMin, (LPARAM)lpMax); + else + return SCROLL_GetScrollRange(hwnd, nBar, lpMin, lpMax);
may now i ask someone for a help or explanation? the question is: if the win16 doesn't handle SBM_GETRANGE message, should wine send it in a case of win16 app? if no, then i'd like to start writing an additional check ;-).
and one more question. msdn states:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla...
If the nBar parameter is SB_CTL and the window specified by the hWnd parameter is not a system scroll bar control, the system sends the SBM_GETRANGE message to the window to obtain scroll bar information. This allows GetScrollRange to operate on a custom control that mimics a scroll bar.
aren't we missing one more check here? maybe we need to check class-name of control targeted by hwnd?
additional greps led me to:
[s2@katleriai wine-cvs]$ grep -A10 Scrollbar.messages wine/include/wine/winuser16.h /* Scrollbar messages */ #define SBM_SETPOS16 (WM_USER+0) #define SBM_GETPOS16 (WM_USER+1) #define SBM_SETRANGE16 (WM_USER+2) #define SBM_GETRANGE16 (WM_USER+3) #define SBM_ENABLE_ARROWS16 (WM_USER+4) #define SBM_SETRANGEREDRAW16 WM_NULL /* Not in Win16 */ #define SBM_SETSCROLLINFO16 WM_NULL /* Not in Win16 */ #define SBM_GETSCROLLINFO16 WM_NULL /* Not in Win16 */
/* CBT hook structures */
any ideas about where these constants came from? googling with "-wine" keyword gave me NULL :-/.
Saulius Krasuckas Saulius.Krasuckas@elst.vtu.lt writes:
may now i ask someone for a help or explanation? the question is: if the win16 doesn't handle SBM_GETRANGE message, should wine send it in a case of win16 app? if no, then i'd like to start writing an additional check ;-).
No, there is an SBM_GETRANGE16 message apparently, only it's not documented. What is needed is to investigate how that message is supposed to behave, and then implement the proper translation in WINPROC_MapMsg32ATo16.
If the nBar parameter is SB_CTL and the window specified by the hWnd parameter is not a system scroll bar control, the system sends the SBM_GETRANGE message to the window to obtain scroll bar information. This allows GetScrollRange to operate on a custom control that mimics a scroll bar.
aren't we missing one more check here? maybe we need to check class-name of control targeted by hwnd?
No I think our check is fine. If the scrollbar is a window then we send the message, if it's a system scrollbar (SB_HORZ or SB_VERT) we don't. Do not pay too much attention to the exact wording of the MSDN docs, they are not written by someone who really understands the code.
On Fri, 12 Dec 2003, Alexandre Julliard wrote:
No, there is an SBM_GETRANGE16 message apparently, only it's not documented. What is needed is to investigate how that message is supposed to behave, and then implement the proper translation in WINPROC_MapMsg32ATo16.
and what way could it be done in? do you mean writing win16 test app to catch that SBM_GETRANGE16 one? or is it just about handling of ordinary message (SBM_GETRANGE) under odinary win32 system? eghm.. can you explain the process of investigation by using some examples, please? i'd be glad to help.
Saulius Krasuckas Saulius.Krasuckas@elst.vtu.lt writes:
and what way could it be done in? do you mean writing win16 test app to catch that SBM_GETRANGE16 one? or is it just about handling of ordinary message (SBM_GETRANGE) under odinary win32 system? eghm.. can you explain the process of investigation by using some examples, please? i'd be glad to help.
In this case, you have to write a 16-bit app, create a 16-bit scrollbar window, and send it various SBM_GETRANGE16 messages and see what happens. The code itself is simple, the main problem is probably finding a development environment for 16-bit code.
Hi,
On Sat, Dec 13, 2003 at 03:14:42PM -0800, Alexandre Julliard wrote:
Saulius Krasuckas Saulius.Krasuckas@elst.vtu.lt writes:
and what way could it be done in? do you mean writing win16 test app to catch that SBM_GETRANGE16 one? or is it just about handling of ordinary message (SBM_GETRANGE) under odinary win32 system? eghm.. can you explain the process of investigation by using some examples, please? i'd be glad to help.
In this case, you have to write a 16-bit app, create a 16-bit scrollbar window, and send it various SBM_GETRANGE16 messages and see what happens. The code itself is simple, the main problem is probably finding a development environment for 16-bit code.
http://www.openwatcom.org might be useful for that... (if they still support Win16, which they should do)
Andreas Mohr
On Sat, 13 Dec 2003, Alexandre Julliard wrote:
In this case, you have to write a 16-bit app, create a 16-bit scrollbar window, and send it various SBM_GETRANGE16 messages and see what happens. The code itself is simple, the main problem is probably finding a development environment for 16-bit code.
ok. oh yeah, i was afraid i will need such extraordinary environment. eghm, only OpenWatcom v1.1 comes to my mind:
http://www.openwatcom.org/product/features_content.html
does anyone have reports about running it on WINE =)?
Saulius Krasuckas wrote:
On Sat, 13 Dec 2003, Alexandre Julliard wrote:
In this case, you have to write a 16-bit app, create a 16-bit scrollbar window, and send it various SBM_GETRANGE16 messages and see what happens. The code itself is simple, the main problem is probably finding a development environment for 16-bit code.
ok. oh yeah, i was afraid i will need such extraordinary environment. eghm, only OpenWatcom v1.1 comes to my mind:
http://www.openwatcom.org/product/features_content.html
does anyone have reports about running it on WINE =)?
The MSDN universal subscription also includes a Win16 compiler (MSVC 1.52, IIRC). I have not worked with OpenWatcom, but Watcom 11 had, I think, a better IDE.
On Sat, Dec 13, 2003 at 03:14:42PM -0800, Alexandre Julliard wrote:
Saulius Krasuckas Saulius.Krasuckas@elst.vtu.lt writes:
and what way could it be done in? do you mean writing win16 test app to catch that SBM_GETRANGE16 one? or is it just about handling of ordinary message (SBM_GETRANGE) under odinary win32 system? eghm.. can you explain the process of investigation by using some examples, please? i'd be glad to help.
In this case, you have to write a 16-bit app, create a 16-bit scrollbar window, and send it various SBM_GETRANGE16 messages and see what happens. The code itself is simple, the main problem is probably finding a development environment for 16-bit code.
Borland C++ 3.1 supports 16-bit Windows.
Saulius, maybe we can work something out? I have original CD with Borland C++ 3.1.
Borland C++ 3.1 also comes with "Teach Yourself C++ in 21 Days" http://www.amazon.com/exec/obidos/ASIN/0672310708/starwarsportal/002-1132319...