#include "winbase.h"
#include "winnt.h"
+#include "wownt32.h"
#include "win.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#define EDIT_NOTIFY_PARENT(es, wNotifyCode, str) \
do \
{ /* Notify parent which has created this edit control */ \
- TRACE("notification " str " sent to hwnd=%08x\n", es->hwndParent); \
+ TRACE("notification " str " sent to hwnd=%p\n", es->hwndParent); \
SendMessageW(es->hwndParent, WM_COMMAND, \
MAKEWPARAM(GetWindowLongW((es->hwndSelf),GWL_ID), wNotifyCode), \
(LPARAM)(es->hwndSelf)); \
EDITSTATE *es = (EDITSTATE *)GetWindowLongW( hwnd, 0 );
LRESULT result = 0;
- TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", hwnd, msg, wParam, lParam);
+ TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n", hwnd, msg, wParam, lParam);
if (!es && msg != WM_NCCREATE)
return DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
* the string under examination (we can decide this for ourselves).
*
*/
-/* ### start build ### */
-extern WORD CALLBACK EDIT_CallTo16_word_lwww(EDITWORDBREAKPROC16,SEGPTR,WORD,WORD,WORD);
-/* ### stop build ### */
static INT EDIT_CallWordBreakProc(EDITSTATE *es, INT start, INT index, INT count, INT action)
{
INT ret, iWndsLocks;
HGLOBAL16 hglob16;
SEGPTR segptr;
INT countA;
+ WORD args[5];
+ DWORD result;
countA = WideCharToMultiByte(CP_ACP, 0, es->text + start, count, NULL, 0, NULL, NULL);
hglob16 = GlobalAlloc16(GMEM_MOVEABLE | GMEM_ZEROINIT, countA);
segptr = K32WOWGlobalLock16(hglob16);
WideCharToMultiByte(CP_ACP, 0, es->text + start, count, MapSL(segptr), countA, NULL, NULL);
- ret = (INT)EDIT_CallTo16_word_lwww(es->word_break_proc16,
- segptr, index, countA, action);
+ args[4] = SELECTOROF(segptr);
+ args[3] = OFFSETOF(segptr);
+ args[2] = index;
+ args[1] = countA;
+ args[0] = action;
+ WOWCallback16Ex((DWORD)es->word_break_proc16, WCB16_PASCAL, sizeof(args), args, &result);
+ ret = LOWORD(result);
GlobalUnlock16(hglob16);
GlobalFree16(hglob16);
}
if (es->hloc32W) {
UINT alloc_size = ROUND_TO_GROW((size + 1) * sizeof(WCHAR));
if ((hNew32W = LocalReAlloc(es->hloc32W, alloc_size, LMEM_MOVEABLE | LMEM_ZEROINIT))) {
- TRACE("Old 32 bit handle %08x, new handle %08x\n", es->hloc32W, hNew32W);
+ TRACE("Old 32 bit handle %p, new handle %p\n", es->hloc32W, hNew32W);
es->hloc32W = hNew32W;
es->buffer_size = LocalSize(hNew32W)/sizeof(WCHAR) - 1;
}
alloc_size = ROUND_TO_GROW((size + 1) * sizeof(WCHAR));
if ((es->undo_text = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, es->undo_text, alloc_size))) {
- es->undo_buffer_size = alloc_size/sizeof(WCHAR);
+ es->undo_buffer_size = alloc_size/sizeof(WCHAR) - 1;
return TRUE;
}
else
es->format_rect.bottom = es->format_rect.top + es->line_height;
if ((es->style & ES_MULTILINE) && !(es->style & ES_AUTOHSCROLL))
- EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, (HRGN)0);
+ EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, NULL);
}
/* Edit window might be already destroyed */
if(!IsWindow(es->hwndSelf))
{
- WARN("edit hwnd %04x already destroyed\n", es->hwndSelf);
+ WARN("edit hwnd %p already destroyed\n", es->hwndSelf);
return;
}
hLocal = es->hloc32A;
}
- TRACE("Returning %04X, LocalSize() = %ld\n", hLocal, LocalSize(hLocal));
+ TRACE("Returning %p, LocalSize() = %ld\n", hLocal, LocalSize(hLocal));
return hLocal;
}
GetClientRect(es->hwndSelf, &rc1);
IntersectRect(&rc, &rc1, &es->format_rect);
ScrollWindowEx(es->hwndSelf, -dx, dy,
- NULL, &rc, (HRGN)NULL, NULL, SW_INVALIDATE);
+ NULL, &rc, NULL, NULL, SW_INVALIDATE);
/* force scroll info update */
EDIT_UpdateScrollInfo(es);
}
if(es->hloc32A)
{
LocalFree(es->hloc32A);
- es->hloc32A = (HLOCAL)NULL;
+ es->hloc32A = NULL;
}
es->hloc32W = hloc;
}
EDIT_EM_EmptyUndoBuffer(es);
es->flags &= ~EF_MODIFIED;
es->flags &= ~EF_UPDATE;
- EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, (HRGN)0);
+ EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, NULL);
EDIT_UpdateText(es, NULL, TRUE);
EDIT_EM_ScrollCaret(es);
/* force scroll info update */
if(es->hloc32A)
{
LocalFree(es->hloc32A);
- es->hloc32A = (HLOCAL)NULL;
+ es->hloc32A = NULL;
}
countA = LOCAL_Size(hInstance, hloc);
EDIT_EM_EmptyUndoBuffer(es);
es->flags &= ~EF_MODIFIED;
es->flags &= ~EF_UPDATE;
- EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, (HRGN)0);
+ EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, NULL);
EDIT_UpdateText(es, NULL, TRUE);
EDIT_EM_ScrollCaret(es);
/* force scroll info update */
es->word_break_proc16 = NULL;
if ((es->style & ES_MULTILINE) && !(es->style & ES_AUTOHSCROLL)) {
- EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, (HRGN)0);
+ EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, NULL);
EDIT_UpdateText(es, NULL, TRUE);
}
}
es->word_break_proc = NULL;
es->word_break_proc16 = wbp;
if ((es->style & ES_MULTILINE) && !(es->style & ES_AUTOHSCROLL)) {
- EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, (HRGN)0);
+ EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, NULL);
EDIT_UpdateText(es, NULL, TRUE);
}
}
bDropped = TRUE;
nEUI = 0;
- TRACE_(combo)("[%04x]: handling msg %04x (%04x)\n",
- es->hwndSelf, (UINT16)msg, (UINT16)key);
+ TRACE_(combo)("[%p]: handling msg %x (%x)\n", es->hwndSelf, msg, key);
if (key == VK_UP || key == VK_DOWN)
{
*/
static LRESULT EDIT_WM_LButtonUp(EDITSTATE *es)
{
- if (es->bCaptureState && GetCapture() == es->hwndSelf) {
+ if (es->bCaptureState) {
KillTimer(es->hwndSelf, 0);
- ReleaseCapture();
+ if (GetCapture() == es->hwndSelf) ReleaseCapture();
}
es->bCaptureState = FALSE;
return 0;
EDIT_SetRectNP(es, &r);
if (es->style & ES_MULTILINE)
- EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, (HRGN)0);
+ EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, NULL);
else
EDIT_CalcLineWidth_SL(es);