Release 940614
Tue Jun 14 08:09:14 1994 Bob Amstadt (bob@pooh) * loader/selector.c (GetCurrentPDB): Added trivial function GetCurrentPDB() which returns the program segment prefix selector. * memory/heap.c (HEAP_Free): If free list is empty, make the freed block the free list. Fri Jun 10 07:56:49 1994 Bob Amstadt (bob@pooh) * controls/edit.c (EDIT_SetTextMsg): Do not append a newline at the end of the last line. * windows/event.c (SetCapture): Set winHasCursor if mouse capture succeeds. Jun 13, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [controls/listbox.c] Fix bug in listbox : InsertString should call AddString if -1. * [controls/menu.c] New function GetMenuState(). * [controls/scroll.c] [windows/nonclient.c] Try to make ShowScrollBar() recalc NC_ regions. Not finished ! * [objects/text.c] Add Stub for TabbedTextOut(), which temporarely call Textout(). * [windows/keyboard.c] [windows/event.c] New function GetKeyBoardState() with an KeyStateTable array & associated handling in function EVENT_key(). Mon Jun 13 16:45:24 MET DST 1994 (erik@hacktic.nl) * [controls/menu.c] IsMenu() added. * [loader/library.c] ModuleFirst(), ModuleNext(), ModuleFindName(), ModuleFindHandle() added. * [object/gdiobj.c] IsGDIObject() added. * [miscemu/int2[56].c] bugfix: both didn't leave flags pushed on 16bit-stack. (winfile gets a bit further) * [miscemu/int16.c] Added (empty). Sat Jun 11 22:56:48 1994 Jon Tombs (jon@esix2.us.es) * windows/event.c: Added code to drop redundant motion Events in the XEvent queue. Thu Jun 9 10:55:55 MET DST 1994 Jochen Hein ( Hein@Student.TU-Clausthal.de ) * [misc/main.c misc/message.c include/texts.h] Removed the text-constants from message.c into variables which may be changed from X-resources. * [misc/main.c misc/message.c] added <locale.h> and setlocale() to main.c, used toupper() in message.c Mon, 13 Jun 94 09:41:16 -0500 Paul Bramel <paulbr@comm.mot.com> * controls/button.c ( [CR]B_LButton* ) left rc.right at full window width so click on label also activates the control (MSWin behavior) Sat Jun 11 19:05:40 1994 Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de) * include/windows.h: functions pointers can not be packed. (annoying warnings with forthcomming gcc-2.6.x) * loader/main.c (InitDLL): Fixed a printf statement. (for control.exe) (InitializeLoadedDLLs): deleted shadow definition of *wpnt. (Breaks many programs, because now COMMDLG will be initialized :-( * windows/win.c (SetWindowText): added missing breaks; (PENSATE starts) * windows/graphics.c (FloodFill): Proper boundarys. (BANGBANG starts) FloodFile_rec should be rewritten. * objects/font.c (FONT_GetMetrics): TYPO: use font->perchar only if it is defined. (WRITE starts) Sun June 12, Peter Broadhurst (pbr@ua.nwl.ac.uk) controls/scroll.c: Fixes for improved behaviour when dragging thumb; Added SB_THUMBPOSITION message when thumb is released.
This commit is contained in:
parent
490a27e012
commit
7cc9c0cefe
109
ChangeLog
109
ChangeLog
|
@ -1,3 +1,107 @@
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Tue Jun 14 08:09:14 1994 Bob Amstadt (bob@pooh)
|
||||||
|
|
||||||
|
* loader/selector.c (GetCurrentPDB):
|
||||||
|
Added trivial function GetCurrentPDB() which returns the program
|
||||||
|
segment prefix selector.
|
||||||
|
|
||||||
|
* memory/heap.c (HEAP_Free):
|
||||||
|
If free list is empty, make the freed block the free list.
|
||||||
|
|
||||||
|
Fri Jun 10 07:56:49 1994 Bob Amstadt (bob@pooh)
|
||||||
|
|
||||||
|
* controls/edit.c (EDIT_SetTextMsg):
|
||||||
|
Do not append a newline at the end of the last line.
|
||||||
|
|
||||||
|
* windows/event.c (SetCapture):
|
||||||
|
Set winHasCursor if mouse capture succeeds.
|
||||||
|
|
||||||
|
Jun 6, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
|
||||||
|
|
||||||
|
* [controls/listbox.c]
|
||||||
|
Fix bug in listbox : InsertString should call AddString if -1.
|
||||||
|
|
||||||
|
* [controls/menu.c]
|
||||||
|
New function GetMenuState().
|
||||||
|
|
||||||
|
* [controls/scroll.c] [windows/nonclient.c]
|
||||||
|
Try to make ShowScrollBar() recalc NC_ regions. Not finished !
|
||||||
|
|
||||||
|
* [objects/text.c]
|
||||||
|
Add Stub for TabbedTextOut(), which temporarely call Textout().
|
||||||
|
|
||||||
|
* [windows/keyboard.c] [windows/event.c]
|
||||||
|
New function GetKeyBoardState() with an KeyStateTable array
|
||||||
|
& associated handling in function EVENT_key().
|
||||||
|
|
||||||
|
Mon Jun 13 16:45:24 MET DST 1994 (erik@hacktic.nl)
|
||||||
|
|
||||||
|
* [controls/menu.c]
|
||||||
|
IsMenu() added.
|
||||||
|
|
||||||
|
* [loader/library.c]
|
||||||
|
ModuleFirst(), ModuleNext(), ModuleFindName(), ModuleFindHandle()
|
||||||
|
added.
|
||||||
|
|
||||||
|
* [object/gdiobj.c]
|
||||||
|
IsGDIObject() added.
|
||||||
|
|
||||||
|
* [miscemu/int2[56].c]
|
||||||
|
bugfix: both didn't leave flags pushed on 16bit-stack.
|
||||||
|
(winfile gets a bit further)
|
||||||
|
|
||||||
|
* [miscemu/int16.c]
|
||||||
|
Added (empty).
|
||||||
|
|
||||||
|
Sat Jun 11 22:56:48 1994 Jon Tombs (jon@esix2.us.es)
|
||||||
|
* windows/event.c:
|
||||||
|
Added code to drop redundant motion Events in the XEvent queue.
|
||||||
|
|
||||||
|
Thu Jun 9 10:55:55 MET DST 1994 Jochen Hein ( Hein@Student.TU-Clausthal.de )
|
||||||
|
|
||||||
|
* [misc/main.c misc/message.c include/texts.h]
|
||||||
|
Removed the text-constants from message.c into variables
|
||||||
|
which may be changed from X-resources.
|
||||||
|
|
||||||
|
* [misc/main.c misc/message.c]
|
||||||
|
added <locale.h> and setlocale() to main.c, used toupper() in message.c
|
||||||
|
|
||||||
|
Mon, 13 Jun 94 09:41:16 -0500 Paul Bramel <paulbr@comm.mot.com>
|
||||||
|
|
||||||
|
* controls/button.c ( [CR]B_LButton* )
|
||||||
|
left rc.right at full window width so click on label also
|
||||||
|
activates the control (MSWin behavior)
|
||||||
|
|
||||||
|
Sat Jun 11 19:05:40 1994 Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
|
||||||
|
|
||||||
|
* include/windows.h:
|
||||||
|
functions pointers can not be packed.
|
||||||
|
(annoying warnings with forthcomming gcc-2.6.x)
|
||||||
|
|
||||||
|
* loader/main.c (InitDLL):
|
||||||
|
Fixed a printf statement. (for control.exe)
|
||||||
|
|
||||||
|
(InitializeLoadedDLLs):
|
||||||
|
deleted shadow definition of *wpnt.
|
||||||
|
(Breaks many programs, because now COMMDLG will be
|
||||||
|
initialized :-(
|
||||||
|
|
||||||
|
* windows/win.c (SetWindowText):
|
||||||
|
added missing breaks; (PENSATE starts)
|
||||||
|
|
||||||
|
* windows/graphics.c (FloodFill):
|
||||||
|
Proper boundarys. (BANGBANG starts) FloodFile_rec should
|
||||||
|
be rewritten.
|
||||||
|
|
||||||
|
* objects/font.c (FONT_GetMetrics):
|
||||||
|
TYPO: use font->perchar only if it is defined. (WRITE starts)
|
||||||
|
|
||||||
|
Sun June 12, Peter Broadhurst (pbr@ua.nwl.ac.uk)
|
||||||
|
controls/scroll.c:
|
||||||
|
Fixes for improved behaviour when dragging thumb;
|
||||||
|
Added SB_THUMBPOSITION message when thumb is released.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
Tue Jun 7 08:41:27 1994 Bob Amstadt (bob@pooh)
|
Tue Jun 7 08:41:27 1994 Bob Amstadt (bob@pooh)
|
||||||
|
|
||||||
* loader/selector.c (FixupFunctionPrologs):
|
* loader/selector.c (FixupFunctionPrologs):
|
||||||
|
@ -69,7 +173,7 @@ Sun Jun 5 17:34:24 1994 Erik Bos (erik@hacktic.nl)
|
||||||
|
|
||||||
Jun 6, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
|
Jun 6, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
|
||||||
|
|
||||||
* [tools/.c]
|
* [tools/build.c]
|
||||||
Change MAX_ORDINALS define to higher value, 1299 entries.
|
Change MAX_ORDINALS define to higher value, 1299 entries.
|
||||||
(MMSYSTEM doesn't have succesive numbers, some are around 1200).
|
(MMSYSTEM doesn't have succesive numbers, some are around 1200).
|
||||||
|
|
||||||
|
@ -83,9 +187,6 @@ Jun 6, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
|
||||||
* [misc/message.c] [controls/combo.c]
|
* [misc/message.c] [controls/combo.c]
|
||||||
Add an InvalidateRect() in WM_SHOWWINDOW to statisfy the new 'saveunder'.
|
Add an InvalidateRect() in WM_SHOWWINDOW to statisfy the new 'saveunder'.
|
||||||
|
|
||||||
* [windows/winpos.c]
|
|
||||||
Bug fix in SetWindowPos(), (redraw was done if SWP_NOREDRAW set).
|
|
||||||
|
|
||||||
* [windows/win.c]
|
* [windows/win.c]
|
||||||
In CreateWindowEx(), do SetMenu() calls after window creation,
|
In CreateWindowEx(), do SetMenu() calls after window creation,
|
||||||
just before sending to WM_NCCALCSIZE.
|
just before sending to WM_NCCALCSIZE.
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
This is intend to be a document to help new developers get started.
|
This is intend to be a document to help new developers get started.
|
||||||
Existing developers should feel free to add there comments.
|
Existing developers should feel free to add there comments.
|
||||||
|
|
||||||
RESERVING WINE PROJECT ARES:
|
|
||||||
|
|
||||||
If you wish to work on a specific set of API functions. Send
|
|
||||||
mail to wine-project@amscons.com. The automatic mail handler
|
|
||||||
will provide you with instructions.
|
|
||||||
|
|
||||||
SUBMITTING YOUR WORK:
|
SUBMITTING YOUR WORK:
|
||||||
|
|
||||||
Submissions of code for inclussion into Wine should be sent to
|
Submissions of code for inclussion into Wine should be sent to
|
||||||
bob@amscons.com (Bob Amstadt). You MUST provide a suitable
|
wine-new@amscons.com (Bob Amstadt). You MUST provide a suitable
|
||||||
ChangeLog entry for any work that you submit. I prefer new code
|
ChangeLog entry for any work that you submit. I prefer new code
|
||||||
to be submitted as unified diffs (diff -u) off of the latest release.
|
to be submitted as unified diffs (diff -u) off of the latest release.
|
||||||
Releases are every Tuesday evening (approximately 17:00 PST or
|
Releases are every Tuesday evening (approximately 17:00 PST or
|
||||||
|
|
6
README
6
README
|
@ -38,9 +38,9 @@ You must have one of:
|
||||||
NetBSD-current
|
NetBSD-current
|
||||||
FreeBSD-current or FreeBSD 1.1
|
FreeBSD-current or FreeBSD 1.1
|
||||||
|
|
||||||
To build Wine, first do a "./Configure" and then a "make". The
|
To build Wine, first do a "./Configure" and then a "make" (or "gmake"
|
||||||
executable "wine" will be built. "wine" will load and run 16-bit
|
if you're running *BSD). The executable "wine" will be built. "wine"
|
||||||
Windows' executables.
|
will load and run 16-bit Windows' executables.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,6 @@ static LONG CB_LButtonDown(HWND hWnd, WORD wParam, LONG lParam)
|
||||||
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
||||||
rc.top += delta;
|
rc.top += delta;
|
||||||
rc.bottom = tm.tmHeight + delta;
|
rc.bottom = tm.tmHeight + delta;
|
||||||
rc.right = tm.tmHeight;
|
|
||||||
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
||||||
{
|
{
|
||||||
SetFocus(hWnd);
|
SetFocus(hWnd);
|
||||||
|
@ -569,7 +568,6 @@ static LONG CB_LButtonUp(HWND hWnd, WORD wParam, LONG lParam)
|
||||||
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
||||||
rc.top += delta;
|
rc.top += delta;
|
||||||
rc.bottom = tm.tmHeight + delta;
|
rc.bottom = tm.tmHeight + delta;
|
||||||
rc.right = tm.tmHeight;
|
|
||||||
|
|
||||||
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
||||||
{
|
{
|
||||||
|
@ -625,7 +623,6 @@ static LONG CB_LButtonDblClk(HWND hWnd, WORD wParam, LONG lParam)
|
||||||
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
||||||
rc.top += delta;
|
rc.top += delta;
|
||||||
rc.bottom = tm.tmHeight + delta;
|
rc.bottom = tm.tmHeight + delta;
|
||||||
rc.right = tm.tmHeight;
|
|
||||||
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
||||||
NOTIFY_PARENT(hWnd, BN_DOUBLECLICKED);
|
NOTIFY_PARENT(hWnd, BN_DOUBLECLICKED);
|
||||||
}
|
}
|
||||||
|
@ -744,7 +741,6 @@ static LONG RB_LButtonDown(HWND hWnd, WORD wParam, LONG lParam)
|
||||||
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
||||||
rc.top += delta;
|
rc.top += delta;
|
||||||
rc.bottom = tm.tmHeight + delta;
|
rc.bottom = tm.tmHeight + delta;
|
||||||
rc.right = tm.tmHeight;
|
|
||||||
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
||||||
{
|
{
|
||||||
SetFocus(hWnd);
|
SetFocus(hWnd);
|
||||||
|
@ -773,7 +769,6 @@ static LONG RB_LButtonUp(HWND hWnd, WORD wParam, LONG lParam)
|
||||||
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
||||||
rc.top += delta;
|
rc.top += delta;
|
||||||
rc.bottom = tm.tmHeight + delta;
|
rc.bottom = tm.tmHeight + delta;
|
||||||
rc.right = tm.tmHeight;
|
|
||||||
|
|
||||||
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
||||||
{
|
{
|
||||||
|
@ -801,7 +796,6 @@ static LONG RB_LButtonDblClk(HWND hWnd, WORD wParam, LONG lParam)
|
||||||
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
|
||||||
rc.top += delta;
|
rc.top += delta;
|
||||||
rc.bottom = tm.tmHeight + delta;
|
rc.bottom = tm.tmHeight + delta;
|
||||||
rc.right = tm.tmHeight;
|
|
||||||
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
if (PtInRect(&rc, MAKEPOINT(lParam)))
|
||||||
NOTIFY_PARENT(hWnd, BN_DOUBLECLICKED);
|
NOTIFY_PARENT(hWnd, BN_DOUBLECLICKED);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,14 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
|
||||||
printf("Combo WM_DESTROY %lX !\n", lphc);
|
printf("Combo WM_DESTROY %lX !\n", lphc);
|
||||||
#endif
|
#endif
|
||||||
return DefWindowProc( hwnd, message, wParam, lParam );
|
return DefWindowProc( hwnd, message, wParam, lParam );
|
||||||
|
case WM_SHOWWINDOW:
|
||||||
|
#ifdef DEBUG_COMBO
|
||||||
|
printf("ComboBox WM_SHOWWINDOW hWnd=%04X !\n", hwnd);
|
||||||
|
#endif
|
||||||
|
if (!(wParam == 0 && lParam == 0L)) {
|
||||||
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
wndPtr = WIN_FindWndPtr(hwnd);
|
wndPtr = WIN_FindWndPtr(hwnd);
|
||||||
|
|
|
@ -15,9 +15,7 @@ static char Copyright[] = "Copyright David W. Metcalfe, 1994";
|
||||||
#include "class.h"
|
#include "class.h"
|
||||||
#include "user.h"
|
#include "user.h"
|
||||||
|
|
||||||
/*
|
#define DEBUG_EDIT /* */
|
||||||
#define DEBUG_EDIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define NOTIFY_PARENT(hWndCntrl, wNotifyCode) \
|
#define NOTIFY_PARENT(hWndCntrl, wNotifyCode) \
|
||||||
SendMessage(GetParent(hWndCntrl), WM_COMMAND, \
|
SendMessage(GetParent(hWndCntrl), WM_COMMAND, \
|
||||||
|
@ -1993,7 +1991,7 @@ LONG EDIT_SetTextMsg(HWND hwnd, LONG lParam)
|
||||||
es->hText = EDIT_HEAP_REALLOC(es->hText, len + 3);
|
es->hText = EDIT_HEAP_REALLOC(es->hText, len + 3);
|
||||||
text = EDIT_HEAP_ADDR(es->hText);
|
text = EDIT_HEAP_ADDR(es->hText);
|
||||||
strcpy(text, (char *)lParam);
|
strcpy(text, (char *)lParam);
|
||||||
text[len] = '\n';
|
/* text[len] = '\n'; */ /* Removed by Bob Amstadt */
|
||||||
text[len + 1] = '\0';
|
text[len + 1] = '\0';
|
||||||
text[len + 2] = '\0';
|
text[len + 2] = '\0';
|
||||||
EDIT_BuildTextPointers(hwnd);
|
EDIT_BuildTextPointers(hwnd);
|
||||||
|
|
|
@ -833,6 +833,10 @@ int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr)
|
||||||
HANDLE hTemp;
|
HANDLE hTemp;
|
||||||
LPSTR str;
|
LPSTR str;
|
||||||
UINT Count;
|
UINT Count;
|
||||||
|
#ifdef DEBUG_LISTBOX
|
||||||
|
printf("ListBoxInsertString(%04X, %d, %08X);\n", hwnd, uIndex, newstr);
|
||||||
|
#endif
|
||||||
|
if (uIndex == (UINT)-1) return ListBoxAddString(hwnd, newstr);
|
||||||
lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr);
|
lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr);
|
||||||
if (lphl == NULL) return LB_ERR;
|
if (lphl == NULL) return LB_ERR;
|
||||||
if (uIndex >= lphl->ItemsCount) return LB_ERR;
|
if (uIndex >= lphl->ItemsCount) return LB_ERR;
|
||||||
|
@ -846,7 +850,7 @@ int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr)
|
||||||
hTemp = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LISTSTRUCT));
|
hTemp = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LISTSTRUCT));
|
||||||
lplsnew = (LPLISTSTRUCT) USER_HEAP_ADDR(hTemp);
|
lplsnew = (LPLISTSTRUCT) USER_HEAP_ADDR(hTemp);
|
||||||
if (lplsnew == NULL) {
|
if (lplsnew == NULL) {
|
||||||
printf("ListBoxAddString() // Bad allocation of new item !\n");
|
printf("ListBoxInsertString() // Bad allocation of new item !\n");
|
||||||
return LB_ERRSPACE;
|
return LB_ERRSPACE;
|
||||||
}
|
}
|
||||||
ListBoxDefaultItem(hwnd, wndPtr, lphl, lplsnew);
|
ListBoxDefaultItem(hwnd, wndPtr, lphl, lplsnew);
|
||||||
|
@ -862,6 +866,9 @@ int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr)
|
||||||
if (str == NULL) return LB_ERRSPACE;
|
if (str == NULL) return LB_ERRSPACE;
|
||||||
strcpy(str, newstr);
|
strcpy(str, newstr);
|
||||||
newstr = str;
|
newstr = str;
|
||||||
|
#ifdef DEBUG_LISTBOX
|
||||||
|
printf("ListBoxInsertString // after strcpy '%s'\n", str);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lplsnew->lpNext = NULL;
|
lplsnew->lpNext = NULL;
|
||||||
|
@ -886,6 +893,9 @@ int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr)
|
||||||
InvalidateRect(hwnd, NULL, TRUE);
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
UpdateWindow(hwnd);
|
UpdateWindow(hwnd);
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG_LISTBOX
|
||||||
|
printf("ListBoxInsertString // count=%d\n", lphl->ItemsCount);
|
||||||
|
#endif
|
||||||
return lphl->ItemsCount;
|
return lphl->ItemsCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -845,6 +845,9 @@ void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop,
|
||||||
if (lpitem == NULL) goto EndOfPaint;
|
if (lpitem == NULL) goto EndOfPaint;
|
||||||
for(i = 0; i < lppop->nItems; i++) {
|
for(i = 0; i < lppop->nItems; i++) {
|
||||||
CopyRect(&rect2, &lpitem->rect);
|
CopyRect(&rect2, &lpitem->rect);
|
||||||
|
#ifdef DEBUG_MENU
|
||||||
|
printf("StdDrawMenuBar // start left=%d\n", rect2.left);
|
||||||
|
#endif
|
||||||
if ((lpitem->item_flags & MF_CHECKED) == MF_CHECKED) {
|
if ((lpitem->item_flags & MF_CHECKED) == MF_CHECKED) {
|
||||||
hMemDC = CreateCompatibleDC(hDC);
|
hMemDC = CreateCompatibleDC(hDC);
|
||||||
if (lpitem->hCheckBit == 0) {
|
if (lpitem->hCheckBit == 0) {
|
||||||
|
@ -856,7 +859,11 @@ void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop,
|
||||||
GetObject(lpitem->hCheckBit, sizeof(BITMAP), (LPSTR)&bm);
|
GetObject(lpitem->hCheckBit, sizeof(BITMAP), (LPSTR)&bm);
|
||||||
}
|
}
|
||||||
BitBlt(hDC, rect2.left, rect2.top + 1,
|
BitBlt(hDC, rect2.left, rect2.top + 1,
|
||||||
bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
|
bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
|
||||||
|
rect2.left += bm.bmWidth;
|
||||||
|
#ifdef DEBUG_MENU
|
||||||
|
printf("StdDrawMenuBar // MF_CHECKED bm.bmWidth=%d\n", bm.bmWidth);
|
||||||
|
#endif
|
||||||
DeleteDC(hMemDC);
|
DeleteDC(hMemDC);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -866,6 +873,10 @@ void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop,
|
||||||
GetObject(lpitem->hUnCheckBit, sizeof(BITMAP), (LPSTR)&bm);
|
GetObject(lpitem->hUnCheckBit, sizeof(BITMAP), (LPSTR)&bm);
|
||||||
BitBlt(hDC, rect2.left, rect2.top + 1,
|
BitBlt(hDC, rect2.left, rect2.top + 1,
|
||||||
bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
|
bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
|
||||||
|
rect2.left += bm.bmWidth;
|
||||||
|
#ifdef DEBUG_MENU
|
||||||
|
printf("StdDrawMenuBar // MF_UNCHECKED bm.bmWidth=%d\n", bm.bmWidth);
|
||||||
|
#endif
|
||||||
DeleteDC(hMemDC);
|
DeleteDC(hMemDC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -898,6 +909,9 @@ void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop,
|
||||||
}
|
}
|
||||||
if ((lpitem->item_flags & MF_HILITE) == MF_HILITE)
|
if ((lpitem->item_flags & MF_HILITE) == MF_HILITE)
|
||||||
FillRect(hDC, &rect2, GetStockObject(BLACK_BRUSH));
|
FillRect(hDC, &rect2, GetStockObject(BLACK_BRUSH));
|
||||||
|
#ifdef DEBUG_MENU
|
||||||
|
printf("StdDrawMenuBar // rect2.left=%d\n", rect2.left);
|
||||||
|
#endif
|
||||||
DrawText(hDC, lpitem->item_text, -1, &rect2,
|
DrawText(hDC, lpitem->item_text, -1, &rect2,
|
||||||
DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
||||||
SetTextColor(hDC, OldTextColor);
|
SetTextColor(hDC, OldTextColor);
|
||||||
|
@ -1073,13 +1087,15 @@ void MenuBarCalcSize(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
|
||||||
lprect->left, lprect->top, lprect->right, lprect->bottom);
|
lprect->left, lprect->top, lprect->right, lprect->bottom);
|
||||||
#endif
|
#endif
|
||||||
hOldFont = SelectObject(hDC, GetStockObject(SYSTEM_FONT));
|
hOldFont = SelectObject(hDC, GetStockObject(SYSTEM_FONT));
|
||||||
LineHeight = OldHeight = SYSMETRICS_CYMENU + 1;
|
lppop->CheckWidth = 0;
|
||||||
|
LineHeight = OldHeight = SYSMETRICS_CYMENU + 2;
|
||||||
SetRect(&rect, lprect->left, lprect->top, 0, lprect->top + LineHeight);
|
SetRect(&rect, lprect->left, lprect->top, 0, lprect->top + LineHeight);
|
||||||
lpitem2 = lppop->firstItem;
|
lpitem2 = lppop->firstItem;
|
||||||
while (lpitem != NULL) {
|
while (lpitem != NULL) {
|
||||||
lpitem = lpitem2;
|
lpitem = lpitem2;
|
||||||
while(rect.right < lprect->right) {
|
while(rect.right < lprect->right) {
|
||||||
if (lpitem == NULL) break;
|
if (lpitem == NULL) break;
|
||||||
|
rect.right = rect.left;
|
||||||
if ((lpitem->item_flags & MF_BITMAP) == MF_BITMAP) {
|
if ((lpitem->item_flags & MF_BITMAP) == MF_BITMAP) {
|
||||||
hBitMap = (HBITMAP)LOWORD((LONG)lpitem->item_text);
|
hBitMap = (HBITMAP)LOWORD((LONG)lpitem->item_text);
|
||||||
GetObject(hBitMap, sizeof(BITMAP), (LPSTR)&bm);
|
GetObject(hBitMap, sizeof(BITMAP), (LPSTR)&bm);
|
||||||
|
@ -1095,6 +1111,21 @@ void MenuBarCalcSize(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
|
||||||
dwRet = max(SYSMETRICS_CYMENU, (HIWORD(dwRet) + 6));
|
dwRet = max(SYSMETRICS_CYMENU, (HIWORD(dwRet) + 6));
|
||||||
LineHeight = max(LineHeight, (WORD)dwRet);
|
LineHeight = max(LineHeight, (WORD)dwRet);
|
||||||
}
|
}
|
||||||
|
if ((lpitem->item_flags & MF_CHECKED) == MF_CHECKED) {
|
||||||
|
if (lpitem->hCheckBit != 0)
|
||||||
|
GetObject(lpitem->hCheckBit, sizeof(BITMAP), (LPSTR)&bm);
|
||||||
|
else
|
||||||
|
GetObject(hStdCheck, sizeof(BITMAP), (LPSTR)&bm);
|
||||||
|
rect.right += bm.bmWidth;
|
||||||
|
LineHeight = max(LineHeight, bm.bmHeight);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (lpitem->hUnCheckBit != 0) {
|
||||||
|
GetObject(lpitem->hUnCheckBit, sizeof(BITMAP), (LPSTR)&bm);
|
||||||
|
rect.right += bm.bmWidth;
|
||||||
|
LineHeight = max(LineHeight, bm.bmHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
CopyRect(&lpitem->rect, &rect);
|
CopyRect(&lpitem->rect, &rect);
|
||||||
rect.left = rect.right;
|
rect.left = rect.right;
|
||||||
lpitem = (LPMENUITEM)lpitem->next;
|
lpitem = (LPMENUITEM)lpitem->next;
|
||||||
|
@ -1112,7 +1143,7 @@ void MenuBarCalcSize(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lppop->Width = lprect->right - lprect->left;
|
lppop->Width = lprect->right - lprect->left;
|
||||||
lppop->Height = rect.bottom - lprect->top;
|
lppop->Height = rect.bottom - lprect->top;
|
||||||
lprect->bottom = lprect->top + lppop->Height;
|
lprect->bottom = lprect->top + lppop->Height;
|
||||||
CopyRect(&lppop->rect, lprect);
|
CopyRect(&lppop->rect, lprect);
|
||||||
#ifdef DEBUG_MENUCALC
|
#ifdef DEBUG_MENUCALC
|
||||||
|
@ -1362,8 +1393,10 @@ BOOL HiliteMenuItem(HWND hWnd, HMENU hMenu, WORD wItemID, WORD wHilite)
|
||||||
{
|
{
|
||||||
LPPOPUPMENU menu;
|
LPPOPUPMENU menu;
|
||||||
LPMENUITEM lpitem;
|
LPMENUITEM lpitem;
|
||||||
|
#ifdef DEBUG_MENU
|
||||||
printf("HiliteMenuItem(%04X, %04X, %04X, %04X);\n",
|
printf("HiliteMenuItem(%04X, %04X, %04X, %04X);\n",
|
||||||
hWnd, hMenu, wItemID, wHilite);
|
hWnd, hMenu, wItemID, wHilite);
|
||||||
|
#endif
|
||||||
menu = (LPPOPUPMENU) GlobalLock(hMenu);
|
menu = (LPPOPUPMENU) GlobalLock(hMenu);
|
||||||
if (menu == NULL) return FALSE;
|
if (menu == NULL) return FALSE;
|
||||||
lpitem = FindMenuItem(hMenu, wItemID, wHilite);
|
lpitem = FindMenuItem(hMenu, wItemID, wHilite);
|
||||||
|
@ -1372,6 +1405,24 @@ BOOL HiliteMenuItem(HWND hWnd, HMENU hMenu, WORD wItemID, WORD wHilite)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* GetMenuState [USER.250]
|
||||||
|
*/
|
||||||
|
WORD GetMenuState(HMENU hMenu, WORD wItemID, WORD wFlags)
|
||||||
|
{
|
||||||
|
LPPOPUPMENU menu;
|
||||||
|
LPMENUITEM lpitem;
|
||||||
|
#ifdef DEBUG_MENU
|
||||||
|
printf("GetMenuState(%04X, %04X, %04X);\n", hMenu, wItemID, wFlags);
|
||||||
|
#endif
|
||||||
|
menu = (LPPOPUPMENU) GlobalLock(hMenu);
|
||||||
|
if (menu == NULL) return -1;
|
||||||
|
lpitem = FindMenuItem(hMenu, wItemID, wFlags);
|
||||||
|
if (lpitem == NULL) return -1;
|
||||||
|
return lpitem->item_flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* GetMenuItemCount [USER.263]
|
* GetMenuItemCount [USER.263]
|
||||||
*/
|
*/
|
||||||
|
@ -2186,10 +2237,20 @@ void DrawMenuBar(HWND hWnd)
|
||||||
#endif
|
#endif
|
||||||
lppop = (LPPOPUPMENU) GlobalLock(wndPtr->wIDmenu);
|
lppop = (LPPOPUPMENU) GlobalLock(wndPtr->wIDmenu);
|
||||||
if (lppop == NULL) return;
|
if (lppop == NULL) return;
|
||||||
if ((lppop->rect.bottom - lppop->rect.top) != 0) {
|
if (lppop->Height != 0) {
|
||||||
|
int oldHeight;
|
||||||
|
oldHeight = lppop->Height;
|
||||||
hDC = GetWindowDC(hWnd);
|
hDC = GetWindowDC(hWnd);
|
||||||
StdDrawMenuBar(hDC, &lppop->rect, lppop, FALSE);
|
StdDrawMenuBar(hDC, &lppop->rect, lppop, FALSE);
|
||||||
ReleaseDC(hWnd, hDC);
|
ReleaseDC(hWnd, hDC);
|
||||||
|
if (oldHeight != lppop->Height) {
|
||||||
|
printf("DrawMenuBar // menubar changed oldHeight=%d != lppop->Height=%d\n",
|
||||||
|
oldHeight, lppop->Height);
|
||||||
|
/* Reduce ClientRect according to MenuBar height */
|
||||||
|
wndPtr->rectClient.top -= oldHeight;
|
||||||
|
wndPtr->rectClient.top += lppop->Height;
|
||||||
|
SendMessage(hWnd, WM_NCPAINT, 1, 0L);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SendMessage(hWnd, WM_NCPAINT, 1, 0L);
|
SendMessage(hWnd, WM_NCPAINT, 1, 0L);
|
||||||
|
@ -2319,4 +2380,17 @@ WORD * ParseMenuResource(WORD *first_item, int level, HMENU hMenu)
|
||||||
return next_item;
|
return next_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* IsMenu(USER.358)
|
||||||
|
*/
|
||||||
|
BOOL IsMenu(HMENU hMenu)
|
||||||
|
{
|
||||||
|
LPPOPUPMENU menu;
|
||||||
|
|
||||||
|
menu = (LPPOPUPMENU) GlobalLock(hMenu);
|
||||||
|
if (menu == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
GlobalUnlock(hMenu);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
*
|
*
|
||||||
* Copyright Martin Ayotte, 1993
|
* Copyright Martin Ayotte, 1993
|
||||||
*
|
*
|
||||||
|
* Small fixes and implemented SB_THUMBPOSITION
|
||||||
|
* by Peter Broadhurst, 940611
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -58,6 +60,8 @@ LONG ScrollBarWndProc( HWND hWnd, WORD message, WORD wParam, LONG lParam )
|
||||||
RECT rect, rect2;
|
RECT rect, rect2;
|
||||||
LPCREATESTRUCT lpCreat;
|
LPCREATESTRUCT lpCreat;
|
||||||
static RECT rectsel;
|
static RECT rectsel;
|
||||||
|
POINT *pt;
|
||||||
|
pt=(POINT*)&lParam;
|
||||||
switch(message) {
|
switch(message) {
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
lpCreat = (LPCREATESTRUCT)lParam;
|
lpCreat = (LPCREATESTRUCT)lParam;
|
||||||
|
@ -95,15 +99,15 @@ LONG ScrollBarWndProc( HWND hWnd, WORD message, WORD wParam, LONG lParam )
|
||||||
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
SetCapture(hWnd);
|
SetCapture(hWnd);
|
||||||
ScrollBarButtonDown(hWnd, SB_CTL, LOWORD(lParam), HIWORD(lParam));
|
ScrollBarButtonDown(hWnd, SB_CTL, pt->x,pt->y);
|
||||||
break;
|
break;
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
ScrollBarButtonUp(hWnd, SB_CTL, LOWORD(lParam), HIWORD(lParam));
|
ScrollBarButtonUp(hWnd, SB_CTL, pt->x,pt->y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
ScrollBarMouseMove(hWnd, SB_CTL, wParam, LOWORD(lParam), HIWORD(lParam));
|
ScrollBarMouseMove(hWnd, SB_CTL, wParam, pt->x,pt->y);
|
||||||
break;
|
break;
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
|
@ -297,7 +301,24 @@ void ScrollBarButtonUp(HWND hWnd, int nBar, int x, int y)
|
||||||
printf("ScrollBarButtonUp // x=%d y=%d\n", x, y);
|
printf("ScrollBarButtonUp // x=%d y=%d\n", x, y);
|
||||||
#endif
|
#endif
|
||||||
lphs = GetScrollObjectStruct(hWnd, nBar);
|
lphs = GetScrollObjectStruct(hWnd, nBar);
|
||||||
lphs->ThumbActive = FALSE;
|
if(lphs->ThumbActive)
|
||||||
|
{
|
||||||
|
HWND hWndOwner,hWndParent;
|
||||||
|
if (nBar == SB_CTL) {
|
||||||
|
hWndParent = GetParent(hWnd);
|
||||||
|
hWndOwner = lphs->hWndOwner;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hWndParent = hWnd;
|
||||||
|
hWndOwner = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SendMessage(hWndParent, lphs->Direction,
|
||||||
|
SB_THUMBPOSITION, MAKELONG(lphs->ThumbVal, hWndOwner));
|
||||||
|
lphs->ThumbActive = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (lphs->ButtonDown != 0) {
|
if (lphs->ButtonDown != 0) {
|
||||||
lphs->ButtonDown = 0;
|
lphs->ButtonDown = 0;
|
||||||
if (nBar == SB_CTL) {
|
if (nBar == SB_CTL) {
|
||||||
|
@ -337,21 +358,38 @@ void ScrollBarMouseMove(HWND hWnd, int nBar, WORD wParam, int x, int y)
|
||||||
printf("ScrollBarButtonMove SB_?SCROLL // x=%d y=%d\n", x, y);
|
printf("ScrollBarButtonMove SB_?SCROLL // x=%d y=%d\n", x, y);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (lphs->Direction == WM_VSCROLL) {
|
|
||||||
int butsiz = lphs->rect.right - lphs->rect.left;
|
if(x<lphs->rect.left||x>lphs->rect.right||
|
||||||
y = y - butsiz - (butsiz >> 1);
|
y<lphs->rect.top||y>lphs->rect.bottom)
|
||||||
}
|
{
|
||||||
else {
|
|
||||||
int butsiz = lphs->rect.bottom - lphs->rect.top;
|
|
||||||
y = x - butsiz - (butsiz >> 1);
|
|
||||||
}
|
|
||||||
x = (y * (lphs->MaxVal - lphs->MinVal) /
|
|
||||||
lphs->MaxPix) + lphs->MinVal;
|
|
||||||
#ifdef DEBUG_SCROLL
|
#ifdef DEBUG_SCROLL
|
||||||
printf("Scroll WM_MOUSEMOVE val=%d pix=%d\n", x, y);
|
printf("Rejecting thumb position !\n");
|
||||||
|
#endif
|
||||||
|
lphs->ThumbVal=lphs->CurVal;/*revert to last set position*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
if (lphs->Direction == WM_VSCROLL) {
|
||||||
|
int butsiz = lphs->rect.right - lphs->rect.left;
|
||||||
|
y = y - butsiz - (butsiz >> 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
int butsiz = lphs->rect.bottom - lphs->rect.top;
|
||||||
|
y = x - butsiz - (butsiz >> 1);
|
||||||
|
}
|
||||||
|
if(y<0)y=0;
|
||||||
|
if(y>lphs->MaxPix)y=lphs->MaxPix;
|
||||||
|
lphs->ThumbVal = (y * (lphs->MaxVal - lphs->MinVal) /
|
||||||
|
lphs->MaxPix) + lphs->MinVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_SCROLL
|
||||||
|
printf("Scroll WM_MOUSEMOVE val=%d pix=%d\n", lphs->ThumbVal, y);
|
||||||
#endif
|
#endif
|
||||||
SendMessage(hWndParent, lphs->Direction,
|
SendMessage(hWndParent, lphs->Direction,
|
||||||
SB_THUMBTRACK, MAKELONG(x, hWndOwner));
|
SB_THUMBTRACK, MAKELONG(lphs->ThumbVal, hWndOwner));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -442,9 +480,11 @@ void StdDrawScrollBar(HWND hWnd, HDC hDC, int nBar, LPRECT lprect, LPHEADSCROLL
|
||||||
lphs->rectDown.left = rect.right - w2;
|
lphs->rectDown.left = rect.right - w2;
|
||||||
}
|
}
|
||||||
if (lphs->MaxVal != lphs->MinVal)
|
if (lphs->MaxVal != lphs->MinVal)
|
||||||
lphs->CurPix = lphs->MaxPix * (abs((short)lphs->CurVal) - abs(lphs->MinVal)) /
|
lphs->CurPix = lphs->MaxPix * (lphs->CurVal - lphs->MinVal) /
|
||||||
(abs(lphs->MaxVal) - abs(lphs->MinVal));
|
(lphs->MaxVal - lphs->MinVal);
|
||||||
|
if(lphs->CurPix <0)lphs->CurPix=0;
|
||||||
if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix;
|
if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix;
|
||||||
|
|
||||||
hMemDC = CreateCompatibleDC(hDC);
|
hMemDC = CreateCompatibleDC(hDC);
|
||||||
if (lphs->Direction == WM_VSCROLL) {
|
if (lphs->Direction == WM_VSCROLL) {
|
||||||
GetObject(hUpArrow, sizeof(BITMAP), (LPSTR)&bm);
|
GetObject(hUpArrow, sizeof(BITMAP), (LPSTR)&bm);
|
||||||
|
@ -597,6 +637,7 @@ void NC_CreateScrollBars(HWND hWnd)
|
||||||
lphs->rect.right = width;
|
lphs->rect.right = width;
|
||||||
lphs->hWndOwner = hWnd;
|
lphs->hWndOwner = hWnd;
|
||||||
wndPtr->VScroll = lphs;
|
wndPtr->VScroll = lphs;
|
||||||
|
wndPtr->scroll_flags |= 0x0001;
|
||||||
if (wndPtr->dwStyle & WS_HSCROLL) height += SYSMETRICS_CYHSCROLL;
|
if (wndPtr->dwStyle & WS_HSCROLL) height += SYSMETRICS_CYHSCROLL;
|
||||||
}
|
}
|
||||||
if (wndPtr->dwStyle & WS_HSCROLL) {
|
if (wndPtr->dwStyle & WS_HSCROLL) {
|
||||||
|
@ -609,6 +650,7 @@ void NC_CreateScrollBars(HWND hWnd)
|
||||||
lphs->rect.bottom = height;
|
lphs->rect.bottom = height;
|
||||||
lphs->hWndOwner = hWnd;
|
lphs->hWndOwner = hWnd;
|
||||||
wndPtr->HScroll = lphs;
|
wndPtr->HScroll = lphs;
|
||||||
|
wndPtr->scroll_flags |= 0x0002;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,8 +684,10 @@ int SetScrollPos(HWND hWnd, int nBar, int nPos, BOOL bRedraw)
|
||||||
nRet = lphs->CurVal;
|
nRet = lphs->CurVal;
|
||||||
lphs->CurVal = (short)nPos;
|
lphs->CurVal = (short)nPos;
|
||||||
if (lphs->MaxVal != lphs->MinVal)
|
if (lphs->MaxVal != lphs->MinVal)
|
||||||
lphs->CurPix = lphs->MaxPix * (abs((short)nPos) - abs(lphs->MinVal)) /
|
lphs->CurPix = lphs->MaxPix * (lphs->CurVal - lphs->MinVal) /
|
||||||
(abs(lphs->MaxVal) - abs(lphs->MinVal));
|
(lphs->MaxVal - lphs->MinVal);
|
||||||
|
if(lphs->CurPix <0)lphs->CurPix=0;
|
||||||
|
|
||||||
if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix;
|
if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix;
|
||||||
#ifdef DEBUG_SCROLL
|
#ifdef DEBUG_SCROLL
|
||||||
printf("SetScrollPos val=%d pixval=%d pixmax%d\n",
|
printf("SetScrollPos val=%d pixval=%d pixmax%d\n",
|
||||||
|
@ -691,12 +735,15 @@ void SetScrollRange(HWND hWnd, int nBar, int MinPos, int MaxPos, BOOL bRedraw)
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
lphs = GetScrollObjectStruct(hWnd, nBar);
|
lphs = GetScrollObjectStruct(hWnd, nBar);
|
||||||
if (lphs == NULL) return;
|
if (lphs == NULL) return;
|
||||||
|
|
||||||
|
/* should a bad range be rejected here?
|
||||||
|
*/
|
||||||
lphs->MinVal = (short)MinPos;
|
lphs->MinVal = (short)MinPos;
|
||||||
lphs->MaxVal = (short)MaxPos;
|
lphs->MaxVal = (short)MaxPos;
|
||||||
if (lphs->MaxVal != lphs->MinVal)
|
if (lphs->MaxVal != lphs->MinVal)
|
||||||
lphs->CurPix = abs(lphs->MaxVal) *
|
lphs->CurPix = lphs->MaxPix * (lphs->CurVal - lphs->MinVal) /
|
||||||
(abs(lphs->CurVal) - abs(lphs->MinVal)) /
|
(lphs->MaxVal - lphs->MinVal);
|
||||||
(abs(lphs->MaxVal) - abs(lphs->MinVal));
|
if(lphs->CurPix <0)lphs->CurPix=0;
|
||||||
if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix;
|
if (lphs->CurPix > lphs->MaxPix) lphs->CurPix = lphs->MaxPix;
|
||||||
#ifdef DEBUG_SCROLL
|
#ifdef DEBUG_SCROLL
|
||||||
printf("SetScrollRange min=%d max=%d\n", lphs->MinVal, lphs->MaxVal);
|
printf("SetScrollRange min=%d max=%d\n", lphs->MinVal, lphs->MaxVal);
|
||||||
|
@ -737,32 +784,32 @@ void GetScrollRange(HWND hWnd, int nBar, LPINT lpMin, LPINT lpMax)
|
||||||
*/
|
*/
|
||||||
void ShowScrollBar(HWND hWnd, WORD wBar, BOOL bFlag)
|
void ShowScrollBar(HWND hWnd, WORD wBar, BOOL bFlag)
|
||||||
{
|
{
|
||||||
WND *wndPtr;
|
WND *wndPtr;
|
||||||
|
printf("ShowScrollBar hWnd=%04X wBar=%d bFlag=%d\n", hWnd, wBar, bFlag);
|
||||||
#ifdef DEBUG_SCROLL
|
#ifdef DEBUG_SCROLL
|
||||||
printf("ShowScrollBar hWnd=%04X wBar=%d bFlag=%d\n", hWnd, wBar, bFlag);
|
printf("ShowScrollBar hWnd=%04X wBar=%d bFlag=%d\n", hWnd, wBar, bFlag);
|
||||||
#endif
|
#endif
|
||||||
if (wBar == SB_CTL) {
|
if (wBar == SB_CTL) {
|
||||||
if (bFlag)
|
if (bFlag)
|
||||||
ShowWindow(hWnd, SW_SHOW);
|
ShowWindow(hWnd, SW_SHOW);
|
||||||
else
|
else
|
||||||
ShowWindow(hWnd, SW_HIDE);
|
ShowWindow(hWnd, SW_HIDE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wndPtr = WIN_FindWndPtr(hWnd);
|
wndPtr = WIN_FindWndPtr(hWnd);
|
||||||
/*
|
if ((wBar == SB_VERT) || (wBar == SB_BOTH)) {
|
||||||
if ((wBar == SB_VERT) || (wBar == SB_BOTH)) {
|
if (bFlag)
|
||||||
if (bFlag)
|
wndPtr->scroll_flags != 0x0001;
|
||||||
wndPtr->dwStyle |= WS_VSCROLL;
|
else
|
||||||
else
|
wndPtr->scroll_flags &= 0xFFFE;
|
||||||
wndPtr->dwStyle &= 0xFFFFFFFFL ^ WS_VSCROLL;
|
}
|
||||||
}
|
if ((wBar == SB_HORZ) || (wBar == SB_BOTH)) {
|
||||||
if ((wBar == SB_HORZ) || (wBar == SB_BOTH)) {
|
if (bFlag)
|
||||||
if (bFlag)
|
wndPtr->scroll_flags != 0x0002;
|
||||||
wndPtr->dwStyle |= WS_HSCROLL;
|
else
|
||||||
else
|
wndPtr->scroll_flags &= 0xFFFD;
|
||||||
wndPtr->dwStyle &= 0xFFFFFFFFL ^ WS_HSCROLL;
|
}
|
||||||
}
|
SetWindowPos(hWnd, 0, 0, 0, 0, 0,
|
||||||
*/
|
SWP_NOZORDER | SWP_NOMOVE |
|
||||||
|
SWP_NOSIZE | SWP_FRAMECHANGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ length 490
|
||||||
#452 pascal GDISEEGDIDO
|
#452 pascal GDISEEGDIDO
|
||||||
#460 pascal GDITASKTERMINATION
|
#460 pascal GDITASKTERMINATION
|
||||||
461 return SetObjectOwner 4 0
|
461 return SetObjectOwner 4 0
|
||||||
#462 pascal ISGDIOBJECT
|
462 pascal IsGDIObject(word) IsGDIObject(1)
|
||||||
#463 pascal MAKEOBJECTPRIVATE
|
#463 pascal MAKEOBJECTPRIVATE
|
||||||
#464 pascal FIXUPBOGUSPUBLISHERMETAFILE
|
#464 pascal FIXUPBOGUSPUBLISHERMETAFILE
|
||||||
465 pascal RectVisible(word ptr) RectVisible(1 2)
|
465 pascal RectVisible(word ptr) RectVisible(1 2)
|
||||||
|
|
|
@ -39,7 +39,7 @@ length 415
|
||||||
34 pascal SetTaskQueue(word word) SetTaskQueue(1 2)
|
34 pascal SetTaskQueue(word word) SetTaskQueue(1 2)
|
||||||
35 pascal GetTaskQueue(word) GetTaskQueue(1)
|
35 pascal GetTaskQueue(word) GetTaskQueue(1)
|
||||||
36 pascal GetCurrentTask() GetCurrentTask()
|
36 pascal GetCurrentTask() GetCurrentTask()
|
||||||
#37 GETCURRENTPDB
|
37 pascal GetCurrentPDB() GetCurrentPDB()
|
||||||
#38 SETTASKSIGNALPROC
|
#38 SETTASKSIGNALPROC
|
||||||
#41 ENABLEDOS
|
#41 ENABLEDOS
|
||||||
#42 DISABLEDOS
|
#42 DISABLEDOS
|
||||||
|
|
|
@ -288,9 +288,9 @@ void winestat(){
|
||||||
perc = implemented * 100.00 / used;
|
perc = implemented * 100.00 / used;
|
||||||
else
|
else
|
||||||
perc = 0.0;
|
perc = 0.0;
|
||||||
printf("%s: %d %d %3.1f\n", dll_builtin_table[i].dll_name, implemented, used, perc);
|
printf("%s: %d of %d (%3.1f %%)\n", dll_builtin_table[i].dll_name, implemented, used, perc);
|
||||||
};
|
};
|
||||||
perc = timplemented * 100.00 / tused;
|
perc = timplemented * 100.00 / tused;
|
||||||
printf("TOTAL: %d %d %3.1f\n",timplemented, tused, perc);
|
printf("TOTAL: %d of %d implemented (%3.1f %%)\n",timplemented, tused, perc);
|
||||||
}
|
}
|
||||||
#endif /* WINESTAT */
|
#endif /* WINESTAT */
|
||||||
|
|
|
@ -1,3 +1,38 @@
|
||||||
name toolhelp
|
name toolhelp
|
||||||
id 13
|
id 13
|
||||||
length 83
|
length 83
|
||||||
|
|
||||||
|
# 50 1 057b GLOBALHANDLETOSEL exported, shared data
|
||||||
|
# 51 1 0318 GLOBALFIRST exported, shared data
|
||||||
|
# 52 1 0399 GLOBALNEXT exported, shared data
|
||||||
|
# 53 1 02a2 GLOBALINFO exported, shared data
|
||||||
|
# 54 1 0417 GLOBALENTRYHANDLE exported, shared data
|
||||||
|
# 55 1 04a9 GLOBALENTRYMODULE exported, shared data
|
||||||
|
# 56 1 090e LOCALINFO exported, shared data
|
||||||
|
# 57 1 095e LOCALFIRST exported, shared data
|
||||||
|
# 58 1 09e9 LOCALNEXT exported, shared data
|
||||||
|
#59 pascal ModuleFirst(ptr) ModuleFirst(1)
|
||||||
|
#60 pascal ModuleNext(ptr) ModuleNext(1)
|
||||||
|
#61 pascal ModuleFindName(ptr ptr) ModuleFindName(1 2)
|
||||||
|
#62 pascal ModuleFindHandle(ptr word) ModuleFindHandle(1 2)
|
||||||
|
# 63 1 0caa TASKFIRST exported, shared data
|
||||||
|
# 64 1 0ced TASKNEXT exported, shared data
|
||||||
|
# 65 1 0d2e TASKFINDHANDLE exported, shared data
|
||||||
|
# 66 1 0f1c STACKTRACEFIRST exported, shared data
|
||||||
|
# 67 1 0f67 STACKTRACECSIPFIRST exported, shared data
|
||||||
|
# 68 1 0fca STACKTRACENEXT exported, shared data
|
||||||
|
# 69 1 28b0 CLASSFIRST exported, shared data
|
||||||
|
# 70 1 2925 CLASSNEXT exported, shared data
|
||||||
|
# 71 1 11ce SYSTEMHEAPINFO exported, shared data
|
||||||
|
# 72 1 13f4 MEMMANINFO exported, shared data
|
||||||
|
# 73 1 1b72 NOTIFYREGISTER exported, shared data
|
||||||
|
# 74 1 1c29 NOTIFYUNREGISTER exported, shared data
|
||||||
|
# 75 1 2060 INTERRUPTREGISTER exported, shared data
|
||||||
|
# 76 1 2111 INTERRUPTUNREGISTER exported, shared data
|
||||||
|
# 77 1 26ea TERMINATEAPP exported, shared data
|
||||||
|
# 78 1 29c4 MEMORYREAD exported, shared data
|
||||||
|
# 79 1 2b6c MEMORYWRITE exported, shared data
|
||||||
|
# 80 1 2dae TIMERCOUNT exported, shared data
|
||||||
|
# 81 1 0d68 TASKSETCSIP exported, shared data
|
||||||
|
# 82 1 0d97 TASKGETCSIP exported, shared data
|
||||||
|
# 83 1 0dc0 TASKSWITCH exported, shared data
|
||||||
|
|
|
@ -199,7 +199,8 @@ length 540
|
||||||
193 pascal IsClipboardFormatAvailable(word) IsClipboardFormatAvailable(1)
|
193 pascal IsClipboardFormatAvailable(word) IsClipboardFormatAvailable(1)
|
||||||
194 pascal DlgDirSelectComboBox(word ptr word) DlgDirSelectComboBox(1 2 3)
|
194 pascal DlgDirSelectComboBox(word ptr word) DlgDirSelectComboBox(1 2 3)
|
||||||
195 pascal DlgDirListComboBox(word ptr word word word) DlgDirListComboBox(1 2 3 4 5)
|
195 pascal DlgDirListComboBox(word ptr word word word) DlgDirListComboBox(1 2 3 4 5)
|
||||||
#196 TABBEDTEXTOUT
|
196 pascal TabbedTextOut(word s_word s_word ptr s_word s_word ptr s_word)
|
||||||
|
TabbedTextOut(1 2 3 4 5 6 7 8)
|
||||||
#197 GETTABBEDTEXTEXTENT
|
#197 GETTABBEDTEXTEXTENT
|
||||||
#198 CASCADECHILDWINDOWS
|
#198 CASCADECHILDWINDOWS
|
||||||
#199 TILECHILDWINDOWS
|
#199 TILECHILDWINDOWS
|
||||||
|
@ -227,7 +228,7 @@ length 540
|
||||||
220 pascal LoadMenuIndirect(ptr) LoadMenuIndirect(1)
|
220 pascal LoadMenuIndirect(ptr) LoadMenuIndirect(1)
|
||||||
221 pascal ScrollDC(word s_word s_word ptr ptr word ptr)
|
221 pascal ScrollDC(word s_word s_word ptr ptr word ptr)
|
||||||
ScrollDC(1 2 3 4 5 6 7)
|
ScrollDC(1 2 3 4 5 6 7)
|
||||||
#222 GETKEYBOARDSTATE
|
222 pascal GetKeyboardState(ptr) GetKeyboardState(1)
|
||||||
#223 SETKEYBOARDSTATE
|
#223 SETKEYBOARDSTATE
|
||||||
224 pascal GetWindowTask(word) GetWindowTask(1)
|
224 pascal GetWindowTask(word) GetWindowTask(1)
|
||||||
225 pascal EnumTaskWindows(word ptr long) EnumTaskWindows(1 2 3)
|
225 pascal EnumTaskWindows(word ptr long) EnumTaskWindows(1 2 3)
|
||||||
|
@ -259,7 +260,7 @@ length 540
|
||||||
247 pascal GetCursor() GetCursor()
|
247 pascal GetCursor() GetCursor()
|
||||||
248 pascal GetOpenClipboardWindow() GetOpenClipboardWindow()
|
248 pascal GetOpenClipboardWindow() GetOpenClipboardWindow()
|
||||||
249 pascal GetAsyncKeyState(word) GetAsyncKeyState(1)
|
249 pascal GetAsyncKeyState(word) GetAsyncKeyState(1)
|
||||||
#250 GETMENUSTATE
|
250 pascal GetMenuState(word word word) GetMenuState(1 2 3)
|
||||||
#251 SENDDRIVERMESSAGE
|
#251 SENDDRIVERMESSAGE
|
||||||
#252 OPENDRIVER
|
#252 OPENDRIVER
|
||||||
#253 CLOSEDRIVER
|
#253 CLOSEDRIVER
|
||||||
|
@ -328,7 +329,7 @@ length 540
|
||||||
#343 GETFILEPORTNAME
|
#343 GETFILEPORTNAME
|
||||||
#356 LOADDIBCURSORHANDLER
|
#356 LOADDIBCURSORHANDLER
|
||||||
#357 LOADDIBICONHANDLER
|
#357 LOADDIBICONHANDLER
|
||||||
#358 ISMENU
|
358 pascal IsMenu(word) IsMenu(1)
|
||||||
359 pascal GetDCEx(word word long) GetDCEx(1 2 3)
|
359 pascal GetDCEx(word word long) GetDCEx(1 2 3)
|
||||||
#362 DCHOOK
|
#362 DCHOOK
|
||||||
#368 COPYICON
|
#368 COPYICON
|
||||||
|
@ -414,7 +415,7 @@ length 540
|
||||||
#510 WNETLOCKQUEUEDATA
|
#510 WNETLOCKQUEUEDATA
|
||||||
#511 WNETUNLOCKQUEUEDATA
|
#511 WNETUNLOCKQUEUEDATA
|
||||||
512 pascal WNetGetConnection(ptr ptr ptr) WNetGetConnection(1 2 3)
|
512 pascal WNetGetConnection(ptr ptr ptr) WNetGetConnection(1 2 3)
|
||||||
#513 WNETGETCAPS
|
513 pascal WNetGetCaps(word) WNetGetCaps(1)
|
||||||
#514 WNETDEVICEMODE
|
#514 WNETDEVICEMODE
|
||||||
#515 WNETBROWSEDIALOG
|
#515 WNETBROWSEDIALOG
|
||||||
516 pascal WNetGetUser(ptr ptr ptr) WNetGetUser(1 2 3)
|
516 pascal WNetGetUser(ptr ptr ptr) WNetGetUser(1 2 3)
|
||||||
|
|
|
@ -30,10 +30,11 @@ struct dosdirent {
|
||||||
#define CS context->sc_cs
|
#define CS context->sc_cs
|
||||||
#define DS context->sc_ds
|
#define DS context->sc_ds
|
||||||
#define ES context->sc_es
|
#define ES context->sc_es
|
||||||
|
#define SS context->sc_ss
|
||||||
|
|
||||||
#define DI context->sc_edi
|
#define DI context->sc_edi
|
||||||
#define SI context->sc_esi
|
#define SI context->sc_esi
|
||||||
|
#define SP context->sc_esp
|
||||||
#define EFL context->sc_efl
|
#define EFL context->sc_efl
|
||||||
|
|
||||||
#define SetCflag (EFL |= 0x00000001L)
|
#define SetCflag (EFL |= 0x00000001L)
|
||||||
|
@ -43,8 +44,8 @@ struct dosdirent {
|
||||||
#define segment(a) ((DWORD)a >> 16)
|
#define segment(a) ((DWORD)a >> 16)
|
||||||
#define offset(a) ((DWORD)a & 0xffff)
|
#define offset(a) ((DWORD)a & 0xffff)
|
||||||
|
|
||||||
#define setword(a,b) *(BYTE*)a = b & 0xff; \
|
#define setword(a,b) *(BYTE*)(a) = b & 0xff; \
|
||||||
*((BYTE*)a + 1) = (b>>8) & 0xff;
|
*((BYTE*)(a + 1)) = (b>>8) & 0xff;
|
||||||
|
|
||||||
#define setdword(a,b) *(BYTE*)a = b & 0xff; \
|
#define setdword(a,b) *(BYTE*)a = b & 0xff; \
|
||||||
*((BYTE*)a + 1) = (b>>8) & 0xff; \
|
*((BYTE*)a + 1) = (b>>8) & 0xff; \
|
||||||
|
|
|
@ -9,6 +9,7 @@ typedef struct tagHEADSSCROLL {
|
||||||
short MaxVal;
|
short MaxVal;
|
||||||
short MaxPix;
|
short MaxPix;
|
||||||
short CurPix;
|
short CurPix;
|
||||||
|
short ThumbVal;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
RECT rectUp;
|
RECT rectUp;
|
||||||
RECT rectDown;
|
RECT rectDown;
|
||||||
|
|
|
@ -5,21 +5,42 @@
|
||||||
#ifndef TASK_H
|
#ifndef TASK_H
|
||||||
#define TASK_H
|
#define TASK_H
|
||||||
|
|
||||||
|
#include "toolhelp.h"
|
||||||
|
|
||||||
|
typedef HANDLE HGLOBAL;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
HANDLE hTask;
|
DWORD dwSize;
|
||||||
HANDLE hModule;
|
HTASK hTask;
|
||||||
|
HTASK hTaskParent;
|
||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
|
HMODULE hModule;
|
||||||
|
WORD wSS;
|
||||||
|
WORD wSP;
|
||||||
|
WORD wStackTop;
|
||||||
|
WORD wStackMinimum;
|
||||||
|
WORD wStackBottom;
|
||||||
|
WORD wcEvents;
|
||||||
|
HGLOBAL hQueue;
|
||||||
|
char szModule[MAX_MODULE_NAME + 1];
|
||||||
|
WORD wPSPOffset;
|
||||||
|
HANDLE hNext;
|
||||||
|
} TASKENTRY;
|
||||||
|
typedef TASKENTRY *LPTASKENTRY;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
TASKENTRY te;
|
||||||
int unix_pid;
|
int unix_pid;
|
||||||
HICON hIcon;
|
HICON hIcon;
|
||||||
HWND *lpWndList;
|
HWND *lpWndList;
|
||||||
void *lpPrevTask;
|
void *lpPrevTask;
|
||||||
void *lpNextTask;
|
void *lpNextTask;
|
||||||
} TASKENTRY;
|
} WINETASKENTRY;
|
||||||
typedef TASKENTRY *LPTASKENTRY;
|
typedef WINETASKENTRY *LPWINETASKENTRY;
|
||||||
|
|
||||||
#define MAXWIN_PER_TASK 256
|
#define MAXWIN_PER_TASK 256
|
||||||
|
|
||||||
HANDLE CreateNewTask(HINSTANCE hInst);
|
HANDLE CreateNewTask(HINSTANCE hInst, HTASK hTaskParent);
|
||||||
BOOL RemoveWindowFromTask(HTASK hTask, HWND hWnd);
|
BOOL RemoveWindowFromTask(HTASK hTask, HWND hWnd);
|
||||||
BOOL AddWindowToTask(HTASK hTask, HWND hWnd);
|
BOOL AddWindowToTask(HTASK hTask, HWND hWnd);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
/*
|
||||||
|
* texts.h - String constants are read from Xresources/app-defaults
|
||||||
|
* (c) 1994 Jochen Hein ( Hein@Student.TU-Clausthal.de )
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Type-description for buttons
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct tButtonDesc {
|
||||||
|
char *Label; /* Label of the Button */
|
||||||
|
char Hotkey; /* Hotkey to press this Button */
|
||||||
|
} ButtonDesc;
|
||||||
|
|
||||||
|
typedef struct tButtonTexts {
|
||||||
|
ButtonDesc Yes;
|
||||||
|
ButtonDesc No;
|
||||||
|
ButtonDesc Ok;
|
||||||
|
ButtonDesc Cancel;
|
||||||
|
ButtonDesc Abort;
|
||||||
|
ButtonDesc Retry;
|
||||||
|
ButtonDesc Ignore;
|
||||||
|
} ButtonTexts;
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ typedef struct tagWND
|
||||||
HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
|
HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
|
||||||
void *VScroll; /* Vertical ScrollBar Struct Pointer */
|
void *VScroll; /* Vertical ScrollBar Struct Pointer */
|
||||||
void *HScroll; /* Horizontal ScrollBar Struct Pointer */
|
void *HScroll; /* Horizontal ScrollBar Struct Pointer */
|
||||||
|
WORD scroll_flags; /* scrolls flags (vert & horz visible) */
|
||||||
WORD wIDmenu; /* ID or hmenu (from CreateWindow) */
|
WORD wIDmenu; /* ID or hmenu (from CreateWindow) */
|
||||||
HANDLE hText; /* Handle of window text */
|
HANDLE hText; /* Handle of window text */
|
||||||
WORD flags; /* Misc. flags (see below) */
|
WORD flags; /* Misc. flags (see below) */
|
||||||
|
|
|
@ -161,7 +161,7 @@ typedef PAINTSTRUCT *LPPAINTSTRUCT;
|
||||||
#ifdef WINELIB
|
#ifdef WINELIB
|
||||||
typedef LONG (*WNDPROC)(HWND, UINT, WPARAM, LPARAM);
|
typedef LONG (*WNDPROC)(HWND, UINT, WPARAM, LPARAM);
|
||||||
#else
|
#else
|
||||||
typedef LONG (* WNDPROC)() WINE_PACKED;
|
typedef LONG (* WNDPROC)();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -3008,7 +3008,7 @@ Fg(int,SetDIBits,HDC,a,HANDLE,a2,WORD,b,WORD,c,LPSTR,d,LPBITMAPINFO,e,WORD,f)
|
||||||
Fg(BOOL,SetWindowPos,HWND,a,HWND,b,short,c,short,d,short,e,short,f,WORD,g)
|
Fg(BOOL,SetWindowPos,HWND,a,HWND,b,short,c,short,d,short,e,short,f,WORD,g)
|
||||||
Fh(BOOL,ExtTextOut,HDC,a,short,b,short,c,WORD,d,LPRECT,e,LPSTR,f,WORD,g,LPINT,h)
|
Fh(BOOL,ExtTextOut,HDC,a,short,b,short,c,WORD,d,LPRECT,e,LPSTR,f,WORD,g,LPINT,h)
|
||||||
Fh(HANDLE,DeferWindowPos,HANDLE,hWinPosInfo,HWND,hWnd,HWND,hWndInsertAfter,int,x,int,y,int,cx,int,cy,WORD,wFlags)
|
Fh(HANDLE,DeferWindowPos,HANDLE,hWinPosInfo,HWND,hWnd,HWND,hWndInsertAfter,int,x,int,y,int,cx,int,cy,WORD,wFlags)
|
||||||
Fh(LONG,TabbedTextOut,HDC,a,int,b,int,c,LPSTR,d,int,e,int,f,LPINT,g,int,h)
|
Fh(LONG,TabbedTextOut,HDC,a,short,b,short,c,LPSTR,d,short,e,short,f,LPINT,g,short,h)
|
||||||
Fh(int,ScrollWindowEx,HWND,a,short,b,short,c,LPRECT,d,LPRECT,e,HRGN,f,LPRECT,g,WORD,h)
|
Fh(int,ScrollWindowEx,HWND,a,short,b,short,c,LPRECT,d,LPRECT,e,HRGN,f,LPRECT,g,WORD,h)
|
||||||
Fi(BOOL,Arc,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
|
Fi(BOOL,Arc,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
|
||||||
Fi(BOOL,Chord,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
|
Fi(BOOL,Chord,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
|
||||||
|
|
109
loader/library.c
109
loader/library.c
|
@ -20,10 +20,14 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
|
||||||
#include "wine.h"
|
#include "wine.h"
|
||||||
#include "dlls.h"
|
#include "dlls.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
#include "toolhelp.h"
|
||||||
|
|
||||||
extern struct w_files *wine_files;
|
extern struct w_files *wine_files;
|
||||||
extern struct dll_name_table_entry_s dll_builtin_table[];
|
extern struct dll_name_table_entry_s dll_builtin_table[];
|
||||||
|
|
||||||
|
struct w_files *GetFileInfo(HANDLE);
|
||||||
|
char *GetDosFileName(char *);
|
||||||
|
|
||||||
#define IS_BUILTIN_DLL(handle) ((handle >> 8) == 0xff)
|
#define IS_BUILTIN_DLL(handle) ((handle >> 8) == 0xff)
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
@ -53,12 +57,17 @@ HANDLE GetModuleHandle(LPSTR lpModuleName)
|
||||||
{
|
{
|
||||||
register struct w_files *w = wine_files;
|
register struct w_files *w = wine_files;
|
||||||
int i;
|
int i;
|
||||||
|
char dllname[256];
|
||||||
|
|
||||||
|
if ((int) lpModuleName & 0xffff0000)
|
||||||
|
ExtractDLLName(lpModuleName, dllname);
|
||||||
|
|
||||||
if ((int) lpModuleName & 0xffff0000)
|
if ((int) lpModuleName & 0xffff0000)
|
||||||
printf("GetModuleHandle('%s');\n", lpModuleName);
|
printf("GetModuleHandle('%s');\n", lpModuleName);
|
||||||
else
|
else
|
||||||
printf("GetModuleHandle('%x');\n", lpModuleName);
|
printf("GetModuleHandle('%x');\n", lpModuleName);
|
||||||
|
|
||||||
printf("GetModuleHandle // searching in builtin libraries\n");
|
/* printf("GetModuleHandle // searching in builtin libraries\n");*/
|
||||||
for (i = 0; i < N_BUILTINS; i++) {
|
for (i = 0; i < N_BUILTINS; i++) {
|
||||||
if (dll_builtin_table[i].dll_name == NULL) break;
|
if (dll_builtin_table[i].dll_name == NULL) break;
|
||||||
if (((int) lpModuleName & 0xffff0000) == 0) {
|
if (((int) lpModuleName & 0xffff0000) == 0) {
|
||||||
|
@ -68,7 +77,7 @@ HANDLE GetModuleHandle(LPSTR lpModuleName)
|
||||||
return 0xFF00 + i;
|
return 0xFF00 + i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcasecmp(dll_builtin_table[i].dll_name, lpModuleName) == 0) {
|
else if (strcasecmp(dll_builtin_table[i].dll_name, dllname) == 0) {
|
||||||
printf("GetModuleHandle('%x') return %04X \n",
|
printf("GetModuleHandle('%x') return %04X \n",
|
||||||
lpModuleName, 0xFF00 + i);
|
lpModuleName, 0xFF00 + i);
|
||||||
return (0xFF00 + i);
|
return (0xFF00 + i);
|
||||||
|
@ -85,7 +94,7 @@ HANDLE GetModuleHandle(LPSTR lpModuleName)
|
||||||
return w->hinstance;
|
return w->hinstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcasecmp(w->name, lpModuleName) == 0) {
|
else if (strcasecmp(w->name, dllname) == 0) {
|
||||||
printf("GetModuleHandle('%s') return %04X \n",
|
printf("GetModuleHandle('%s') return %04X \n",
|
||||||
lpModuleName, w->hinstance);
|
lpModuleName, w->hinstance);
|
||||||
return w->hinstance;
|
return w->hinstance;
|
||||||
|
@ -309,3 +318,97 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
|
||||||
|
|
||||||
#endif /* ifndef WINELIB */
|
#endif /* ifndef WINELIB */
|
||||||
|
|
||||||
|
/* internal dlls */
|
||||||
|
static void
|
||||||
|
FillModStructBuiltIn(MODULEENTRY *lpModule, struct dll_name_table_entry_s *dll)
|
||||||
|
{
|
||||||
|
lpModule->dwSize = dll->dll_table_length * 1024;
|
||||||
|
strcpy(lpModule->szModule, dll->dll_name);
|
||||||
|
lpModule->hModule = 0xff00 + dll->dll_number;
|
||||||
|
lpModule->wcUsage = GetModuleUsage(lpModule->hModule);
|
||||||
|
GetModuleFileName(lpModule->hModule, lpModule->szExePath, MAX_PATH + 1);
|
||||||
|
lpModule->wNext = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loaded dlls */
|
||||||
|
static void
|
||||||
|
FillModStructLoaded(MODULEENTRY *lpModule, struct w_files *dll)
|
||||||
|
{
|
||||||
|
lpModule->dwSize = 16384;
|
||||||
|
strcpy(lpModule->szModule, dll->name);
|
||||||
|
lpModule->hModule = dll->hinstance;
|
||||||
|
lpModule->wcUsage = GetModuleUsage(lpModule->hModule);
|
||||||
|
GetModuleFileName(lpModule->hModule, lpModule->szExePath, MAX_PATH + 1);
|
||||||
|
lpModule->wNext = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ModuleFirst [TOOHELP.59]
|
||||||
|
*/
|
||||||
|
BOOL ModuleFirst(MODULEENTRY *lpModule)
|
||||||
|
{
|
||||||
|
printf("ModuleFirst(%08X)\n", lpModule);
|
||||||
|
|
||||||
|
FillModStructBuiltIn(lpModule, &dll_builtin_table[0]);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ModuleNext [TOOHELP.60]
|
||||||
|
*/
|
||||||
|
BOOL ModuleNext(MODULEENTRY *lpModule)
|
||||||
|
{
|
||||||
|
struct w_files *w;
|
||||||
|
|
||||||
|
printf("ModuleNext(%08X)\n", lpModule);
|
||||||
|
|
||||||
|
if (IS_BUILTIN_DLL(lpModule->hModule)) {
|
||||||
|
/* last built-in ? */
|
||||||
|
if ((lpModule->hModule & 0xff) == (N_BUILTINS - 1) ) {
|
||||||
|
if (wine_files) {
|
||||||
|
FillModStructLoaded(lpModule, wine_files);
|
||||||
|
return TRUE;
|
||||||
|
} else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
FillModStructBuiltIn(lpModule, &dll_builtin_table[(lpModule->hModule & 0xff)+1]);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
w = GetFileInfo(lpModule->hModule);
|
||||||
|
if (w->next) {
|
||||||
|
FillModStructLoaded(lpModule, w->next);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ModuleFindHandle [TOOHELP.62]
|
||||||
|
*/
|
||||||
|
HMODULE ModuleFindHandle(MODULEENTRY *lpModule, HMODULE hModule)
|
||||||
|
{
|
||||||
|
struct w_files *w;
|
||||||
|
|
||||||
|
printf("ModuleFindHandle(%08X, %04X)\n", lpModule, hModule);
|
||||||
|
|
||||||
|
/* built-in dll ? */
|
||||||
|
if (IS_BUILTIN_DLL(hModule)) {
|
||||||
|
FillModStructBuiltIn(lpModule, &dll_builtin_table[hModule & 0xff]);
|
||||||
|
return hModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check loaded dlls */
|
||||||
|
if ((w = GetFileInfo(hModule)) == NULL)
|
||||||
|
return (HMODULE) NULL;
|
||||||
|
|
||||||
|
FillModStructLoaded(lpModule, w);
|
||||||
|
return w->hinstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ModuleFindName [TOOHELP.61]
|
||||||
|
*/
|
||||||
|
HMODULE ModuleFindName(MODULEENTRY *lpModule, LPCSTR lpstrName)
|
||||||
|
{
|
||||||
|
return (ModuleFindHandle(lpModule, GetModuleHandle((char*)lpstrName)));
|
||||||
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ HINSTANCE LoadImage(char *module, int filetype, int change_dir)
|
||||||
char buffer[256], header[2], modulename[64], *fullname;
|
char buffer[256], header[2], modulename[64], *fullname;
|
||||||
|
|
||||||
ExtractDLLName(module, modulename);
|
ExtractDLLName(module, modulename);
|
||||||
|
printf("%sLoadImage \n", module);
|
||||||
/* built-in one ? */
|
/* built-in one ? */
|
||||||
if (FindDLLTable(modulename)) {
|
if (FindDLLTable(modulename)) {
|
||||||
return GetModuleHandle(modulename);
|
return GetModuleHandle(modulename);
|
||||||
|
@ -212,7 +212,8 @@ HINSTANCE LoadImage(char *module, int filetype, int change_dir)
|
||||||
wpnt->mz_header = (struct mz_header_s *) malloc(sizeof(struct mz_header_s));;
|
wpnt->mz_header = (struct mz_header_s *) malloc(sizeof(struct mz_header_s));;
|
||||||
status = lseek(wpnt->fd, 0, SEEK_SET);
|
status = lseek(wpnt->fd, 0, SEEK_SET);
|
||||||
load_mz_header (wpnt->fd, wpnt->mz_header);
|
load_mz_header (wpnt->fd, wpnt->mz_header);
|
||||||
if (wpnt->mz_header->must_be_0x40 != 0x40)
|
if (wpnt->mz_header->must_be_0x40 != 0x40 &&
|
||||||
|
wpnt->mz_header->must_be_0x40 != 0x1e)
|
||||||
myerror("This is not a Windows program");
|
myerror("This is not a Windows program");
|
||||||
|
|
||||||
/* read first two bytes to determine filetype */
|
/* read first two bytes to determine filetype */
|
||||||
|
@ -361,7 +362,8 @@ void InitializeLoadedDLLs(struct w_files *wpnt)
|
||||||
{
|
{
|
||||||
static flagReadyToRun = 0;
|
static flagReadyToRun = 0;
|
||||||
struct w_files *final_wpnt;
|
struct w_files *final_wpnt;
|
||||||
struct w_files * wpnt;
|
|
||||||
|
printf("InitializeLoadedDLLs %08X\n", wpnt);
|
||||||
|
|
||||||
if (wpnt == NULL)
|
if (wpnt == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -823,6 +823,13 @@ CreateEnvironment(void)
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
*/
|
||||||
|
WORD GetCurrentPDB()
|
||||||
|
{
|
||||||
|
return PSPSelector;
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* CreatePSP
|
* CreatePSP
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -57,6 +57,7 @@ int do_int(int intnum, struct sigcontext_struct *scp)
|
||||||
return 1; /* get base mem size */
|
return 1; /* get base mem size */
|
||||||
|
|
||||||
case 0x15: return do_int15(scp);
|
case 0x15: return do_int15(scp);
|
||||||
|
case 0x16: return do_int16(scp);
|
||||||
case 0x1A: return do_int1A(scp);
|
case 0x1A: return do_int1A(scp);
|
||||||
case 0x21: return do_int21(scp);
|
case 0x21: return do_int21(scp);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
|
||||||
#include "wine.h"
|
#include "wine.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
static LPTASKENTRY lpTaskList = NULL;
|
static LPWINETASKENTRY lpTaskList = NULL;
|
||||||
static int nTaskCount = 0;
|
static int nTaskCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ static int nTaskCount = 0;
|
||||||
*/
|
*/
|
||||||
HTASK GetCurrentTask()
|
HTASK GetCurrentTask()
|
||||||
{
|
{
|
||||||
LPTASKENTRY lpTask = lpTaskList;
|
LPWINETASKENTRY lpTask = lpTaskList;
|
||||||
int pid = getpid();
|
int pid = getpid();
|
||||||
#ifdef DEBUG_TASK
|
#ifdef DEBUG_TASK
|
||||||
printf("GetCurrentTask() // unix_pid=%08X !\n", pid);
|
printf("GetCurrentTask() // unix_pid=%08X !\n", pid);
|
||||||
|
@ -35,9 +35,9 @@ HTASK GetCurrentTask()
|
||||||
lpTask = lpTask->lpNextTask;
|
lpTask = lpTask->lpNextTask;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_TASK
|
#ifdef DEBUG_TASK
|
||||||
printf("GetCurrentTask() returned hTask=%04X !\n", lpTask->hTask);
|
printf("GetCurrentTask() returned hTask=%04X !\n", lpTask->te.hTask);
|
||||||
#endif
|
#endif
|
||||||
return lpTask->hTask;
|
return lpTask->te.hTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ HTASK GetWindowTask(HWND hWnd)
|
||||||
{
|
{
|
||||||
HWND *wptr;
|
HWND *wptr;
|
||||||
int count;
|
int count;
|
||||||
LPTASKENTRY lpTask = lpTaskList;
|
LPWINETASKENTRY lpTask = lpTaskList;
|
||||||
printf("GetWindowTask(%04X) !\n", hWnd);
|
printf("GetWindowTask(%04X) !\n", hWnd);
|
||||||
while (lpTask != NULL) {
|
while (lpTask != NULL) {
|
||||||
wptr = lpTask->lpWndList;
|
wptr = lpTask->lpWndList;
|
||||||
|
@ -66,11 +66,11 @@ HTASK GetWindowTask(HWND hWnd)
|
||||||
count = 0;
|
count = 0;
|
||||||
while (++count < MAXWIN_PER_TASK) {
|
while (++count < MAXWIN_PER_TASK) {
|
||||||
printf("GetWindowTask // searching %04X %04X !\n",
|
printf("GetWindowTask // searching %04X %04X !\n",
|
||||||
lpTask->hTask, *(wptr));
|
lpTask->te.hTask, *(wptr));
|
||||||
if (*(wptr) == hWnd) {
|
if (*(wptr) == hWnd) {
|
||||||
printf("GetWindowTask(%04X) found hTask=%04X !\n",
|
printf("GetWindowTask(%04X) found hTask=%04X !\n",
|
||||||
hWnd, lpTask->hTask);
|
hWnd, lpTask->te.hTask);
|
||||||
return lpTask->hTask;
|
return lpTask->te.hTask;
|
||||||
}
|
}
|
||||||
wptr++;
|
wptr++;
|
||||||
}
|
}
|
||||||
|
@ -89,10 +89,10 @@ BOOL EnumTaskWindows(HANDLE hTask, FARPROC lpEnumFunc, LONG lParam)
|
||||||
HWND *wptr, hWnd;
|
HWND *wptr, hWnd;
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
LPTASKENTRY lpTask = lpTaskList;
|
LPWINETASKENTRY lpTask = lpTaskList;
|
||||||
printf("EnumTaskWindows(%04X, %08X, %08X) !\n", hTask, lpEnumFunc, lParam);
|
printf("EnumTaskWindows(%04X, %08X, %08X) !\n", hTask, lpEnumFunc, lParam);
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (lpTask->hTask == hTask) break;
|
if (lpTask->te.hTask == hTask) break;
|
||||||
if (lpTask == NULL) {
|
if (lpTask == NULL) {
|
||||||
printf("EnumTaskWindows // hTask=%04X not found !\n", hTask);
|
printf("EnumTaskWindows // hTask=%04X not found !\n", hTask);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -120,19 +120,19 @@ BOOL EnumTaskWindows(HANDLE hTask, FARPROC lpEnumFunc, LONG lParam)
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* CreateNewTask [internal]
|
* CreateNewTask [internal]
|
||||||
*/
|
*/
|
||||||
HANDLE CreateNewTask(HINSTANCE hInst)
|
HANDLE CreateNewTask(HINSTANCE hInst, HTASK hTaskParent)
|
||||||
{
|
{
|
||||||
HANDLE hTask;
|
HANDLE hTask;
|
||||||
LPTASKENTRY lpTask = lpTaskList;
|
LPWINETASKENTRY lpTask = lpTaskList;
|
||||||
LPTASKENTRY lpNewTask;
|
LPWINETASKENTRY lpNewTask;
|
||||||
if (lpTask != NULL) {
|
if (lpTask != NULL) {
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (lpTask->lpNextTask == NULL) break;
|
if (lpTask->lpNextTask == NULL) break;
|
||||||
lpTask = lpTask->lpNextTask;
|
lpTask = lpTask->lpNextTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hTask = GlobalAlloc(GMEM_MOVEABLE, sizeof(TASKENTRY));
|
hTask = GlobalAlloc(GMEM_MOVEABLE, sizeof(WINETASKENTRY));
|
||||||
lpNewTask = (LPTASKENTRY) GlobalLock(hTask);
|
lpNewTask = (LPWINETASKENTRY) GlobalLock(hTask);
|
||||||
#ifdef DEBUG_TASK
|
#ifdef DEBUG_TASK
|
||||||
printf("CreateNewTask entry allocated %08X\n", lpNewTask);
|
printf("CreateNewTask entry allocated %08X\n", lpNewTask);
|
||||||
#endif
|
#endif
|
||||||
|
@ -143,13 +143,25 @@ HANDLE CreateNewTask(HINSTANCE hInst)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lpTask->lpNextTask = lpNewTask;
|
lpTask->lpNextTask = lpNewTask;
|
||||||
|
lpTask->te.hNext = lpNewTask->te.hTask;
|
||||||
lpNewTask->lpPrevTask = lpTask;
|
lpNewTask->lpPrevTask = lpTask;
|
||||||
}
|
}
|
||||||
lpNewTask->lpNextTask = NULL;
|
lpNewTask->lpNextTask = NULL;
|
||||||
lpNewTask->hIcon = 0;
|
lpNewTask->hIcon = 0;
|
||||||
lpNewTask->hModule = 0;
|
lpNewTask->te.dwSize = sizeof(TASKENTRY);
|
||||||
lpNewTask->hInst = hInst;
|
lpNewTask->te.hModule = 0;
|
||||||
lpNewTask->hTask = hTask;
|
lpNewTask->te.hInst = hInst;
|
||||||
|
lpNewTask->te.hTask = hTask;
|
||||||
|
lpNewTask->te.hTaskParent = hTaskParent;
|
||||||
|
lpNewTask->te.wSS = 0;
|
||||||
|
lpNewTask->te.wSP = 0;
|
||||||
|
lpNewTask->te.wStackTop = 0;
|
||||||
|
lpNewTask->te.wStackMinimum = 0;
|
||||||
|
lpNewTask->te.wStackBottom = 0;
|
||||||
|
lpNewTask->te.wcEvents = 0;
|
||||||
|
lpNewTask->te.hQueue = 0;
|
||||||
|
sprintf(lpNewTask->te.szModule, "TASK%04X", hInst);
|
||||||
|
lpNewTask->te.wPSPOffset = 0;
|
||||||
lpNewTask->unix_pid = getpid();
|
lpNewTask->unix_pid = getpid();
|
||||||
lpNewTask->lpWndList = (HWND *) malloc(MAXWIN_PER_TASK * sizeof(HWND));
|
lpNewTask->lpWndList = (HWND *) malloc(MAXWIN_PER_TASK * sizeof(HWND));
|
||||||
if (lpNewTask->lpWndList != NULL)
|
if (lpNewTask->lpWndList != NULL)
|
||||||
|
@ -171,12 +183,12 @@ BOOL AddWindowToTask(HTASK hTask, HWND hWnd)
|
||||||
{
|
{
|
||||||
HWND *wptr;
|
HWND *wptr;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
LPTASKENTRY lpTask = lpTaskList;
|
LPWINETASKENTRY lpTask = lpTaskList;
|
||||||
#ifdef DEBUG_TASK
|
#ifdef DEBUG_TASK
|
||||||
printf("AddWindowToTask(%04X, %04X); !\n", hTask, hWnd);
|
printf("AddWindowToTask(%04X, %04X); !\n", hTask, hWnd);
|
||||||
#endif
|
#endif
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (lpTask->hTask == hTask) break;
|
if (lpTask->te.hTask == hTask) break;
|
||||||
if (lpTask == NULL) {
|
if (lpTask == NULL) {
|
||||||
printf("AddWindowToTask // hTask=%04X not found !\n", hTask);
|
printf("AddWindowToTask // hTask=%04X not found !\n", hTask);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -204,12 +216,12 @@ BOOL RemoveWindowFromTask(HTASK hTask, HWND hWnd)
|
||||||
{
|
{
|
||||||
HWND *wptr;
|
HWND *wptr;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
LPTASKENTRY lpTask = lpTaskList;
|
LPWINETASKENTRY lpTask = lpTaskList;
|
||||||
#ifdef DEBUG_TASK
|
#ifdef DEBUG_TASK
|
||||||
printf("RemoveWindowToTask(%04X, %04X); !\n", hTask, hWnd);
|
printf("RemoveWindowToTask(%04X, %04X); !\n", hTask, hWnd);
|
||||||
#endif
|
#endif
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (lpTask->hTask == hTask) break;
|
if (lpTask->te.hTask == hTask) break;
|
||||||
if (lpTask == NULL) {
|
if (lpTask == NULL) {
|
||||||
printf("RemoveWindowFromTask // hTask=%04X not found !\n", hTask);
|
printf("RemoveWindowFromTask // hTask=%04X not found !\n", hTask);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -245,8 +245,24 @@ HEAP_Free(MDESC **free_list, void *block)
|
||||||
* Validate pointer.
|
* Validate pointer.
|
||||||
*/
|
*/
|
||||||
m_free = (MDESC *) block - 1;
|
m_free = (MDESC *) block - 1;
|
||||||
if (m_free->prev != m_free || m_free->next != m_free ||
|
if (m_free->prev != m_free || m_free->next != m_free)
|
||||||
((int) m_free & 0xffff0000) != ((int) *free_list & 0xffff0000))
|
{
|
||||||
|
#ifdef DEBUG_HEAP
|
||||||
|
printf("Attempt to free bad pointer,"
|
||||||
|
"m_free = %08x, *free_list = %08x\n",
|
||||||
|
m_free, free_list);
|
||||||
|
#endif
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*free_list == NULL)
|
||||||
|
{
|
||||||
|
*free_list = m_free;
|
||||||
|
(*free_list)->next = NULL;
|
||||||
|
(*free_list)->prev = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if (((int) m_free & 0xffff0000) != ((int) *free_list & 0xffff0000))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_HEAP
|
#ifdef DEBUG_HEAP
|
||||||
printf("Attempt to free bad pointer,"
|
printf("Attempt to free bad pointer,"
|
||||||
|
|
62
misc/main.c
62
misc/main.c
|
@ -9,6 +9,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xresource.h>
|
#include <X11/Xresource.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
@ -17,6 +18,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
#include "texts.h"
|
||||||
|
|
||||||
#define WINE_CLASS "Wine" /* Class name for resources */
|
#define WINE_CLASS "Wine" /* Class name for resources */
|
||||||
|
|
||||||
|
@ -32,6 +34,7 @@ int screenDepth = 0; /* Screen depth to use */
|
||||||
int desktopX = 0, desktopY = 0; /* Desktop window position (if any) */
|
int desktopX = 0, desktopY = 0; /* Desktop window position (if any) */
|
||||||
|
|
||||||
char *ProgramName; /* Used by resource.c with WINELIB */
|
char *ProgramName; /* Used by resource.c with WINELIB */
|
||||||
|
extern ButtonTexts ButtonText;
|
||||||
|
|
||||||
struct options Options =
|
struct options Options =
|
||||||
{ /* default options */
|
{ /* default options */
|
||||||
|
@ -140,6 +143,54 @@ static int MAIN_GetResource( XrmDatabase db, char *name, XrmValue *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MAIN_GetButtonText
|
||||||
|
*
|
||||||
|
* Fetch the value of resource 'name' using the correct instance name.
|
||||||
|
* 'name' must begin with '.' or '*'
|
||||||
|
*
|
||||||
|
* The address of the string got from the XResoure is stored in Button.Label.
|
||||||
|
* The corresponding hotkey is taken from this string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void MAIN_GetButtonText( XrmDatabase db, char *name, ButtonDesc *Button)
|
||||||
|
{
|
||||||
|
XrmValue value;
|
||||||
|
char Hotkey;
|
||||||
|
char *i;
|
||||||
|
|
||||||
|
if (MAIN_GetResource( db, name, &value))
|
||||||
|
{
|
||||||
|
Button->Label = value.addr;
|
||||||
|
i = strchr(Button->Label,'&');
|
||||||
|
if ( i == NULL )
|
||||||
|
Button->Hotkey = '\0';
|
||||||
|
else if ( i++ == '\0' )
|
||||||
|
Button->Hotkey = '\0';
|
||||||
|
else
|
||||||
|
Button->Hotkey = *i;
|
||||||
|
}
|
||||||
|
Button->Hotkey = toupper(Button->Hotkey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MAIN_GetAllButtonTexts
|
||||||
|
*
|
||||||
|
* Read all Button-labels from X11-resources if they exist.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void MAIN_GetAllButtonTexts(XrmDatabase db)
|
||||||
|
{
|
||||||
|
MAIN_GetButtonText(db, ".YesLabel", &ButtonText.Yes);
|
||||||
|
MAIN_GetButtonText(db, ".NoLabel", &ButtonText.No);
|
||||||
|
MAIN_GetButtonText(db, ".OkLabel", &ButtonText.Ok);
|
||||||
|
MAIN_GetButtonText(db, ".CancelLabel", &ButtonText.Cancel);
|
||||||
|
MAIN_GetButtonText(db, ".AbortLabel", &ButtonText.Abort);
|
||||||
|
MAIN_GetButtonText(db, ".RetryLabel", &ButtonText.Retry);
|
||||||
|
MAIN_GetButtonText(db, ".IgnoreLabel", &ButtonText.Ignore);
|
||||||
|
MAIN_GetButtonText(db, ".CancelLabel", &ButtonText.Cancel);
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* MAIN_ParseOptions
|
* MAIN_ParseOptions
|
||||||
*
|
*
|
||||||
|
@ -152,10 +203,10 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
|
||||||
XrmDatabase db = NULL;
|
XrmDatabase db = NULL;
|
||||||
|
|
||||||
/* Parse command line */
|
/* Parse command line */
|
||||||
|
|
||||||
Options.programName = MAIN_GetProgramName( *argc, argv );
|
Options.programName = MAIN_GetProgramName( *argc, argv );
|
||||||
XrmParseCommand( &db, optionsTable, NB_OPTIONS,
|
XrmParseCommand( &db, optionsTable, NB_OPTIONS,
|
||||||
Options.programName, argc, argv );
|
Options.programName, argc, argv );
|
||||||
|
|
||||||
#ifdef WINELIB
|
#ifdef WINELIB
|
||||||
/* Need to assemble command line and pass it to WinMain */
|
/* Need to assemble command line and pass it to WinMain */
|
||||||
#else
|
#else
|
||||||
|
@ -175,8 +226,10 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get all options */
|
/* Use app-defaults */
|
||||||
|
display->db = db;
|
||||||
|
|
||||||
|
/* Get all options */
|
||||||
if (MAIN_GetResource( db, ".iconic", &value ))
|
if (MAIN_GetResource( db, ".iconic", &value ))
|
||||||
Options.cmdShow = SW_SHOWMINIMIZED;
|
Options.cmdShow = SW_SHOWMINIMIZED;
|
||||||
if (MAIN_GetResource( db, ".privatemap", &value ))
|
if (MAIN_GetResource( db, ".privatemap", &value ))
|
||||||
|
@ -197,6 +250,9 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
|
||||||
screenDepth = atoi( value.addr );
|
screenDepth = atoi( value.addr );
|
||||||
if (MAIN_GetResource( db, ".desktop", &value))
|
if (MAIN_GetResource( db, ".desktop", &value))
|
||||||
Options.desktopGeometry = value.addr;
|
Options.desktopGeometry = value.addr;
|
||||||
|
|
||||||
|
/* MAIN_GetAllButtonTexts(db); */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,6 +368,8 @@ int main( int argc, char *argv[] )
|
||||||
int depth_count, i;
|
int depth_count, i;
|
||||||
int *depth_list;
|
int *depth_list;
|
||||||
|
|
||||||
|
setlocale(LC_CTYPE,"");
|
||||||
|
|
||||||
XrmInitialize();
|
XrmInitialize();
|
||||||
|
|
||||||
MAIN_ParseOptions( &argc, argv );
|
MAIN_ParseOptions( &argc, argv );
|
||||||
|
|
|
@ -19,6 +19,21 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
#include "texts.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defaults for button-texts
|
||||||
|
*/
|
||||||
|
|
||||||
|
ButtonTexts ButtonText = {
|
||||||
|
"&Yes", 'Y',
|
||||||
|
"&No", 'N',
|
||||||
|
"&Ok", 'O',
|
||||||
|
"&Cancel", 'C',
|
||||||
|
"&Abort", 'A',
|
||||||
|
"&Retry", 'R',
|
||||||
|
"&Ignore", 'I'
|
||||||
|
};
|
||||||
|
|
||||||
extern HINSTANCE hSysRes;
|
extern HINSTANCE hSysRes;
|
||||||
extern HBITMAP hUpArrow;
|
extern HBITMAP hUpArrow;
|
||||||
|
@ -175,7 +190,7 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
|
||||||
switch(message) {
|
switch(message) {
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
#ifdef DEBUG_MSGBOX
|
#ifdef DEBUG_MSGBOX
|
||||||
printf("MessageBox WM_CREATE !\n");
|
printf("MessageBox WM_CREATE hWnd=%04X !\n", hWnd);
|
||||||
#endif
|
#endif
|
||||||
wndPtr = WIN_FindWndPtr(hWnd);
|
wndPtr = WIN_FindWndPtr(hWnd);
|
||||||
createStruct = (CREATESTRUCT *)lParam;
|
createStruct = (CREATESTRUCT *)lParam;
|
||||||
|
@ -191,55 +206,55 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
|
||||||
lpmb->rectStr.bottom -= 32;
|
lpmb->rectStr.bottom -= 32;
|
||||||
switch(lpmb->wType & MB_TYPEMASK) {
|
switch(lpmb->wType & MB_TYPEMASK) {
|
||||||
case MB_OK :
|
case MB_OK :
|
||||||
lpmb->hWndYes = CreateWindow("BUTTON", "&Ok",
|
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Ok.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 - 30, rect.bottom - 25,
|
rect.right / 2 - 30, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDOK, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDOK, wndPtr->hInstance, 0L);
|
||||||
break;
|
break;
|
||||||
case MB_OKCANCEL :
|
case MB_OKCANCEL :
|
||||||
lpmb->hWndYes = CreateWindow("BUTTON", "&Ok",
|
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Ok.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 - 65, rect.bottom - 25,
|
rect.right / 2 - 65, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDOK, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDOK, wndPtr->hInstance, 0L);
|
||||||
lpmb->hWndCancel = CreateWindow("BUTTON", "&Cancel",
|
lpmb->hWndCancel = CreateWindow("BUTTON", ButtonText.Cancel.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 + 5, rect.bottom - 25,
|
rect.right / 2 + 5, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDCANCEL, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDCANCEL, wndPtr->hInstance, 0L);
|
||||||
break;
|
break;
|
||||||
case MB_ABORTRETRYIGNORE :
|
case MB_ABORTRETRYIGNORE :
|
||||||
lpmb->hWndYes = CreateWindow("BUTTON", "&Retry",
|
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Retry.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 - 100, rect.bottom - 25,
|
rect.right / 2 - 100, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDRETRY, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDRETRY, wndPtr->hInstance, 0L);
|
||||||
lpmb->hWndNo = CreateWindow("BUTTON", "&Ignore",
|
lpmb->hWndNo = CreateWindow("BUTTON", ButtonText.Ignore.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 - 30, rect.bottom - 25,
|
rect.right / 2 - 30, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDIGNORE, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDIGNORE, wndPtr->hInstance, 0L);
|
||||||
lpmb->hWndCancel = CreateWindow("BUTTON", "&Abort",
|
lpmb->hWndCancel = CreateWindow("BUTTON", ButtonText.Abort.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 + 40, rect.bottom - 25,
|
rect.right / 2 + 40, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDABORT, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDABORT, wndPtr->hInstance, 0L);
|
||||||
break;
|
break;
|
||||||
case MB_YESNO :
|
case MB_YESNO :
|
||||||
lpmb->hWndYes = CreateWindow("BUTTON", "&Yes",
|
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Yes.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 - 65, rect.bottom - 25,
|
rect.right / 2 - 65, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDYES, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDYES, wndPtr->hInstance, 0L);
|
||||||
lpmb->hWndNo = CreateWindow("BUTTON", "&No",
|
lpmb->hWndNo = CreateWindow("BUTTON", ButtonText.No.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 + 5, rect.bottom - 25,
|
rect.right / 2 + 5, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDNO, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDNO, wndPtr->hInstance, 0L);
|
||||||
break;
|
break;
|
||||||
case MB_YESNOCANCEL :
|
case MB_YESNOCANCEL :
|
||||||
lpmb->hWndYes = CreateWindow("BUTTON", "&Yes",
|
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Yes.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 - 100, rect.bottom - 25,
|
rect.right / 2 - 100, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDYES, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDYES, wndPtr->hInstance, 0L);
|
||||||
lpmb->hWndNo = CreateWindow("BUTTON", "&No",
|
lpmb->hWndNo = CreateWindow("BUTTON", ButtonText.No.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 - 30, rect.bottom - 25,
|
rect.right / 2 - 30, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDNO, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDNO, wndPtr->hInstance, 0L);
|
||||||
lpmb->hWndCancel = CreateWindow("BUTTON", "&Cancel",
|
lpmb->hWndCancel = CreateWindow("BUTTON", ButtonText.Cancel.Label,
|
||||||
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
|
||||||
rect.right / 2 + 40, rect.bottom - 25,
|
rect.right / 2 + 40, rect.bottom - 25,
|
||||||
60, 18, hWnd, IDCANCEL, wndPtr->hInstance, 0L);
|
60, 18, hWnd, IDCANCEL, wndPtr->hInstance, 0L);
|
||||||
|
@ -271,6 +286,9 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_SHOWWINDOW:
|
case WM_SHOWWINDOW:
|
||||||
|
#ifdef DEBUG_MSGBOX
|
||||||
|
printf("MessageBox WM_SHOWWINDOW hWnd=%04X !\n", hWnd);
|
||||||
|
#endif
|
||||||
if (!(wParam == 0 && lParam == 0L)) {
|
if (!(wParam == 0 && lParam == 0L)) {
|
||||||
InvalidateRect(hWnd, NULL, TRUE);
|
InvalidateRect(hWnd, NULL, TRUE);
|
||||||
}
|
}
|
||||||
|
@ -281,7 +299,12 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
|
||||||
#endif
|
#endif
|
||||||
lpmb = MsgBoxGetStorageHeader(hWnd);
|
lpmb = MsgBoxGetStorageHeader(hWnd);
|
||||||
if (lpmb == NULL) break;
|
if (lpmb == NULL) break;
|
||||||
|
if (!lpmb->ActiveFlg) break;
|
||||||
hDC = BeginPaint(hWnd, &ps);
|
hDC = BeginPaint(hWnd, &ps);
|
||||||
|
if (hDC == 0) {
|
||||||
|
printf("MessageBox WM_PAINT // BeginPaint returned BAD hDC !\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
GetClientRect(hWnd, &rect);
|
GetClientRect(hWnd, &rect);
|
||||||
FillRect(hDC, &rect, GetStockObject(WHITE_BRUSH));
|
FillRect(hDC, &rect, GetStockObject(WHITE_BRUSH));
|
||||||
CopyRect(&rect, &lpmb->rectStr);
|
CopyRect(&rect, &lpmb->rectStr);
|
||||||
|
@ -307,7 +330,6 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
lpmb = MsgBoxGetStorageHeader(hWnd);
|
lpmb = MsgBoxGetStorageHeader(hWnd);
|
||||||
if (lpmb == NULL) break;
|
if (lpmb == NULL) break;
|
||||||
lpmb->ActiveFlg = FALSE;
|
|
||||||
if (lpmb->hIcon) DestroyIcon(lpmb->hIcon);
|
if (lpmb->hIcon) DestroyIcon(lpmb->hIcon);
|
||||||
if (lpmb->hWndYes) DestroyWindow(lpmb->hWndYes);
|
if (lpmb->hWndYes) DestroyWindow(lpmb->hWndYes);
|
||||||
if (lpmb->hWndNo) DestroyWindow(lpmb->hWndNo);
|
if (lpmb->hWndNo) DestroyWindow(lpmb->hWndNo);
|
||||||
|
@ -315,6 +337,7 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
|
||||||
#ifdef DEBUG_MSGBOX
|
#ifdef DEBUG_MSGBOX
|
||||||
printf("MessageBox WM_DESTROY end !\n");
|
printf("MessageBox WM_DESTROY end !\n");
|
||||||
#endif
|
#endif
|
||||||
|
lpmb->ActiveFlg = FALSE;
|
||||||
break;
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
lpmb = MsgBoxGetStorageHeader(hWnd);
|
lpmb = MsgBoxGetStorageHeader(hWnd);
|
||||||
|
@ -328,36 +351,28 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
|
||||||
break;
|
break;
|
||||||
case WM_CHAR:
|
case WM_CHAR:
|
||||||
lpmb = MsgBoxGetStorageHeader(hWnd);
|
lpmb = MsgBoxGetStorageHeader(hWnd);
|
||||||
|
/* if (wParam >= 'a' || wParam <= 'z') wParam -= 'a' - 'A'; */
|
||||||
|
wParam = toupper(wParam);
|
||||||
|
if (wParam == ButtonText.Yes.Hotkey)
|
||||||
|
lpmb->wRetVal = IDYES;
|
||||||
|
else if (wParam == ButtonText.Ok.Hotkey)
|
||||||
|
lpmb->wRetVal = IDOK;
|
||||||
|
else if (wParam == ButtonText.Retry.Hotkey)
|
||||||
|
lpmb->wRetVal = IDRETRY;
|
||||||
|
else if (wParam == ButtonText.Abort.Hotkey)
|
||||||
|
lpmb->wRetVal = IDABORT;
|
||||||
|
else if (wParam == ButtonText.No.Hotkey)
|
||||||
|
lpmb->wRetVal = IDNO;
|
||||||
|
else if (wParam == ButtonText.Ignore.Hotkey)
|
||||||
|
lpmb->wRetVal = IDIGNORE;
|
||||||
|
else if ((wParam == ButtonText.Ok.Hotkey) || (wParam == VK_ESCAPE))
|
||||||
|
lpmb->wRetVal = IDCANCEL;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
if (lpmb == NULL) break;
|
if (lpmb == NULL) break;
|
||||||
if (wParam >= 'a' || wParam <= 'z') wParam -= 'a' - 'A';
|
ShowWindow(hWnd, SW_HIDE);
|
||||||
switch(wParam) {
|
PostMessage(hWnd, WM_CLOSE, 0, 0L);
|
||||||
case 'Y':
|
break;
|
||||||
lpmb->wRetVal = IDYES;
|
|
||||||
break;
|
|
||||||
case 'O':
|
|
||||||
lpmb->wRetVal = IDOK;
|
|
||||||
break;
|
|
||||||
case 'R':
|
|
||||||
lpmb->wRetVal = IDRETRY;
|
|
||||||
break;
|
|
||||||
case 'A':
|
|
||||||
lpmb->wRetVal = IDABORT;
|
|
||||||
break;
|
|
||||||
case 'N':
|
|
||||||
lpmb->wRetVal = IDNO;
|
|
||||||
break;
|
|
||||||
case 'I':
|
|
||||||
lpmb->wRetVal = IDIGNORE;
|
|
||||||
break;
|
|
||||||
case 'C':
|
|
||||||
case VK_ESCAPE:
|
|
||||||
lpmb->wRetVal = IDCANCEL;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
PostMessage(hWnd, WM_CLOSE, 0, 0L);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return DefWindowProc(hWnd, message, wParam, lParam );
|
return DefWindowProc(hWnd, message, wParam, lParam );
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,14 @@ int WNetGetConnection(LPSTR lpLocalName,
|
||||||
return WN_NET_ERROR;
|
return WN_NET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* WNetGetCaps [USER.513]
|
||||||
|
*/
|
||||||
|
int WNetGetCaps(WORD capability)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* WNetGetUser [USER.516]
|
* WNetGetUser [USER.516]
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,6 +6,7 @@ SRCS = \
|
||||||
emulate.c \
|
emulate.c \
|
||||||
int10.c \
|
int10.c \
|
||||||
int15.c \
|
int15.c \
|
||||||
|
int16.c \
|
||||||
int1a.c \
|
int1a.c \
|
||||||
int21.c \
|
int21.c \
|
||||||
int25.c \
|
int25.c \
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "msdos.h"
|
||||||
|
#include "wine.h"
|
||||||
|
|
||||||
|
int do_int16(struct sigcontext_struct *context)
|
||||||
|
{
|
||||||
|
switch((context->sc_eax >> 8) & 0xff)
|
||||||
|
{
|
||||||
|
case 0xc0:
|
||||||
|
|
||||||
|
default:
|
||||||
|
IntBarf(0x16, context);
|
||||||
|
};
|
||||||
|
return 1;
|
||||||
|
}
|
|
@ -11,9 +11,7 @@ int do_int25(struct sigcontext_struct *context)
|
||||||
if( (ECX & 0xffff) == 0xffff)
|
if( (ECX & 0xffff) == 0xffff)
|
||||||
{
|
{
|
||||||
begin = getdword(dataptr);
|
begin = getdword(dataptr);
|
||||||
|
|
||||||
length = getword(&dataptr[4]);
|
length = getword(&dataptr[4]);
|
||||||
|
|
||||||
dataptr = (BYTE *) getdword(&dataptr[6]);
|
dataptr = (BYTE *) getdword(&dataptr[6]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -23,6 +21,19 @@ int do_int25(struct sigcontext_struct *context)
|
||||||
fprintf(stderr, "int25: abs diskread, drive %d, sector %d, "
|
fprintf(stderr, "int25: abs diskread, drive %d, sector %d, "
|
||||||
"count %d, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
|
"count %d, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
|
||||||
|
|
||||||
|
memset(dataptr, 0, length * 512);
|
||||||
|
|
||||||
|
if (begin == 0 && length > 1)
|
||||||
|
*(dataptr + 512) = 0xf8;
|
||||||
|
|
||||||
|
if (begin == 1)
|
||||||
|
*dataptr = 0xf8;
|
||||||
|
|
||||||
ResetCflag;
|
ResetCflag;
|
||||||
|
|
||||||
|
/* push flags on stack */
|
||||||
|
SP -= sizeof(WORD);
|
||||||
|
setword(pointer(SS,SP), (WORD) EFL);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,5 +23,10 @@ int do_int26(struct sigcontext_struct *context)
|
||||||
" buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
|
" buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
|
||||||
|
|
||||||
ResetCflag;
|
ResetCflag;
|
||||||
|
|
||||||
|
/* push flags on stack */
|
||||||
|
SP -= sizeof(WORD);
|
||||||
|
setword(pointer(SS,SP), (WORD) EFL);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,21 @@
|
||||||
|
|
||||||
int do_int2f(struct sigcontext_struct *context)
|
int do_int2f(struct sigcontext_struct *context)
|
||||||
{
|
{
|
||||||
switch(context->sc_eax & 0xffff)
|
switch((context->sc_eax >> 8) & 0xff)
|
||||||
{
|
{
|
||||||
case 0x1600: /* windows enhanced mode install check */
|
case 0x15: /* mscdex */
|
||||||
/* don't return anything as we're running in standard mode */
|
/* ignore requests */
|
||||||
break;
|
return 1;
|
||||||
|
|
||||||
|
case 0x16:
|
||||||
|
switch(context->sc_eax & 0xff)
|
||||||
|
{
|
||||||
|
case 0x00: /* windows enhanced mode install check */
|
||||||
|
/* don't return anything as we're running in standard mode */
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
IntBarf(0x2f, context);
|
IntBarf(0x2f, context);
|
||||||
|
|
|
@ -47,7 +47,8 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font )
|
||||||
case FF_DECORATIVE: family = "*"; break;
|
case FF_DECORATIVE: family = "*"; break;
|
||||||
default: family = "*"; break;
|
default: family = "*"; break;
|
||||||
}
|
}
|
||||||
AnsiLower(family);
|
else
|
||||||
|
AnsiLower(family);
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
/* Width==0 seems not to be a valid wildcard on SGI's, using * instead */
|
/* Width==0 seems not to be a valid wildcard on SGI's, using * instead */
|
||||||
|
@ -111,7 +112,7 @@ void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont,
|
||||||
metrics->tmDigitizedAspectX = 1;
|
metrics->tmDigitizedAspectX = 1;
|
||||||
metrics->tmDigitizedAspectY = 1;
|
metrics->tmDigitizedAspectY = 1;
|
||||||
|
|
||||||
if (xfont->per_char) average = metrics->tmMaxCharWidth;
|
if (!xfont->per_char) average = metrics->tmMaxCharWidth;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
XCharStruct * charPtr = xfont->per_char;
|
XCharStruct * charPtr = xfont->per_char;
|
||||||
|
|
|
@ -553,3 +553,17 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
|
||||||
printf("EnumObjects // End of enumeration !\n");
|
printf("EnumObjects // End of enumeration !\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* IsGDIObject(GDI.462)
|
||||||
|
*/
|
||||||
|
BOOL IsGDIObject(HANDLE handle)
|
||||||
|
{
|
||||||
|
GDIOBJHDR *object;
|
||||||
|
|
||||||
|
object = (GDIOBJHDR *) GDI_HEAP_ADDR( handle );
|
||||||
|
if (object)
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
|
@ -421,6 +421,21 @@ BOOL GrayString(HDC hdc, HBRUSH hbr, FARPROC gsprc, LPARAM lParam,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* TabbedTextOut [USER.196]
|
||||||
|
*/
|
||||||
|
LONG TabbedTextOut(HDC hDC, short x, short y, LPSTR lpStr, short nCount,
|
||||||
|
short nTabCount, LPINT lpTabPos, short nTabOrg)
|
||||||
|
{
|
||||||
|
WORD width, height;
|
||||||
|
printf("EMPTY STUB !!! TabbedTextOut(); ! call TextOut() for now !\n");
|
||||||
|
height = HIWORD(GetTextExtent(hDC, lpStr, nCount));
|
||||||
|
width = LOWORD(GetTextExtent(hDC, lpStr, nCount));
|
||||||
|
TextOut(hDC, x, y, lpStr, nCount);
|
||||||
|
return MAKELONG(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ExtTextOut [GDI.351]
|
* ExtTextOut [GDI.351]
|
||||||
*/
|
*/
|
||||||
|
@ -432,3 +447,4 @@ BOOL ExtTextOut(HDC hDC, short x, short y, WORD wOptions, LPRECT lprect,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ static XContext winContext = 0;
|
||||||
/* State variables */
|
/* State variables */
|
||||||
BOOL MouseButtonsStates[NB_BUTTONS] = { FALSE, FALSE, FALSE };
|
BOOL MouseButtonsStates[NB_BUTTONS] = { FALSE, FALSE, FALSE };
|
||||||
BOOL AsyncMouseButtonsStates[NB_BUTTONS] = { FALSE, FALSE, FALSE };
|
BOOL AsyncMouseButtonsStates[NB_BUTTONS] = { FALSE, FALSE, FALSE };
|
||||||
|
BYTE KeyStateTable[256];
|
||||||
static WORD ALTKeyState;
|
static WORD ALTKeyState;
|
||||||
static HWND captureWnd = 0;
|
static HWND captureWnd = 0;
|
||||||
Window winHasCursor = 0;
|
Window winHasCursor = 0;
|
||||||
|
@ -164,6 +165,16 @@ void EVENT_ProcessEvent( XEvent *event )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
|
/* Wine between two fast machines across the overloaded campus
|
||||||
|
ethernet gets very boged down in MotionEvents. The following
|
||||||
|
simply finds the last motion event in the queue and drops
|
||||||
|
the rest. On a good link events are servered before they build
|
||||||
|
up so this doesn't take place. On a slow link this may cause
|
||||||
|
problems if the event order is important. I'm not yet seen
|
||||||
|
of any problems. Jon 7/6/96.
|
||||||
|
*/
|
||||||
|
while (XCheckTypedWindowEvent(display, ((XAnyEvent *)event)->window,
|
||||||
|
MotionNotify, event));
|
||||||
EVENT_MotionNotify( (XMotionEvent*)event );
|
EVENT_MotionNotify( (XMotionEvent*)event );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -310,6 +321,7 @@ static void EVENT_key( HWND hwnd, XKeyEvent *event )
|
||||||
if (event->type == KeyPress)
|
if (event->type == KeyPress)
|
||||||
{
|
{
|
||||||
if (vkey == VK_MENU) ALTKeyState = TRUE;
|
if (vkey == VK_MENU) ALTKeyState = TRUE;
|
||||||
|
KeyStateTable[vkey] = 1;
|
||||||
keylp.lp1.count = 1;
|
keylp.lp1.count = 1;
|
||||||
keylp.lp1.code = LOBYTE(event->keycode);
|
keylp.lp1.code = LOBYTE(event->keycode);
|
||||||
keylp.lp1.extended = (extended ? 1 : 0);
|
keylp.lp1.extended = (extended ? 1 : 0);
|
||||||
|
@ -341,6 +353,7 @@ static void EVENT_key( HWND hwnd, XKeyEvent *event )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (vkey == VK_MENU) ALTKeyState = FALSE;
|
if (vkey == VK_MENU) ALTKeyState = FALSE;
|
||||||
|
KeyStateTable[vkey] = 1;
|
||||||
keylp.lp1.count = 1;
|
keylp.lp1.count = 1;
|
||||||
keylp.lp1.code = LOBYTE(event->keycode);
|
keylp.lp1.code = LOBYTE(event->keycode);
|
||||||
keylp.lp1.extended = (extended ? 1 : 0);
|
keylp.lp1.extended = (extended ? 1 : 0);
|
||||||
|
@ -462,6 +475,7 @@ HWND SetCapture(HWND wnd)
|
||||||
|
|
||||||
if (rv == GrabSuccess)
|
if (rv == GrabSuccess)
|
||||||
{
|
{
|
||||||
|
winHasCursor = wnd_p->window;
|
||||||
captureWnd = wnd;
|
captureWnd = wnd;
|
||||||
return old_capture_wnd;
|
return old_capture_wnd;
|
||||||
}
|
}
|
||||||
|
|
|
@ -674,23 +674,30 @@ static BOOL FloodFill_rec(XImage *image, int x, int y,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
XPutPixel(image, x, y, fillp);
|
XPutPixel(image, x, y, fillp);
|
||||||
|
|
||||||
testp = XGetPixel(image, x+1, y+1);
|
if ((x+1 <= endx) && (y+1 <= endy)) {
|
||||||
if (testp != borderp && testp != fillp)
|
testp = XGetPixel(image, x+1, y+1);
|
||||||
FloodFill_rec(image, x+1, y+1, orgx, orgy,
|
if (testp != borderp && testp != fillp)
|
||||||
endx, endy, borderp, fillp);
|
FloodFill_rec(image, x+1, y+1, orgx, orgy,
|
||||||
|
endx, endy, borderp, fillp);
|
||||||
testp = XGetPixel(image, x+1, y-1);
|
}
|
||||||
if (testp != borderp && testp != fillp)
|
if ((x+1 <= endx) && (y-1 >= orgy)) {
|
||||||
|
testp = XGetPixel(image, x+1, y-1);
|
||||||
|
if (testp != borderp && testp != fillp)
|
||||||
FloodFill_rec(image, x+1, y-1, orgx, orgy,
|
FloodFill_rec(image, x+1, y-1, orgx, orgy,
|
||||||
endx, endy, borderp, fillp);
|
endx, endy, borderp, fillp);
|
||||||
testp = XGetPixel(image, x-1, y+1);
|
}
|
||||||
if (testp != borderp && testp != fillp)
|
if ((x-1 >= orgx) && (y+1 <= endy)) {
|
||||||
FloodFill_rec(image, x-1, y+1, orgx, orgy,
|
testp = XGetPixel(image, x-1, y+1);
|
||||||
endx, endy, borderp, fillp);
|
if (testp != borderp && testp != fillp)
|
||||||
testp = XGetPixel(image, x-1, y-1);
|
FloodFill_rec(image, x-1, y+1, orgx, orgy,
|
||||||
if (testp != borderp && testp != fillp)
|
endx, endy, borderp, fillp);
|
||||||
FloodFill_rec(image, x-1, y-1, orgx, orgy,
|
}
|
||||||
endx, endy, borderp, fillp);
|
if ((x-1 >= orgx) && (y-1 >= orgy)) {
|
||||||
|
testp = XGetPixel(image, x-1, y-1);
|
||||||
|
if (testp != borderp && testp != fillp)
|
||||||
|
FloodFill_rec(image, x-1, y-1, orgx, orgy,
|
||||||
|
endx, endy, borderp, fillp);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,8 +744,8 @@ BOOL FloodFill(HDC hdc, short x, short y, DWORD crColor)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!FloodFill_rec(image, x, y,
|
if (!FloodFill_rec(image, x, y,
|
||||||
0, 0,
|
0, 0,
|
||||||
dc->w.DCOrgX + dc->w.DCSizeX,
|
dc->w.DCSizeX-1,
|
||||||
dc->w.DCOrgY + dc->w.DCSizeY,
|
dc->w.DCSizeY-1,
|
||||||
boundrypixel, dc->u.x.brush.pixel)) {
|
boundrypixel, dc->u.x.brush.pixel)) {
|
||||||
XDestroyImage(image);
|
XDestroyImage(image);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -11,9 +11,10 @@ static char Copyright[] = "Copyright Bob Amstadt, 1993";
|
||||||
|
|
||||||
extern BOOL MouseButtonsStates[3];
|
extern BOOL MouseButtonsStates[3];
|
||||||
extern BOOL AsyncMouseButtonsStates[3];
|
extern BOOL AsyncMouseButtonsStates[3];
|
||||||
|
extern BYTE KeyStateTable[256];
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* GetKeyState (USER.106)
|
* GetKeyState [USER.106]
|
||||||
*/
|
*/
|
||||||
int GetKeyState(int keycode)
|
int GetKeyState(int keycode)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +30,15 @@ int GetKeyState(int keycode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* GetKeyboardState [USER.222]
|
||||||
|
*/
|
||||||
|
void GetKeyboardState(BYTE FAR *lpKeyState)
|
||||||
|
{
|
||||||
|
if (lpKeyState != NULL) {
|
||||||
|
memcpy(lpKeyState, KeyStateTable, 256);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
*
|
*
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "sysmetrics.h"
|
#include "sysmetrics.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
|
||||||
/* #define DEBUG_MDI /* */
|
#define DEBUG_MDI /* */
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* MDIRecreateMenuList
|
* MDIRecreateMenuList
|
||||||
|
@ -683,32 +683,37 @@ LONG
|
||||||
DefFrameProc(HWND hwnd, HWND hwndMDIClient, WORD message,
|
DefFrameProc(HWND hwnd, HWND hwndMDIClient, WORD message,
|
||||||
WORD wParam, LONG lParam)
|
WORD wParam, LONG lParam)
|
||||||
{
|
{
|
||||||
switch (message)
|
if (hwndMDIClient)
|
||||||
{
|
{
|
||||||
case WM_COMMAND:
|
switch (message)
|
||||||
MDIBringChildToTop(hwndMDIClient, wParam, TRUE, FALSE);
|
{
|
||||||
break;
|
case WM_COMMAND:
|
||||||
|
MDIBringChildToTop(hwndMDIClient, wParam, TRUE, FALSE);
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_NCLBUTTONDOWN:
|
case WM_NCLBUTTONDOWN:
|
||||||
if (MDIHandleLButton(hwnd, hwndMDIClient, wParam, lParam))
|
if (MDIHandleLButton(hwnd, hwndMDIClient, wParam, lParam))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_NCACTIVATE:
|
case WM_NCACTIVATE:
|
||||||
SendMessage(hwndMDIClient, message, wParam, lParam);
|
SendMessage(hwndMDIClient, message, wParam, lParam);
|
||||||
return MDIPaintMaximized(hwnd, hwndMDIClient, message, wParam, lParam);
|
return MDIPaintMaximized(hwnd, hwndMDIClient,
|
||||||
|
message, wParam, lParam);
|
||||||
|
|
||||||
case WM_NCPAINT:
|
case WM_NCPAINT:
|
||||||
return MDIPaintMaximized(hwnd, hwndMDIClient, message, wParam, lParam);
|
return MDIPaintMaximized(hwnd, hwndMDIClient,
|
||||||
|
message, wParam, lParam);
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
SendMessage(hwndMDIClient, WM_SETFOCUS, wParam, lParam);
|
SendMessage(hwndMDIClient, WM_SETFOCUS, wParam, lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SIZE:
|
|
||||||
MoveWindow(hwndMDIClient, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
case WM_SIZE:
|
||||||
|
MoveWindow(hwndMDIClient, 0, 0,
|
||||||
|
LOWORD(lParam), HIWORD(lParam), TRUE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefWindowProc(hwnd, message, wParam, lParam);
|
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||||
|
|
|
@ -599,22 +599,24 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
|
||||||
if (lpMenu->Height == 0) lpMenu->Height = SYSMETRICS_CYMENU + 1;
|
if (lpMenu->Height == 0) lpMenu->Height = SYSMETRICS_CYMENU + 1;
|
||||||
oldHeight = lpMenu->Height;
|
oldHeight = lpMenu->Height;
|
||||||
rect2.bottom = rect2.top + oldHeight;
|
rect2.bottom = rect2.top + oldHeight;
|
||||||
/* printf("NC_DoNCPaint // menubar old Height=%d\n", oldHeight); */
|
|
||||||
StdDrawMenuBar(hdc, &rect2, lpMenu, suppress_menupaint);
|
StdDrawMenuBar(hdc, &rect2, lpMenu, suppress_menupaint);
|
||||||
GlobalUnlock(wndPtr->wIDmenu);
|
|
||||||
/* printf("NC_DoNCPaint // menubar new Height=%d\n", lpMenu->Height); */
|
|
||||||
if (oldHeight != lpMenu->Height) {
|
if (oldHeight != lpMenu->Height) {
|
||||||
|
printf("NC_DoNCPaint // menubar changed oldHeight=%d != lpMenu->Height=%d\n",
|
||||||
|
oldHeight, lpMenu->Height);
|
||||||
/* Reduce ClientRect according to MenuBar height */
|
/* Reduce ClientRect according to MenuBar height */
|
||||||
wndPtr->rectClient.top -= oldHeight;
|
wndPtr->rectClient.top -= oldHeight;
|
||||||
wndPtr->rectClient.top += lpMenu->Height;
|
wndPtr->rectClient.top += lpMenu->Height;
|
||||||
}
|
}
|
||||||
|
GlobalUnlock(wndPtr->wIDmenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wndPtr->dwStyle & (WS_VSCROLL | WS_HSCROLL)) {
|
if (wndPtr->dwStyle & (WS_VSCROLL | WS_HSCROLL)) {
|
||||||
if (wndPtr->dwStyle & WS_VSCROLL) {
|
if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->VScroll != NULL) &&
|
||||||
|
(wndPtr->scroll_flags & 0x0001)) {
|
||||||
int bottom = rect.bottom;
|
int bottom = rect.bottom;
|
||||||
if (wndPtr->dwStyle & WS_HSCROLL) bottom -= SYSMETRICS_CYHSCROLL;
|
if ((wndPtr->dwStyle & WS_HSCROLL) && (wndPtr->scroll_flags & 0x0001))
|
||||||
|
bottom -= SYSMETRICS_CYHSCROLL;
|
||||||
SetRect(&rect2, rect.right - SYSMETRICS_CXVSCROLL,
|
SetRect(&rect2, rect.right - SYSMETRICS_CXVSCROLL,
|
||||||
rect.top, rect.right, bottom);
|
rect.top, rect.right, bottom);
|
||||||
if (wndPtr->dwStyle & WS_CAPTION) rect.top += SYSMETRICS_CYSIZE;
|
if (wndPtr->dwStyle & WS_CAPTION) rect.top += SYSMETRICS_CYSIZE;
|
||||||
|
@ -622,21 +624,23 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
|
||||||
rect2.top += SYSMETRICS_CYMENU + 1;
|
rect2.top += SYSMETRICS_CYMENU + 1;
|
||||||
StdDrawScrollBar(hwnd, hdc, SB_VERT, &rect2, (LPHEADSCROLL)wndPtr->VScroll);
|
StdDrawScrollBar(hwnd, hdc, SB_VERT, &rect2, (LPHEADSCROLL)wndPtr->VScroll);
|
||||||
}
|
}
|
||||||
if (wndPtr->dwStyle & WS_HSCROLL) {
|
if ((wndPtr->dwStyle & WS_HSCROLL) && wndPtr->HScroll != NULL &&
|
||||||
|
(wndPtr->scroll_flags & 0x0002)) {
|
||||||
int right = rect.right;
|
int right = rect.right;
|
||||||
if (wndPtr->dwStyle & WS_VSCROLL) right -= SYSMETRICS_CYVSCROLL;
|
if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->scroll_flags & 0x0001))
|
||||||
|
right -= SYSMETRICS_CYVSCROLL;
|
||||||
SetRect(&rect2, rect.left, rect.bottom - SYSMETRICS_CYHSCROLL,
|
SetRect(&rect2, rect.left, rect.bottom - SYSMETRICS_CYHSCROLL,
|
||||||
right, rect.bottom);
|
right, rect.bottom);
|
||||||
StdDrawScrollBar(hwnd, hdc, SB_HORZ, &rect2, (LPHEADSCROLL)wndPtr->HScroll);
|
StdDrawScrollBar(hwnd, hdc, SB_HORZ, &rect2, (LPHEADSCROLL)wndPtr->HScroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->dwStyle & WS_HSCROLL))
|
if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->dwStyle & WS_HSCROLL) &&
|
||||||
{
|
(wndPtr->scroll_flags & 0x0003) == 0x0003) {
|
||||||
RECT r = rect;
|
RECT r = rect;
|
||||||
r.left = r.right - SYSMETRICS_CXVSCROLL;
|
r.left = r.right - SYSMETRICS_CXVSCROLL;
|
||||||
r.top = r.bottom - SYSMETRICS_CYHSCROLL;
|
r.top = r.bottom - SYSMETRICS_CYHSCROLL;
|
||||||
FillRect( hdc, &r, sysColorObjects.hbrushScrollbar );
|
FillRect( hdc, &r, sysColorObjects.hbrushScrollbar );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseDC( hwnd, hdc );
|
ReleaseDC( hwnd, hdc );
|
||||||
|
|
|
@ -201,6 +201,7 @@ BOOL WIN_CreateDesktopWindow()
|
||||||
wndPtr->hdce = 0;
|
wndPtr->hdce = 0;
|
||||||
wndPtr->VScroll = NULL;
|
wndPtr->VScroll = NULL;
|
||||||
wndPtr->HScroll = NULL;
|
wndPtr->HScroll = NULL;
|
||||||
|
wndPtr->scroll_flags = 0;
|
||||||
wndPtr->wIDmenu = 0;
|
wndPtr->wIDmenu = 0;
|
||||||
wndPtr->hText = 0;
|
wndPtr->hText = 0;
|
||||||
wndPtr->flags = 0;
|
wndPtr->flags = 0;
|
||||||
|
@ -318,6 +319,7 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
|
||||||
wndPtr->flags = 0;
|
wndPtr->flags = 0;
|
||||||
wndPtr->VScroll = NULL;
|
wndPtr->VScroll = NULL;
|
||||||
wndPtr->HScroll = NULL;
|
wndPtr->HScroll = NULL;
|
||||||
|
wndPtr->scroll_flags = 0;
|
||||||
wndPtr->hSysMenu = 0;
|
wndPtr->hSysMenu = 0;
|
||||||
wndPtr->hProp = 0;
|
wndPtr->hProp = 0;
|
||||||
wndPtr->hTask = 0;
|
wndPtr->hTask = 0;
|
||||||
|
@ -692,8 +694,11 @@ LONG SetWindowLong( HWND hwnd, short offset, LONG newval )
|
||||||
else switch(offset)
|
else switch(offset)
|
||||||
{
|
{
|
||||||
case GWL_STYLE: ptr = &wndPtr->dwStyle;
|
case GWL_STYLE: ptr = &wndPtr->dwStyle;
|
||||||
|
break;
|
||||||
case GWL_EXSTYLE: ptr = &wndPtr->dwExStyle;
|
case GWL_EXSTYLE: ptr = &wndPtr->dwExStyle;
|
||||||
|
break;
|
||||||
case GWL_WNDPROC: ptr = (LONG *)(&wndPtr->lpfnWndProc);
|
case GWL_WNDPROC: ptr = (LONG *)(&wndPtr->lpfnWndProc);
|
||||||
|
break;
|
||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
retval = *ptr;
|
retval = *ptr;
|
||||||
|
|
Loading…
Reference in New Issue