fixed some prototypes by adding stdcall attribute

svn path=/trunk/; revision=812
This commit is contained in:
Boudewijn Dekker 1999-12-01 22:30:48 +00:00
parent eae47571c9
commit 67ad8387f3
28 changed files with 643 additions and 1755 deletions

View file

@ -5,7 +5,7 @@
*/
#include <windows.h>
#include <user32/widgets.h>
#include <user32/paint.h>
#include <user32/sysmetr.h>
#include <user32/win.h>
#include <user32/heapdup.h>
@ -39,14 +39,21 @@ HWND ICONTITLE_Create( WND* wnd )
WND* wndPtr;
HWND hWnd;
if( wnd->dwStyle & WS_CHILD )
hWnd = CreateWindowExA( 0, ICONTITLE_CLASS_NAME, NULL,
if( wnd->dwStyle & WS_CHILD ) {
hWnd = CreateWindowExA( 0, ICONTITLE_CLASS_NAME_A, NULL,
WS_CHILD | WS_CLIPSIBLINGS, 0, 0, 1, 1,
wnd->parent->hwndSelf, 0, wnd->hInstance, NULL );
else
hWnd = CreateWindowExA( 0, ICONTITLE_CLASS_NAME, NULL,
}
else {
hWnd = CreateWindowExA( 0, ICONTITLE_CLASS_NAME_A, NULL,
WS_CLIPSIBLINGS, 0, 0, 1, 1,
wnd->hwndSelf, 0, wnd->hInstance, NULL );
}
wndPtr = WIN_FindWndPtr( hWnd );
if( wndPtr )
{

View file

@ -1,4 +1,5 @@
#include <windows.h>
//#include <user32/uitools.h>
#include <user32/debug.h>
WINBOOL STDCALL DrawEdge( HDC hdc, LPRECT rc, UINT edge, UINT flags )
@ -11,24 +12,3 @@ WINBOOL STDCALL DrawEdge( HDC hdc, LPRECT rc, UINT edge, UINT flags )
else
return UITOOLS95_DrawRectEdge(hdc, rc, edge, flags);
}
WINBOOL DrawIcon(HDC hDC, int xLeft, int yTop, HICON hIcon
)
{
return FALSE;
}
WINBOOL
STDCALL
DrawIconEx(HDC hdc, int xLeft, int yTop,
HICON hIcon, int cxWidth, int cyWidth,
UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
{
}
WINBOOL
STDCALL
DrawFocusRect(
HDC hDC,
CONST RECT * lprc)
{
}

View file

@ -1,14 +1,12 @@
#include <windows.h>
#include <user32/win.h>
#include <user32/paint.h>
/***********************************************************************
* FillWindow (USER.324)
*/
void FillWindow( HWND hwndParent, HWND hwnd, HDC hdc, HBRUSH hbrush )
{
RECT rect;
GetClientRect( hwnd, &rect );
// DPtoLP16( hdc, (LPPOINT16)&rect, 2 );
PaintRect( hwndParent, hwnd, hdc, hbrush, &rect );
}
@ -34,23 +32,8 @@ void PaintRect( HWND hwndParent, HWND hwnd, HDC hdc,
}
/***********************************************************************
* GetControlBrush (USER.326)
*/
HBRUSH STDCALL GetControlBrush( HWND hwnd, HDC hdc, UINT ctlType )
{
WND* wndPtr = WIN_FindWndPtr( hwnd );
if((ctlType <= CTLCOLOR_MAX) && wndPtr )
{
WND* parent;
if( wndPtr->dwStyle & WS_POPUP ) parent = wndPtr->owner;
else parent = wndPtr->parent;
if( !parent ) parent = wndPtr;
return (HBRUSH)PAINT_GetControlBrush( parent->hwndSelf, hwnd, hdc, ctlType );
}
return (HBRUSH)0;
}
INT STDCALL FrameRect( HDC hdc, const RECT *rect, HBRUSH hbrush )
{

View file

@ -82,12 +82,16 @@ GetIconInfo(
HICON hIcon,
PICONINFO piconinfo)
{
return TRUE;
}
HICON LoadIconA(HINSTANCE hInstance,LPCSTR lpIconName )
HICON
STDCALL
LoadIconA(HINSTANCE hInstance,LPCSTR lpIconName )
{
HRSRC hrsrc;
ICONINFO *IconInfo;
@ -96,7 +100,7 @@ HICON LoadIconA(HINSTANCE hInstance,LPCSTR lpIconName )
return LoadStandardIcon((UINT)lpIconName);
}
//RT_GROUP_ICON
hrsrc = FindResourceExA(hInstance,RT_GROUP_ICON, lpIconName, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
hrsrc = FindResourceExA(hInstance,RT_GROUP_ICON, lpIconName, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
if ( hrsrc == NULL )
return NULL;
@ -108,7 +112,9 @@ hrsrc = FindResourceExA(hInstance,RT_GROUP_ICON, lpIconName, MAKELANGID(LANG_NEU
return CreateIconIndirect(IconInfo);
}
HICON LoadIconW(HINSTANCE hInstance,LPCWSTR lpIconName )
HICON
STDCALL
LoadIconW(HINSTANCE hInstance,LPCWSTR lpIconName )
{
HRSRC hrsrc;
ICONINFO *IconInfo;
@ -164,4 +170,32 @@ HICON LoadStandardIcon(UINT IconId)
}
return NULL;
}
WINBOOL STDCALL DrawIcon(HDC hDC, int xLeft, int yTop, HICON hIcon )
{
return DrawIconEx( hDC, xLeft, yTop,hIcon, -1, -1,0,NULL, DI_DEFAULTSIZE);
}
WINBOOL
STDCALL
DrawIconEx(HDC hdc, int xLeft, int yTop,
HICON hIcon, int cxWidth, int cyWidth,
UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
{
//ICONINFO IconInfo;
//SIZE Size;;
//GetIconInfo(hIcon,&IconInfo);
//GetBitmapDimensionEx(IconInfo.hbmMask,&Size);
return FALSE;
}
WINBOOL
STDCALL
DrawFocusRect(
HDC hDC,
CONST RECT * lprc)
{
return FALSE;
}

View file

@ -7,44 +7,70 @@ DCE *firstDCE = 0;
HDC defaultDCstate = 0;
/***********************************************************************
* REGION_UnionRectWithRgn
* Adds a rectangle to a HRGN32
* A helper used by scroll.c
*/
WINBOOL REGION_UnionRectWithRgn( HRGN hrgn, const RECT *lpRect )
{
HRGN hRgn;
hRgn = CreateRectRgn(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
CombineRgn(hrgn,hrgn,hRgn, RGN_DIFF);
return TRUE;
}
/***********************************************************************
* DCE_AllocDCE
*
* Allocate a new DCE.
*/
DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type )
DCE *DCE_AllocDCE( struct tagWND * wndPtr, DCE_TYPE type )
{
DCE * dce;
if (!(dce = HeapAlloc( GetProcessHeap(), 0, sizeof(DCE) ))) return NULL;
if (!(dce->hDC = CreateDC( "DISPLAY", NULL, NULL, NULL )))
if (!(dce->hDC = CreateDC( "DISPLAY", NULL, NULL, NULL)))
{
HeapFree( GetProcessHeap(), 0, dce );
return 0;
}
/* store DCE handle in DC hook data field */
//SetDCHook( dce->hDC, (FARPROC)DCHook, (DWORD)dce );
dce->hwndCurrent = hWnd;
/* store DCE handle in DC hook data field */
if ( wndPtr != NULL ) {
OffsetWindowOrgEx(dce->hDC,-wndPtr->rectWindow.left, -wndPtr->rectWindow.top, NULL );
dce->hwndCurrent = wndPtr->hwndSelf;
}
else
dce->hwndCurrent = NULL;
dce->hClipRgn = 0;
dce->next = firstDCE;
firstDCE = dce;
FillRect(dce->hDC,&(wndPtr->rectWindow),GetStockObject(GRAY_BRUSH));
#if 0
if( type != DCE_CACHE_DC ) /* owned or class DC */
{
dce->DCXflags = DCX_DCEBUSY;
if( hWnd )
if( wndPtr != NULL )
{
WND* wnd = WIN_FindWndPtr(hWnd);
if( wnd->dwStyle & WS_CLIPCHILDREN ) dce->DCXflags |= DCX_CLIPCHILDREN;
if( wnd->dwStyle & WS_CLIPSIBLINGS ) dce->DCXflags |= DCX_CLIPSIBLINGS;
if( wndPtr->dwStyle & WS_CLIPCHILDREN ) dce->DCXflags |= DCX_CLIPCHILDREN;
if( wndPtr->dwStyle & WS_CLIPSIBLINGS ) dce->DCXflags |= DCX_CLIPSIBLINGS;
}
//SetHookFlags(dce->hDC,DCHF_INVALIDATEVISRGN);
}
else dce->DCXflags = DCX_CACHE | DCX_DCEEMPTY;
#endif
return dce;
}
@ -86,7 +112,7 @@ void DCE_DeleteClipRgn( DCE* dce )
//DPRINT("\trestoring VisRgn\n");
RestoreVisRgn(dce->hDC);
SelectClipRgn(dce->hDC,NULL);
}

View file

@ -18,7 +18,6 @@
#include <user32/debug.h>
void FillWindow( HWND hwndParent, HWND hwnd, HDC hdc, HBRUSH hbrush );
#define WM_CTLCOLOR 0x0019
#define WM_ISACTIVEICON 0x0035
@ -80,8 +79,11 @@ void DEFWND_SetTextA( WND *wndPtr, LPCSTR text )
{
if (!text) text = "";
if (wndPtr->text) HeapFree( GetProcessHeap(), 0, wndPtr->text );
wndPtr->text = (void *)HEAP_strdupA( GetProcessHeap(), 0, text );
NC_HandleNCPaint( wndPtr->hwndSelf , (HRGN)1 ); /* Repaint caption */
wndPtr->text = (void *)HEAP_strdupA( GetProcessHeap(), 0, text );
if ( wndPtr->dwStyle & WS_CAPTION )
NC_HandleNCPaint( wndPtr->hwndSelf , (HRGN)1 ); /* Repaint caption */
}
@ -90,7 +92,8 @@ void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text )
if (!text) text = L"";
if (wndPtr->text) HeapFree( GetProcessHeap(), 0, wndPtr->text );
wndPtr->text = (void *)HEAP_strdupW( GetProcessHeap(), 0, text );
NC_HandleNCPaint( wndPtr->hwndSelf , (HRGN)1 ); /* Repaint caption */
if ( wndPtr->dwStyle & WS_CAPTION )
NC_HandleNCPaint( wndPtr->hwndSelf , (HRGN)1 ); /* Repaint caption */
}
/***********************************************************************

View file

@ -4,6 +4,19 @@
* Copyright 1993, 1994, 1996 Alexandre Julliard
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/user32/internal/dialog.c
* PURPOSE: Reads resources and creates dialogs
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 09/09/99: Modified
* TODO Fixup fonts and fonts and text metrics
Warnings
references to libc
*/
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
@ -48,8 +61,6 @@ WINBOOL DIALOG_Init(void)
if (!(tm.tmPitchAndFamily & TMPF_FIXED_PITCH))
xBaseUnit = xBaseUnit * 5 / 4;
DPRINT( "base units = %d,%d\n",
xBaseUnit, yBaseUnit );
return TRUE;
}
@ -110,7 +121,9 @@ LPCDLGITEMTEMPLATE DIALOG_ParseTemplate( LPCDLGTEMPLATE DlgTemplate, DLG_TEMPLA
result->cx = DlgTemplate->cx;
result->cy = DlgTemplate->cy;
printf("%d %d %d %d\n",result->x, result->y, result->cx, result->cy);
p = &(DlgTemplate->cy);
p++;
@ -160,11 +173,14 @@ LPCDLGITEMTEMPLATE DIALOG_ParseTemplate( LPCDLGTEMPLATE DlgTemplate, DLG_TEMPLA
break;
}
result->caption = L"";
/* Get the window caption */
if ( *p != 0 ) {
result->caption = (LPCWSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
/* Get the font name */
if (result->style & DS_SETFONT)
@ -174,7 +190,7 @@ LPCDLGITEMTEMPLATE DIALOG_ParseTemplate( LPCDLGTEMPLATE DlgTemplate, DLG_TEMPLA
if (result->dialogEx)
{
result->weight = *p; p++;
result->italic = *p; p++;
result->italic = LOBYTE(*p); p++;
}
else
{
@ -182,13 +198,35 @@ LPCDLGITEMTEMPLATE DIALOG_ParseTemplate( LPCDLGTEMPLATE DlgTemplate, DLG_TEMPLA
result->italic = FALSE;
}
result->faceName = (LPCWSTR)p;
p += lstrlenW( (LPCWSTR)p );
p++;
p += lstrlenW( (LPCWSTR)p ) + 1;
}
} else {
result->caption = L"";
}
}
else if ( *(p+1) != 0 ) {
p++;
/* Get the font name */
if (result->style & DS_SETFONT)
{
result->pointSize = *p;
p++;
if (result->dialogEx)
{
result->weight = *p; p++;
result->italic = LOBYTE(*p); p++;
}
else
{
result->weight = FW_DONTCARE;
result->italic = FALSE;
}
result->faceName = (LPCWSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
}
}
@ -264,11 +302,39 @@ LPCDLGITEMTEMPLATEEX DIALOG_ParseTemplateEx( LPCDLGTEMPLATEEX DlgTemplate, DLG_
break;
}
result->caption = L"";
/* Get the window caption */
if ( *p != 0 ) {
result->caption = (LPCWSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
/* Get the font name */
if (result->style & DS_SETFONT)
{
result->pointSize = *p;
p++;
if (result->dialogEx)
{
result->weight = *p; p++;
result->italic = LOBYTE(*p); p++;
}
else
{
result->weight = FW_DONTCARE;
result->italic = FALSE;
}
result->faceName = (LPCWSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
}
}
else if ( *(p+1) != 0 ) {
p++;
/* Get the font name */
if (result->style & DS_SETFONT)
@ -289,8 +355,7 @@ LPCDLGITEMTEMPLATEEX DIALOG_ParseTemplateEx( LPCDLGTEMPLATEEX DlgTemplate, DLG_
p += lstrlenW( (LPCWSTR)p ) + 1;
}
} else
result->caption = L"";
}
/* First control is on dword boundary */
@ -318,7 +383,7 @@ LPCDLGITEMTEMPLATE DIALOG_GetControl( LPCDLGITEMTEMPLATE DlgItemTemplate, DLG_CO
info->cx = DlgItemTemplate->cx;
info->cy = DlgItemTemplate->cy;
info->id = DlgItemTemplate->id;
@ -343,9 +408,6 @@ LPCDLGITEMTEMPLATE DIALOG_GetControl( LPCDLGITEMTEMPLATE DlgItemTemplate, DLG_CO
info->className = (LPCSTR)HEAP_strdupW(GetProcessHeap(),0,class_names[id - 0x80]);
else
info->className = NULL;
printf("%S\n",info->className);
p++;
}
else
@ -415,12 +477,12 @@ LPCDLGITEMTEMPLATEEX DIALOG_GetControlEx( LPCDLGITEMTEMPLATEEX DlgItemTemplate,
static const WCHAR class_names[6][10] =
{
{ L"Button" }, /* 0x80 */
{ L"Edit"}, /* 0x81 */
{ L"Static" }, /* 0x82 */
{ L"ListBox"}, /* 0x83 */
{ L"ScrollBar" }, /* 0x84 */
{ L"ComboBox" } /* 0x85 */
{ BUTTON_CLASS_NAME }, /* 0x80 */
{ EDIT_CLASS_NAME }, /* 0x81 */
{ STATIC_CLASS_NAME }, /* 0x82 */
{ LISTBOX_CLASS_NAME}, /* 0x83 */
{ SCROLLBAR_CLASS_NAME }, /* 0x84 */
{ COMBOBOX_CLASS_NAME } /* 0x85 */
};
p++;
id = (WORD)*(p);
@ -488,14 +550,16 @@ WINBOOL DIALOG_CreateControls( HANDLE hWndDialog, DIALOGINFO *dlgInfo ,
else
template = (void *)DIALOG_GetControl( (LPDLGITEMTEMPLATE)template, &info );
hwndCtrl = CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
(LPCWSTR)info.className,
(LPCWSTR)info.windowName,
info.style | WS_CHILD | WS_THICKFRAME | WS_VISIBLE,
info.x * dlgInfo->xBaseUnit / 4,
info.y * dlgInfo->yBaseUnit / 8,
info.cx * dlgInfo->xBaseUnit / 4 ,
info.cy * dlgInfo->yBaseUnit / 8,
info.style | WS_CHILD | WS_VISIBLE ,
info.x * dlgInfo->xBaseUnit / 4,
info.y * dlgInfo->yBaseUnit / 4,
info.cx * dlgInfo->xBaseUnit / 4,
info.cy * dlgInfo->yBaseUnit / 4,
hWndDialog, (HMENU)info.id,
hInst, info.data );
@ -514,6 +578,8 @@ WINBOOL DIALOG_CreateControls( HANDLE hWndDialog, DIALOGINFO *dlgInfo ,
hwndDefButton = hwndCtrl;
dlgInfo->idResult = GetWindowLong( hwndCtrl, GWL_ID );
}
}
}
return TRUE;
@ -549,6 +615,8 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, void *dlgTemplate, HWND owner,
xUnit = xBaseUnit;
yUnit = yBaseUnit;
/* Parse dialog template */
@ -576,22 +644,27 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, void *dlgTemplate, HWND owner,
FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY,
FF_DONTCARE, (LPCWSTR)template.faceName );
if (hFont)
{
TEXTMETRIC tm;
HFONT oldFont;
HDC hdc;
/* Calculate the dialog base units */
HDC hdc = GetDC(0);
oldFont = SelectObject( hdc, hFont );
GetTextMetrics( hdc, &tm );
SelectObject( hdc, oldFont );
ReleaseDC( 0, hdc );
hdc = CreateDC( L"DISPLAY", NULL, NULL, NULL );
SelectObject( hdc, hFont );
GetTextMetrics( hdc, &tm );
DeleteDC( hdc );
xUnit = tm.tmAveCharWidth;
yUnit = tm.tmHeight;
if (!(tm.tmPitchAndFamily & TMPF_FIXED_PITCH))
xBaseUnit = xBaseUnit * 5 / 4; /* See DIALOG_Init() */
}
}
@ -600,6 +673,13 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, void *dlgTemplate, HWND owner,
rect.left = rect.top = 0;
rect.right = template.cx * xUnit / 4;
rect.bottom = template.cy * yUnit / 8;
//rect.left = template.x;
//rect.top = template.y;
//rect.right = template.cx + template.x;
//rect.bottom = template.cy + template.y;
if (template.style & DS_MODALFRAME)
template.exStyle |= WS_EX_DLGMODALFRAME;
AdjustWindowRectEx( &rect, template.style,
@ -607,6 +687,7 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, void *dlgTemplate, HWND owner,
rect.right -= rect.left;
rect.bottom -= rect.top;
if ((INT)template.x == CW_USEDEFAULT)
{
rect.left = rect.top = CW_USEDEFAULT;
@ -616,7 +697,7 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, void *dlgTemplate, HWND owner,
if (template.style & DS_CENTER)
{
rect.left = (SYSMETRICS_CXSCREEN - rect.right) / 2;
rect.top = (SYSMETRICS_CYSCREEN - rect.bottom) / 2;
rect.top = (SYSMETRICS_CYSCREEN - rect.bottom) / 3;
}
else
{
@ -644,11 +725,12 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, void *dlgTemplate, HWND owner,
// template.style & ~WS_VISIBLE
template.style |= WS_VISIBLE;
template.style |= WS_THICKFRAME;
//template.style |= WS_VISIBLE;
//template.style |= WS_THICKFRAME;
//template.style |= WS_SYSMENU;
hwnd = CreateWindowExW(template.exStyle, (LPCWSTR)template.className,
(LPCWSTR)template.caption,
template.style ,
template.style & ~WS_VISIBLE ,
rect.left, rect.top, rect.right, rect.bottom ,
owner, hMenu, hInst, NULL );
@ -669,7 +751,9 @@ template.style |= WS_THICKFRAME;
dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
dlgInfo->dlgProc = dlgProc;
dlgInfo->hUserFont = hFont;
//dlgInfo->hUserFont = hFont;
dlgInfo->hUserFont = NULL;
dlgInfo->hMenu = hMenu;
dlgInfo->xBaseUnit = xUnit;
dlgInfo->yBaseUnit = yUnit;
@ -701,17 +785,14 @@ template.style |= WS_THICKFRAME;
if (MSG_SendMessage( wndPtr, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param))
SetFocus( dlgInfo->hwndFocus );
//if (template.style & WS_VISIBLE && !(wndPtr->dwStyle & WS_VISIBLE))
//{
if (template.style & WS_VISIBLE && !(wndPtr->dwStyle & WS_VISIBLE))
{
ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
UpdateWindow( hwnd );
// }
}
PAINT_RedrawWindow( wndPtr->hwndSelf, NULL, 0,
RDW_INVALIDATE | RDW_ALLCHILDREN |
RDW_FRAME | RDW_ERASENOW | RDW_ERASE, 0 );
return hwnd;
}

View file

@ -278,8 +278,8 @@ static void NC_GetInsideRect( HWND hwnd, RECT *rect )
rect->top = rect->left = 0;
rect->right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
rect->bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
if ((wndPtr->dwStyle & WS_ICONIC) || (wndPtr->flags & WIN_MANAGED)) return;
// || (wndPtr->flags & WIN_MANAGED)
if ((wndPtr->dwStyle & WS_ICONIC) ) return;
/* Remove frame from rectangle */
if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
@ -317,7 +317,8 @@ NC_GetInsideRect95 (HWND hwnd, RECT *rect)
rect->right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
rect->bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
if ((wndPtr->dwStyle & WS_ICONIC) || (wndPtr->flags & WIN_MANAGED)) return;
// || (wndPtr->flags & WIN_MANAGED)
if ((wndPtr->dwStyle & WS_ICONIC) ) return;
/* Remove frame from rectangle */
if (HAS_FIXEDFRAME (wndPtr->dwStyle, wndPtr->dwExStyle ))
@ -362,7 +363,7 @@ LONG NC_DoNCHitTest (WND *wndPtr, POINT pt )
if (wndPtr->dwStyle & WS_MINIMIZE) return HTCAPTION;
if (!(wndPtr->flags & WIN_MANAGED))
// if (!(wndPtr->flags & WIN_MANAGED))
{
/* Check borders */
if (HAS_THICKFRAME( wndPtr->dwStyle ))
@ -498,7 +499,7 @@ NC_DoNCHitTest95 (WND *wndPtr, POINT pt )
if (wndPtr->dwStyle & WS_MINIMIZE) return HTCAPTION;
if (!(wndPtr->flags & WIN_MANAGED))
// if (!(wndPtr->flags & WIN_MANAGED))
{
/* Check borders */
if (HAS_SIZEFRAME( wndPtr->dwStyle ))
@ -654,7 +655,7 @@ void NC_DrawSysButton( HWND hwnd, HDC hdc, WINBOOL down )
HBITMAP hbitmap;
WND *wndPtr = WIN_FindWndPtr( hwnd );
if( !(wndPtr->flags & WIN_MANAGED) )
// if( !(wndPtr->flags & WIN_MANAGED) )
{
NC_GetInsideRect( hwnd, &rect );
hdcMem = CreateCompatibleDC( hdc );
@ -677,7 +678,7 @@ static void NC_DrawMaxButton( HWND hwnd, HDC hdc, WINBOOL down )
WND *wndPtr = WIN_FindWndPtr( hwnd );
HDC hdcMem;
if( !(wndPtr->flags & WIN_MANAGED) )
// if( !(wndPtr->flags & WIN_MANAGED) )
{
NC_GetInsideRect( hwnd, &rect );
hdcMem = CreateCompatibleDC( hdc );
@ -701,7 +702,7 @@ static void NC_DrawMinButton( HWND hwnd, HDC hdc, WINBOOL down )
WND *wndPtr = WIN_FindWndPtr( hwnd );
HDC hdcMem;
if( !(wndPtr->flags & WIN_MANAGED) )
// if( !(wndPtr->flags & WIN_MANAGED) )
{
NC_GetInsideRect( hwnd, &rect );
hdcMem = CreateCompatibleDC( hdc );
@ -737,7 +738,7 @@ NC_DrawSysButton95 (HWND hwnd, HDC hdc, WINBOOL down)
{
WND *wndPtr = WIN_FindWndPtr( hwnd );
if( !(wndPtr->flags & WIN_MANAGED) )
// if( !(wndPtr->flags & WIN_MANAGED) )
{
HICON hIcon = 0;
RECT rect;
@ -783,7 +784,7 @@ NC_DrawCloseButton95 (HWND hwnd, HDC hdc, WINBOOL down)
HDC hdcMem;
WND *wndPtr = WIN_FindWndPtr( hwnd );
if( !(wndPtr->flags & WIN_MANAGED) )
// if( !(wndPtr->flags & WIN_MANAGED) )
{
BITMAP bmp;
HBITMAP hBmp, hOldBmp;
@ -837,7 +838,8 @@ static void NC_DrawMaxButton95(
HDC hdcMem;
if( !(wndPtr->flags & WIN_MANAGED) ) {
// if( !(wndPtr->flags & WIN_MANAGED) )
{
GetBitmapDimensionEx((bm = IsZoomed(hwnd) ?
(down ? hbitmapRestoreD : hbitmapRestore ) :
(down ? hbitmapMaximizeD : hbitmapMaximize)),
@ -896,9 +898,8 @@ static void NC_DrawMinButton95(
SIZE bmsz;
HBITMAP bm;
HDC hdcMem;
if( !(wndPtr->flags & WIN_MANAGED) &&
GetBitmapDimensionEx((bm = down ? hbitmapMinimizeD :
// !(wndPtr->flags & WIN_MANAGED) &&
if( GetBitmapDimensionEx((bm = down ? hbitmapMinimizeD :
hbitmapMinimize), &bmsz)) {
NC_GetInsideRect95( hwnd, &rect );
@ -1099,7 +1100,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
WND * wndPtr = WIN_FindWndPtr( hwnd );
char buffer[256];
if (wndPtr->flags & WIN_MANAGED) return;
// if (wndPtr->flags & WIN_MANAGED) return;
if (!hbitmapClose)
{
@ -1156,6 +1157,8 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
SetBkMode( hdc, TRANSPARENT );
DrawTextA( hdc, buffer, -1, &r,
DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_NOPREFIX );
}
}
@ -1196,15 +1199,15 @@ void NC_DrawCaption95(
WND *wndPtr = WIN_FindWndPtr( hwnd );
char buffer[256];
HPEN hPrevPen;
int txt;
int txtlen;
if (wndPtr->flags & WIN_MANAGED) return;
// if (wndPtr->flags & WIN_MANAGED) return;
hPrevPen = SelectObject( hdc, GetSysColorPen(COLOR_3DFACE) );
MoveToEx( hdc, r.left, r.bottom - 1, NULL );
LineTo( hdc, r.right, r.bottom - 1 );
SelectObject( hdc, hPrevPen );
// r.bottom - 2;
r.bottom - 2;
FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION :
@ -1239,12 +1242,12 @@ void NC_DrawCaption95(
}
if ( wndPtr->class->bUnicode )
txt = GetWindowTextW( hwnd, buffer, sizeof(buffer) );
txtlen = GetWindowTextW( hwnd, buffer, sizeof(buffer) );
else
txt = GetWindowTextA( hwnd, buffer, sizeof(buffer) );
txtlen = GetWindowTextA( hwnd, buffer, sizeof(buffer) );
if (txt) {
if (txtlen > 0 && txtlen < sizeof(buffer) ) {
NONCLIENTMETRICS nclm;
HFONT hFont, hOldFont;
nclm.cbSize = sizeof(NONCLIENTMETRICS);
@ -1261,9 +1264,10 @@ void NC_DrawCaption95(
if ( wndPtr->class->bUnicode )
DrawTextW( hdc, buffer, -1, &r,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT );
else
else {
DrawTextA( hdc, buffer, -1, &r,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT );
}
DeleteObject(SelectObject (hdc, hOldFont));
}
}
@ -1291,7 +1295,7 @@ void NC_DoNCPaint( WND* wndPtr, HRGN clip, WINBOOL suppress_menupaint )
if (!(hdc = GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return;
if (ExcludeVisRect( hdc, wndPtr->rectClient.left-wndPtr->rectWindow.left,
if (ExcludeClipRect( hdc, wndPtr->rectClient.left-wndPtr->rectWindow.left,
wndPtr->rectClient.top-wndPtr->rectWindow.top,
wndPtr->rectClient.right-wndPtr->rectWindow.left,
wndPtr->rectClient.bottom-wndPtr->rectWindow.top )
@ -1305,15 +1309,16 @@ void NC_DoNCPaint( WND* wndPtr, HRGN clip, WINBOOL suppress_menupaint )
rect.right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
rect.bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) );
if (!(wndPtr->flags & WIN_MANAGED))
// if (!(wndPtr->flags & WIN_MANAGED))
{
if ((wndPtr->dwStyle & WS_BORDER) || (wndPtr->dwStyle & WS_DLGFRAME) ||
(wndPtr->dwExStyle & WS_EX_DLGMODALFRAME))
{
SelectObject( hdc, GetStockObject(NULL_BRUSH) );
Rectangle( hdc, 0, 0, rect.right, rect.bottom );
Rectangle( hdc, rect.top, rect.left, rect.right, rect.bottom );
InflateRect( &rect, -1, -1 );
}
@ -1404,7 +1409,7 @@ void NC_DoNCPaint95(
if (!(hdc = GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return;
if (ExcludeVisRect( hdc, wndPtr->rectClient.left -wndPtr->rectWindow.left,
if (ExcludeClipRect( hdc, wndPtr->rectClient.left -wndPtr->rectWindow.left,
wndPtr->rectClient.top -wndPtr->rectWindow.top,
wndPtr->rectClient.right -wndPtr->rectWindow.left,
wndPtr->rectClient.bottom -wndPtr->rectWindow.top )
@ -1414,13 +1419,20 @@ void NC_DoNCPaint95(
return;
}
rect.top = rect.left = 0;
rect.right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
rect.bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
//rect = wndPtr->rectWindow;
printf("::%d %d\n", rect.right, rect.bottom);
SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) );
if(!(wndPtr->flags & WIN_MANAGED)) {
//if((wndPtr->flags & WIN_MANAGED)) {
if ((wndPtr->dwStyle & WS_BORDER) && ((wndPtr->dwStyle & WS_DLGFRAME) ||
(wndPtr->dwExStyle & WS_EX_DLGMODALFRAME) || (wndPtr->dwStyle & WS_THICKFRAME))) {
DrawEdge(hdc, &rect, EDGE_RAISED, BF_RECT | BF_ADJUST);
@ -1445,7 +1457,7 @@ void NC_DoNCPaint95(
NC_DrawCaption95 (hdc, &r, hwnd, wndPtr->dwStyle,
wndPtr->dwExStyle, active);
}
}
//}
if (HAS_MENU(wndPtr))
{
@ -1499,7 +1511,7 @@ LONG NC_HandleNCPaint( HWND hwnd , HRGN clip)
{
WND* wndPtr = WIN_FindWndPtr( hwnd );
if( wndPtr && wndPtr->dwStyle & WS_VISIBLE )
//if( wndPtr && wndPtr->dwStyle & WS_VISIBLE )
{
if( wndPtr->dwStyle & WS_MINIMIZE )
WINPOS_RedrawIconTitle( hwnd );
@ -1733,8 +1745,9 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
capturePoint = pt = *(POINT*)&dwPoint;
if (IsZoomed(hwnd) || !IsWindowVisible(hwnd) ||
(wndPtr->flags & WIN_MANAGED)) return;
// || (wndPtr->flags & WIN_MANAGED)
if (IsZoomed(hwnd) || !IsWindowVisible(hwnd) )
return;
if ((wParam & 0xfff0) == SC_MOVE)
{
@ -1910,11 +1923,11 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
if (HOOK_IsHooked( WH_CBT ))
{
if ( wndPtr->class->bUnicode == FALSE ) {
if( HOOK_CallHooksA( WH_CBT, HCBT_MOVESIZE, hwnd,(LPARAM)&sizingRect) )
if( HOOK_CallHooksA( WH_CBT, HCBT_MOVESIZE,(WPARAM) hwnd,(LPARAM)&sizingRect) )
sizingRect = wndPtr->rectWindow;
}
else {
if( HOOK_CallHooksW( WH_CBT, HCBT_MOVESIZE, hwnd,(LPARAM)&sizingRect) )
if( HOOK_CallHooksW( WH_CBT, HCBT_MOVESIZE, (WPARAM) hwnd,(LPARAM)&sizingRect) )
sizingRect = wndPtr->rectWindow;
}
}

View file

@ -56,6 +56,8 @@ WINBOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
GetClientRect( hwnd, &rectClient );
OffsetRect(&rectClient,5,16);
if (flags & RDW_INVALIDATE) /* Invalidate */
{
int rgnNotEmpty = COMPLEXREGION;
@ -160,7 +162,8 @@ WINBOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
if (wndPtr->hrgnUpdate) /* wm_painticon wparam is 1 */
SendMessageA( hwnd, (bIcon) ? WM_PAINTICON : WM_PAINT, bIcon, 0 );
}
else if (flags & RDW_ERASENOW)
else
//if (flags & RDW_ERASENOW)
{
//if (wndPtr->flags & WIN_NEEDS_NCPAINT)
WIN_UpdateNCArea( wndPtr, FALSE);
@ -243,6 +246,8 @@ WINBOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
return TRUE;
}
/***********************************************************************
* GetControlBrush Not A Win32 API
*/

View file

@ -97,7 +97,7 @@ void PROPERTY_RemoveWindowProps( HANDLE hwnd )
if (!pWnd)
return (HANDLE)0;
return;
@ -115,8 +115,7 @@ WINBOOL PROPERTY_EnumPropEx(HWND hwnd, PROPVALUE **pv , int maxsize, int *size )
{
PROPERTY *prop, *next;
WND *pWnd;
INT ret = -1;
int i;
int i = 0;
if (!(pWnd = WIN_FindWndPtr( hwnd )))
return FALSE;

View file

@ -1,37 +1,4 @@
#include <windows.h>
INT SelectVisRgn(HDC hdc,HRGN hrgn)
{
return SelectClipRgn(hdc,hrgn);
}
INT RestoreVisRgn(HDC hdc)
{
return SelectClipRgn(hdc,NULL);
}
INT ExcludeVisRect(HDC hDC,INT nLeftRect,INT nTopRect,INT nRightRect,INT nBottomRect)
{
return ExcludeClipRect(hDC, nLeftRect, nTopRect,nRightRect,nBottomRect );
}
HRGN InquireVisRgn(HDC hdc)
{
return hdc;
}
HRGN SaveVisRgn(HDC hdc)
{
return NULL;
}
/***********************************************************************
* REGION_UnionRectWithRgn
* Adds a rectangle to a HRGN32
* A helper used by scroll.c
*/
WINBOOL REGION_UnionRectWithRgn( HRGN hrgn, const RECT *lpRect )
{
return TRUE;
}

View file

@ -64,6 +64,12 @@ HANDLE WIN_CreateWindowEx( CREATESTRUCTW *cs, ATOM classAtom)
wndPtr->parent = WIN_FindWndPtr( cs->hWndParent );
wndPtr->owner = NULL;
}
else {
wndPtr->owner = NULL;
wndPtr->parent = NULL;
}
/*
else
{
wndPtr->parent = pWndDesktop;
@ -72,7 +78,7 @@ HANDLE WIN_CreateWindowEx( CREATESTRUCTW *cs, ATOM classAtom)
else
wndPtr->owner = WIN_GetTopParentPtr(WIN_FindWndPtr(cs->hWndParent));
}
*/
wndPtr->winproc = classPtr->winproc;
wndPtr->dwMagic = WND_MAGIC;
@ -134,14 +140,8 @@ HANDLE WIN_CreateWindowEx( CREATESTRUCTW *cs, ATOM classAtom)
/* Get class or window DC if needed */
if (classPtr->style & CS_OWNDC) wndPtr->dce = DCE_AllocDCE(hWnd,DCE_WINDOW_DC);
else if (classPtr->style & CS_CLASSDC) wndPtr->dce = classPtr->dce;
else wndPtr->dce = DCE_AllocDCE(hWnd,DCE_WINDOW_DC);;
GetStartupInfoW((STARTUPINFO *)&StartupInfo);
if (cs->x == CW_USEDEFAULT)
{
@ -168,25 +168,31 @@ HANDLE WIN_CreateWindowEx( CREATESTRUCTW *cs, ATOM classAtom)
}
else
{
cs->cx = 600; /* FIXME */
cs->cy = 400;
cs->cx = SYSMETRICS_CXSCREEN;
cs->cy = SYSMETRICS_CYSCREEN;
}
}
/* Send the WM_GETMINMAXINFO message and fix the size if needed */
/* Send the WM_GETMINMAXINFO message and fix the size if needed and appropriate */
if ( !(cs->style & (WS_POPUP | WS_CHILD) )) {
if ((cs->style & WS_THICKFRAME) )
{
WINPOS_GetMinMaxInfo( wndPtr, &maxSize, &maxPos, &minTrack, &maxTrack);
if (maxSize.x < cs->cx) cs->cx = maxSize.x;
if (maxSize.y < cs->cy) cs->cy = maxSize.y;
if (cs->cx < minTrack.x ) cs->cx = minTrack.x;
if (cs->cy < minTrack.y ) cs->cy = minTrack.y;
}
if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
{
WINPOS_GetMinMaxInfo( wndPtr, &maxSize, &maxPos, &minTrack, &maxTrack);
if (maxSize.x < cs->cx) cs->cx = maxSize.x;
if (maxSize.y < cs->cy) cs->cy = maxSize.y;
if (cs->cx < minTrack.x ) cs->cx = minTrack.x;
if (cs->cy < minTrack.y ) cs->cy = minTrack.y;
}
if(cs->style & WS_CHILD)
{
if(cs->cx < 0) cs->cx = 0;
@ -203,8 +209,26 @@ HANDLE WIN_CreateWindowEx( CREATESTRUCTW *cs, ATOM classAtom)
wndPtr->rectWindow.right = cs->x + cs->cx;
wndPtr->rectWindow.bottom = cs->y + cs->cy;
wndPtr->rectClient= wndPtr->rectWindow;
wndPtr->rectClient = wndPtr->rectWindow;
printf(":%d %d %d %d\n", wndPtr->rectWindow.left, wndPtr->rectWindow.top,
wndPtr->rectWindow.right, wndPtr->rectWindow.bottom);
/* Get class or window DC if needed */
if (classPtr->style & CS_OWNDC)
wndPtr->dce = DCE_AllocDCE(wndPtr,DCE_WINDOW_DC);
else if (classPtr->style & CS_CLASSDC)
wndPtr->dce = classPtr->dce;
else if ( classPtr->style & CS_PARENTDC)
wndPtr->dce = wndPtr->parent->dce;
else wndPtr->dce = DCE_AllocDCE(wndPtr,DCE_WINDOW_DC);;
//wndPtr->rectClient.top = wndPtr->rectClient.left = 0;
//wndPtr->rectClient.right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
//wndPtr->rectClient.bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
/* Set the window menu */
@ -307,7 +331,6 @@ HANDLE WIN_CreateWindowEx( CREATESTRUCTW *cs, ATOM classAtom)
if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner)
HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWCREATED, (INT)hWnd, 0L, classPtr->bUnicode);
return hWnd;
@ -928,6 +951,19 @@ WINBOOL STDCALL WIN_IsDialogMessage( HWND hwndDlg, LPMSG msg )
}
WINBOOL WIN_GetClientRect(WND *wndPtr, LPRECT lpRect )
{
if ( lpRect == NULL )
return FALSE;
lpRect->left = lpRect->top = lpRect->right = lpRect->bottom = 0;
if (wndPtr)
{
lpRect->right = wndPtr->rectClient.right - wndPtr->rectClient.left;
lpRect->bottom = wndPtr->rectClient.bottom - wndPtr->rectClient.top;
}
return TRUE;
}
/*******************************************************************
* GetSysModalWindow16 (USER.52)

View file

@ -4,7 +4,7 @@ INTERNAL_OBJECTS = internal/property.o internal/menu.o internal/heapdup.o intern
internal/win.o internal/dce.o internal/msg.o internal/queue.o\
internal/signal.o internal/event.o internal/timer.o internal/region.o\
internal/text.o internal/defwnd.o internal/paint.o internal/uitools.o\
internal/dialog.o
internal/dialog.o internal/winpos.o
MISC_OBJECTS = misc/sprintf.o misc/dllmain.o misc/string.o misc/sysmetr.o\
misc/main.o misc/bitmap.o misc/cursor.o misc/vk.o

View file

@ -1,4 +1,4 @@
# $Id: makefile_rex,v 1.7 1999/08/29 13:44:58 dwelch Exp $
# $Id: makefile_rex,v 1.8 1999/12/01 22:30:45 ariadne Exp $
#
# ReactOS Operating System
#
@ -23,11 +23,11 @@ endif
all: $(DLLTARGET)
MISC_OBJECTS = misc/sprintf.o misc/exitwin.o misc/dllmain.o #misc/string.o
MISC_OBJECTS = misc/sprintf.o misc/exitwin.o misc/dllmain.o misc/string.o misc/sysmetr.o
#RESOURCE_OBJECT = $(TARGET).coff
WINDOWS_OBJECTS = windows/message.o windows/wndproc.o windows/win.o windows/hook.o windows/spy.o\
WINDOWS_OBJECTS = windows/msg.o windows/wndproc.o windows/win.o windows/hook.o windows/spy.o\
#windows/queue.o
OBJECTS = $(MISC_OBJECTS) $(WINDOWS_OBJECTS)

View file

@ -2,12 +2,18 @@
HBITMAP BITMAP_LoadBitmapW(HINSTANCE instance,LPCWSTR name, UINT loadflags);
HBITMAP LoadBitmapW(HINSTANCE hInstance, LPCWSTR lpBitmapName)
HBITMAP
STDCALL
LoadBitmapW(HINSTANCE hInstance, LPCWSTR lpBitmapName)
{
return BITMAP_LoadBitmapW(hInstance, lpBitmapName, 0);
}
HBITMAP LoadBitmapA(HINSTANCE hInstance, LPCSTR lpBitmapName)
HBITMAP
STDCALL
LoadBitmapA(HINSTANCE hInstance, LPCSTR lpBitmapName)
{
return CreateBitmap(GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CXSMICON),

View file

@ -22,8 +22,8 @@ int i;
int main(int argc, char **argv)
{
WIDGETS_Init();
#if 0
HWND hwnd;
HWND User32hWnd;
HMENU hmenu;
@ -37,6 +37,8 @@ int main(int argc, char **argv)
HANDLE hMod, hrsrc;
RECT rect, cl;
WIDGETS_Init();
wc1.hInstance = hInst;
wc1.lpszClassName = szName;
wc1.lpfnWndProc = WindowFunc;
@ -59,24 +61,26 @@ int main(int argc, char **argv)
hwnd = CreateWindowEx
(0, szName, "test2", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
CW_USEDEFAULT,CW_USEDEFAULT,100,100,
NULL,NULL,hInst, NULL);
MessageBox(NULL,"Hallo","Hallo",MB_OK);
ShowWindow(hwnd,nWinMode);
UpdateWindow(hwnd);
#endif
MessageBox(NULL,"xxx","yyyy",MB_OK);
#if 0
MessageBox(hwnd,"xxx","yyyy",MB_OK);
GetWindowRect(hwnd,&rect);
GetClientRect(hwnd,&cl);
printf("%d\n",(rect.left - rect.right) - (cl.left - cl.right));
SetWindowText(hwnd,"Hallo3");
DrawMenuBar(hwnd);
// DrawMenuBar(hwnd);
// SendMessage( hwnd, WM_MOVE, 0,MAKELONG(0,0));
// SendMessage( hwnd, WM_PAINT, GetWindowDC(hwnd),0);
while(GetMessage(&msg,NULL, 0, 0))
@ -86,7 +90,7 @@ int main(int argc, char **argv)
}
Sleep(10000);
return msg.wParam;
#endif
}

View file

@ -5,11 +5,12 @@
* Copyright 1996 Marcus Meissner
*/
#include <ddk/ntddk.h>
#include <windows.h>
#include <string.h>
#include <stdarg.h>
#include <wchar.h>
#include <ddk/ntddk.h>
/* Funny to divide them between user and kernel. */

View file

@ -1,10 +1,56 @@
#include <windows.h>
SHORT GetKeyState( int nVirtKey )
SHORT
STDCALL
GetKeyState( int nVirtKey )
{
return 0;
}
UINT
STDCALL
GetKBCodePage(
VOID)
{
return 0;
}
SHORT
STDCALL
GetAsyncKeyState(
int vKey)
{
return 0;
}
WINBOOL
STDCALL
GetKeyboardState(
PBYTE lpKeyState)
{
return FALSE;
}
WINBOOL
STDCALL
SetKeyboardState(
LPBYTE lpKeyState)
{
return FALSE;
}
int
STDCALL
GetKeyboardType(
int nTypeFlag)
{
return 0;
}
int
STDCALL
ToAscii(

View file

@ -4,7 +4,7 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,13,RES_UINT_FILE_VERSION
FILEVERSION 0,0,13,0
PRODUCTVERSION 0,0,13,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
@ -27,7 +27,7 @@ BEGIN
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
VALUE "OriginalFilename", "user32.dll\0"
VALUE "ProductName", RES_STR_PRODUCT_NAME
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
@ -47,12 +47,12 @@ STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION |
FONT 8, "MS Sans Serif"
BEGIN
ICON "", 1088, 9, 20, 16, 16, WS_CHILD | WS_VISIBLE
LTEXT "", 100, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP
LTEXT "", 100, 48, 16, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP
PUSHBUTTON "&OK", 1, 16, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&Cancel", 2, 64, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&Abort", 3, 112, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&Retry", 4, 160, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&Ignore", 5, 208, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&Yes", 6, 256, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&Yes", 6, 206, 26, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&No", 7, 304, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END

View file

@ -217,7 +217,7 @@ ATOM STDCALL RegisterClassExW( const WNDCLASSEX* wc )
return atom;
}
WINBOOL UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance )
WINBOOL STDCALL UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance )
{
CLASS *classPtr;
classPtr = CLASS_FindClassByAtom( STRING2ATOMA(lpClassName), hInstance );
@ -233,7 +233,7 @@ WINBOOL UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance )
WINBOOL UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance )
WINBOOL STDCALL UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance )
{
CLASS *classPtr;
classPtr = CLASS_FindClassByAtom( STRING2ATOMW(lpClassName), hInstance );
@ -247,14 +247,35 @@ WINBOOL UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance )
}
WINBOOL GetClassInfoA( HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASS lpWndClass )
WINBOOL STDCALL GetClassInfoA( HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASS lpWndClass )
{
return FALSE;
CLASS *classPtr;
ATOM a;
if ( HIWORD(lpClassName) != 0 )
a = FindAtomA(lpClassName);
else
a = lpClassName;
classPtr = CLASS_FindClassByAtom( a, hInstance );
if ( classPtr == NULL )
return FALSE;
lpWndClass->style = classPtr->style;
lpWndClass->lpfnWndProc = classPtr->winproc;
lpWndClass->cbClsExtra = classPtr->cbWndExtra;
lpWndClass->cbClsExtra = classPtr->cbClsExtra;
lpWndClass->hInstance = classPtr->hInstance;
lpWndClass->hIcon = classPtr->hIcon;
lpWndClass->hCursor = classPtr->hCursor;
lpWndClass->hbrBackground = classPtr->hbrBackground;
return TRUE;
}
WINBOOL GetClassInfoW( HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASS lpWndClass )
WINBOOL STDCALL GetClassInfoW( HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASS lpWndClass )
{
CLASS *classPtr;
ATOM a;
@ -281,13 +302,40 @@ WINBOOL GetClassInfoW( HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASS l
}
WINBOOL GetClassInfoExA( HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSEX lpWndClass )
WINBOOL STDCALL GetClassInfoExA( HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSEX lpWndClassEx )
{
return FALSE;
CLASS *classPtr;
ATOM a;
if ( HIWORD(lpClassName) != 0 )
a = FindAtomA(lpClassName);
else
a = (ATOM)lpClassName;
classPtr = CLASS_FindClassByAtom( a, hInstance );
if ( classPtr == NULL )
return FALSE;
if ( lpWndClassEx ->cbSize != sizeof(WNDCLASSEX) )
return FALSE;
lpWndClassEx->style = classPtr->style;
lpWndClassEx->lpfnWndProc = classPtr->winproc;
lpWndClassEx->cbClsExtra = classPtr->cbWndExtra;
lpWndClassEx->cbClsExtra = classPtr->cbClsExtra;
lpWndClassEx->hInstance = classPtr->hInstance;
lpWndClassEx->hIcon = classPtr->hIcon;
lpWndClassEx->hCursor = classPtr->hCursor;
lpWndClassEx->hbrBackground = classPtr->hbrBackground;
return TRUE;
}
WINBOOL GetClassInfoExW( HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSEX lpWndClassEx )
WINBOOL STDCALL GetClassInfoExW( HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSEX lpWndClassEx )
{
CLASS *classPtr;
@ -320,7 +368,7 @@ WINBOOL GetClassInfoExW( HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSE
return TRUE;
}
int GetClassNameA(HWND hWnd, LPSTR lpClassName, int nMaxCount )
int STDCALL GetClassNameA(HWND hWnd, LPSTR lpClassName, int nMaxCount )
{
WND *wndPtr = WIN_FindWndPtr(hWnd);
@ -334,7 +382,7 @@ int GetClassNameA(HWND hWnd, LPSTR lpClassName, int nMaxCount )
}
int GetClassNameW(HWND hWnd, LPWSTR lpClassName, int nMaxCount )
int STDCALL GetClassNameW(HWND hWnd, LPWSTR lpClassName, int nMaxCount )
{
WND *wndPtr = WIN_FindWndPtr(hWnd);
@ -349,7 +397,7 @@ int GetClassNameW(HWND hWnd, LPWSTR lpClassName, int nMaxCount )
}
DWORD GetClassLongA(HWND hWnd, int nIndex )
DWORD STDCALL GetClassLongA(HWND hWnd, int nIndex )
{
WND * wndPtr;
@ -380,7 +428,7 @@ DWORD GetClassLongA(HWND hWnd, int nIndex )
return 0;
}
DWORD GetClassLongW(HWND hWnd, int nIndex )
DWORD STDCALL GetClassLongW(HWND hWnd, int nIndex )
{
WND * wndPtr;

View file

@ -32,9 +32,6 @@
extern DCE *firstDCE;
INT SelectVisRgn(HDC hdc,HRGN hrgn);
INT ExcludeVisRect(HDC hDC,INT nLeftRect,INT nTopRect,INT nRightRect,INT nBottomRect);
INT RestoreVisRgn(HDC hdc);
HDC STDCALL GetDC( HWND hWnd )
@ -56,7 +53,7 @@ HDC STDCALL GetDC( HWND hWnd )
*/
HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
HDC STDCALL GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
{
HRGN hrgnVisible = 0;
HDC hdc = 0;
@ -74,40 +71,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
/* fixup flags */
#if 0
if (!(wndPtr->class->style & (CS_OWNDC | CS_CLASSDC)))
flags |= DCX_CACHE;
if (flags & DCX_USESTYLE)
{
flags &= ~( DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
if( wndPtr->dwStyle & WS_CLIPSIBLINGS )
flags |= DCX_CLIPSIBLINGS;
if ( !(flags & DCX_WINDOW) )
{
if (wndPtr->class->style & CS_PARENTDC) flags |= DCX_PARENTCLIP;
if (wndPtr->dwStyle & WS_CLIPCHILDREN &&
!(wndPtr->dwStyle & WS_MINIMIZE) ) flags |= DCX_CLIPCHILDREN;
}
else flags |= DCX_CACHE;
}
if( flags & DCX_NOCLIPCHILDREN )
{
flags |= DCX_CACHE;
flags &= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
}
if (flags & DCX_WINDOW)
flags = (flags & ~DCX_CLIPCHILDREN) | DCX_CACHE;
#endif
if (!(wndPtr->dwStyle & WS_CHILD) || !wndPtr->parent )
flags &= ~DCX_PARENTCLIP;
@ -128,88 +92,18 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
dcxFlags = flags & (DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
DCX_CACHE | DCX_WINDOW);
#if 0
if (flags & DCX_CACHE)
{
DCE* dceEmpty;
DCE* dceUnused;
dceEmpty = dceUnused = NULL;
/* Strategy: First, we attempt to find a non-empty but unused DCE with
* compatible flags. Next, we look for an empty entry. If the cache is
* full we have to purge one of the unused entries.
*/
for (dce = firstDCE; (dce); dce = dce->next)
{
if ((dce->DCXflags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE )
{
dceUnused = dce;
if (dce->DCXflags & DCX_DCEEMPTY)
dceEmpty = dce;
else
if ((dce->hwndCurrent == hwnd)
&& ((dce->DCXflags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
DCX_CACHE | DCX_WINDOW | DCX_PARENTCLIP)) == dcxFlags))
{
DPRINT("\tfound valid %08x dce [%04x], flags %08x\n",
(unsigned)dce, hwnd, (unsigned)dcxFlags );
bUpdateVisRgn = FALSE;
bUpdateClipOrigin = TRUE;
break;
}
}
}
if (!dce) dce = (dceEmpty) ? dceEmpty : dceUnused;
}
else
{
if (wndPtr->class->style & CS_OWNDC)
dce = wndPtr->dce;
else if ( wndPtr->class->style & CS_CLASSDC)
dce = wndPtr->class->dce;
else
return 0;
if( dce->hwndCurrent == hwnd )
{
DPRINT("\tskipping hVisRgn update\n");
bUpdateVisRgn = FALSE; /* updated automatically, via DCHook() */
if( (dce->DCXflags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) &&
(flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) )
{
/* This is likely to be a nested BeginPaint(). */
if( dce->hClipRgn != hrgnClip )
{
DPRINT("fixme new hrgnClip[%04x] smashes the previous[%04x]\n",
hrgnClip, dce->hClipRgn );
DCE_DeleteClipRgn( dce );
}
else
RestoreVisRgn(dce->hDC);
}
}
}
if (!dce) return 0;
#endif
dce = wndPtr->dce;
dce->hwndCurrent = hwnd;
dce->hClipRgn = 0;
dce->DCXflags = dcxFlags | (flags & DCX_WINDOWPAINT) | DCX_DCEBUSY;
hdc = dce->hDC;
//if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
//bUpdateVisRgn = bUpdateVisRgn || (dc->w.flags & DC_DIRTY);
/* recompute visible region */
//wndPtr->pDriver->pSetDrawable( wndPtr, dc, flags, bUpdateClipOrigin );
if( bUpdateVisRgn )
{
DPRINT("updating visrgn for %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd);
@ -241,7 +135,6 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
if ((hwnd == GetDesktopWindow())) {
hrgnVisible = CreateRectRgn( 0, 0, SYSMETRICS_CXSCREEN,
SYSMETRICS_CYSCREEN );
// (rootWindow == DefaultRootWindow(display))
}
else
{
@ -251,7 +144,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
//dc->w.flags &= ~DC_DIRTY;
dce->DCXflags &= ~DCX_DCEDIRTY;
SelectVisRgn( hdc, hrgnVisible );
SelectClipRgn( hdc, hrgnVisible );
}
else
DPRINT("no visrgn update %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd);
@ -260,19 +153,19 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
if( flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN) )
{
if( !hrgnVisible ) hrgnVisible = CreateRectRgn( 0, 0, 0, 0 );
if( !hrgnVisible )
hrgnVisible = CreateRectRgn( 0, 0, 0, 0 );
dce->DCXflags |= flags & (DCX_KEEPCLIPRGN | DCX_INTERSECTRGN | DCX_EXCLUDERGN);
dce->hClipRgn = hrgnClip;
DPRINT( "\tsaved VisRgn, clipRgn = %04x\n", hrgnClip);
SaveVisRgn( hdc );
CombineRgn( hrgnVisible, hrgnClip, 0, RGN_COPY );
DCE_OffsetVisRgn( hdc, hrgnVisible );
CombineRgn( hrgnVisible, InquireVisRgn( hdc ), hrgnVisible,
(flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
SelectVisRgn( hdc, hrgnVisible );
SelectClipRgn( hdc, hrgnVisible );
}
if( hrgnVisible ) DeleteObject( hrgnVisible );
@ -287,7 +180,7 @@ int STDCALL ReleaseDC(HWND hWnd,HDC hDC )
return 0;
}
HDC GetWindowDC(HWND hWnd )
HDC STDCALL GetWindowDC(HWND hWnd )
{
if (!hWnd) hWnd = GetDesktopWindow();
return GetDCEx( hWnd, 0, DCX_USESTYLE | DCX_WINDOW );

View file

@ -9,6 +9,7 @@
#include <user32/widgets.h>
#include <user32/dialog.h>
#include <user32/win.h>
#include <user32/paint.h>

View file

@ -19,7 +19,7 @@ HANDLE HOOK_systemHooks[WH_NB_HOOKS] = { NULL, };
*
* FIXME: I don't know if this is correct
*/
HHOOK SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId )
HHOOK STDCALL SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId )
{
return HOOK_SetHook( idHook, lpfn, HOOK_WINA, hMod, dwThreadId );
@ -31,9 +31,9 @@ HHOOK SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwT
*
* FIXME: I don't know if this is correct
*/
HHOOK SetWindowsHookExW(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId )
HHOOK STDCALL SetWindowsHookExW(int idHook, HOOKPROC lpfn, HINSTANCE hMod, DWORD dwThreadId )
{
return HOOK_SetHook( idHook, lpfn, HOOK_WIN32W, hMod, dwThreadId );
return HOOK_SetHook( idHook, lpfn, HOOK_WINW, hMod, dwThreadId );
}
@ -224,7 +224,7 @@ HANDLE HOOK_SetHook( INT id, LPVOID proc, INT type,
WINBOOL HOOK_RemoveHook( HANDLE hook )
{
HOOKDATA *data;
HANDLE *prevHook;
HANDLE *prevHook = NULL;

View file

@ -1,138 +0,0 @@
#include <windows.h>
#include <user32/message.h>
#include <user32/winproc.h>
#include <user32/win.h>
#include <user32/spy.h>
#include <user32/hook.h>
/***********************************************************************
* SendMessage Send Window Message
*
* Sends a message to the window procedure of the specified window.
* SendMessage() will not return until the called window procedure
* either returns or calls ReplyMessage().
*
* Use PostMessage() to send message and return immediately. A window
* procedure may use InSendMessage() to detect
* SendMessage()-originated messages.
*
* Applications which communicate via HWND_BROADCAST may use
* RegisterWindowMessage() to obtain a unique message to avoid conflicts
* with other applications.
*
* CONFORMANCE
*
* ECMA-234, Win
*/
#if 0
LRESULT STDCALL SendMessageA( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam )
{
return MSG_SendMessage( hwnd, msg, wParam, lParam, FALSE );
}
LRESULT STDCALL SendMessageW( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam )
{
return MSG_SendMessage( hwnd, msg, wParam, lParam, TRUE );
}
#endif
/***********************************************************************
* MSG_SendMessage
*
* Implementation of an inter-task SendMessage.
*/
LRESULT MSG_SendMessage( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, WINBOOL bUnicode )
{
WND * wndPtr;
LRESULT ret;
MSG msg;
// SPY_EnterMessage( SPY_SENDMESSAGE, hwnd, msg, wParam, lParam );
#if 0
WND **list, **ppWnd;
if (hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST)
{
if (!(list = WIN_BuildWinArray( WIN_GetDesktop(), 0, NULL )))
return TRUE;
for (ppWnd = list; *ppWnd; ppWnd++)
{
wndPtr = *ppWnd;
if (!WIN_IsWindow(wndPtr->hwndSelf))
continue;
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION)
MSG_SendMessage( wndPtr->hwndSelf, message, wParam, lParam, bUnicode );
}
WIN_DestroyList( list );
return TRUE;
}
#endif
if (HOOK_IsHooked( WH_CALLWNDPROC ))
MSG_CallWndProcHook( (LPMSG)&hwnd, FALSE);
if (!(wndPtr = WIN_FindWndPtr( hwnd )))
{
return 0;
}
msg.hwnd = hwnd;
msg.message = message;
msg.wParam = wParam;
msg.lParam = lParam;
msg.time = 0;
msg.pt.x = 0;
msg.pt.y = 0;
// SPY_ExitMessage( SPY_RESULT_OK, hwnd, msg, ret );
return ret;
}
/************************************************************************
* MSG_CallWndProcHook
*/
void MSG_CallWndProcHook( LPMSG pmsg, WINBOOL bUnicode )
{
CWPSTRUCT cwp;
cwp.lParam = pmsg->lParam;
cwp.wParam = pmsg->wParam;
cwp.message = pmsg->message;
cwp.hwnd = pmsg->hwnd;
if (bUnicode)
HOOK_CallHooksW(WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp);
else
HOOK_CallHooksA( WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp );
pmsg->lParam = cwp.lParam;
pmsg->wParam = cwp.wParam;
pmsg->message = cwp.message;
pmsg->hwnd = cwp.hwnd;
}
/***********************************************************************
* MSG_InternalGetMessage
*
* GetMessage() function for internal use. Behave like GetMessage(),
* but also call message filters and optionally send WM_ENTERIDLE messages.
* 'hwnd' must be the handle of the dialog or menu window.
* 'code' is the message filter value (MSGF_??? codes).
*/
WINBOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, HWND hwndOwner,
WPARAM code, WORD flags, WINBOOL sendIdle )
{
}

View file

@ -109,14 +109,20 @@ WINBOOL STDCALL ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
const RECT *prLClip, HRGN hrgnUpdate,
LPRECT rcUpdate )
{
#if 0
RECT rClip;
POINT src, dest;
INT ldx, ldy;
SIZE vportExt;
SIZE wndExt;
POINT DCOrg;
if (!hdc ) return FALSE;
GetViewportExtEx( hdc,&vportExt);
GetWindowExtEx(hdc, &wndExt);
GetDCOrgEx(hdc,&DCOrg);
/* compute device clipping region */
@ -133,15 +139,16 @@ WINBOOL STDCALL ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
return FALSE;
}
SaveVisRgn( hdc );
IntersectVisRect( hdc, rClip.left, rClip.top,
rClip.right, rClip.bottom );
/// IntersectVisRect( hdc, rClip.left, rClip.top,
// rClip.right, rClip.bottom );
/* translate coordinates */
ldx = dx * dc->wndExtX / dc->vportExtX;
ldy = dy * dc->wndExtY / dc->vportExtY;
ldx = dx * wndExt.cx / vportExt.cx;
ldy = dy * wndExt.cy / vportExt.cy;
if (dx > 0)
dest.x = (src.x = rClip.left) + ldx;
@ -170,32 +177,33 @@ WINBOOL STDCALL ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
/* restore clipping region */
RestoreVisRgn( hdc );
SelectClipRgn( hdc,NULL );
/* compute update areas */
if ( (hrgnUpdate || rcUpdate) && dc->w.hVisRgn )
//&& dc->w.hVisRgn
if ( (hrgnUpdate || rcUpdate) )
{
HRGN hrgn = (hrgnUpdate) ? hrgnUpdate : CreateRectRgn( 0,0,0,0 );
HRGN hrgnClip;
LPtoDP( hdc, (LPPOINT)&rClip, 2 );
OffsetRect( &rClip, dc->w.DCOrgX, dc->w.DCOrgY );
//LPtoDP( hdc, (LPPOINT)&rClip, 2 );
OffsetRect( &rClip, DCOrg.x, DCOrg.y );
hrgnClip = CreateRectRgnIndirect( &rClip );
CombineRgn( hrgn, dc->w.hVisRgn, hrgnClip, RGN_AND );
//CombineRgn( hrgn, dc->w.hVisRgn, hrgnClip, RGN_AND );
OffsetRgn( hrgn, dx, dy );
CombineRgn( hrgn, dc->w.hVisRgn, hrgn, RGN_DIFF );
//CombineRgn( hrgn, dc->w.hVisRgn, hrgn, RGN_DIFF );
CombineRgn( hrgn, hrgn, hrgnClip, RGN_AND );
OffsetRgn( hrgn, -dc->w.DCOrgX, -dc->w.DCOrgY );
OffsetRgn( hrgn, -DCOrg.x, -DCOrg.y );
if( rcUpdate ) GetRgnBox( hrgnUpdate, rcUpdate );
if (!hrgnUpdate) DeleteObject( hrgn );
DeleteObject( hrgnClip );
}
#endif
return TRUE;
}

View file

@ -1,6 +1,6 @@
#include <windows.h>
UINT SetTimer( HWND hWnd,UINT nIDEvent,
UINT STDCALL SetTimer( HWND hWnd,UINT nIDEvent,
UINT uElapse, TIMERPROC lpTimerFunc
)
{

View file

@ -527,7 +527,7 @@ WINBOOL STDCALL IsChild( HWND parent, HWND child )
return FALSE;
}
WINBOOL IsWindow(HANDLE hWnd)
WINBOOL STDCALL IsWindow(HANDLE hWnd)
{
if (WIN_FindWndPtr( hWnd ) == NULL) return FALSE;
return TRUE;
@ -552,7 +552,6 @@ WINBOOL STDCALL IsWindowEnabled(HWND hWnd)
WINBOOL STDCALL IsWindowUnicode( HWND hWnd )
{
WND * wndPtr;
// What if handle is invalid ??
if (!(wndPtr = WIN_FindWndPtr(hWnd)))
return FALSE;
@ -572,122 +571,7 @@ WINBOOL STDCALL IsWindowVisible( HWND hwnd )
}
/***********************************************************************
* ShowWindow (USER32.534)
*/
WINBOOL STDCALL ShowWindow( HWND hwnd, INT cmd )
{
WND* wndPtr = WIN_FindWndPtr( hwnd );
WINBOOL wasVisible = FALSE, showFlag;
RECT newPos = {0, 0, 0, 0};
int swp = 0;
if (!wndPtr) return FALSE;
// DPRINT("hwnd=%04x, cmd=%d\n", hwnd, cmd);
#ifdef OPTIMIZATION
wasVisible = (wndPtr->dwStyle & WS_VISIBLE) != 0;
#endif
switch(cmd)
{
case SW_HIDE:
if (!wasVisible) return FALSE;
swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER;
break;
case SW_SHOWMINNOACTIVE:
swp |= SWP_NOACTIVATE | SWP_NOZORDER;
/* fall through */
case SW_SHOWMINIMIZED:
swp |= SWP_SHOWWINDOW;
/* fall through */
case SW_MINIMIZE:
swp |= SWP_FRAMECHANGED;
if( !(wndPtr->dwStyle & WS_MINIMIZE) )
swp |= WINPOS_MinMaximize( wndPtr, SW_MINIMIZE, &newPos );
else swp |= SWP_NOSIZE | SWP_NOMOVE;
break;
case SW_SHOWMAXIMIZED: /* same as SW_MAXIMIZE */
swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
if( !(wndPtr->dwStyle & WS_MAXIMIZE) )
swp |= WINPOS_MinMaximize( wndPtr, SW_MAXIMIZE, &newPos );
else swp |= SWP_NOSIZE | SWP_NOMOVE;
break;
case SW_SHOWNA:
swp |= SWP_NOACTIVATE | SWP_NOZORDER;
/* fall through */
case SW_SHOW:
swp |= SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE;
break;
case SW_SHOWNOACTIVATE:
swp |= SWP_NOZORDER;
if (GetActiveWindow()) swp |= SWP_NOACTIVATE;
/* fall through */
case SW_SHOWNORMAL: /* same as SW_NORMAL: */
case SW_SHOWDEFAULT: /* FIXME: should have its own handler */
case SW_RESTORE:
swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
if( wndPtr->dwStyle & (WS_MINIMIZE | WS_MAXIMIZE) )
swp |= WINPOS_MinMaximize( wndPtr, SW_RESTORE, &newPos );
else swp |= SWP_NOSIZE | SWP_NOMOVE;
break;
}
showFlag = (cmd != SW_HIDE);
if (showFlag != wasVisible)
{
SendMessageW( hwnd, WM_SHOWWINDOW, showFlag, 0 );
if (!IsWindow( hwnd )) return wasVisible;
}
if ((wndPtr->dwStyle & WS_CHILD) &&
!IsWindowVisible( wndPtr->parent->hwndSelf ) &&
(swp & (SWP_NOSIZE | SWP_NOMOVE)) == (SWP_NOSIZE | SWP_NOMOVE) )
{
/* Don't call SetWindowPos() on invisible child windows */
if (cmd == SW_HIDE) wndPtr->dwStyle &= ~WS_VISIBLE;
else wndPtr->dwStyle |= WS_VISIBLE;
}
else
{
/* We can't activate a child window */
if (wndPtr->dwStyle & WS_CHILD) swp |= SWP_NOACTIVATE | SWP_NOZORDER;
SetWindowPos( hwnd, HWND_TOP,
newPos.left, newPos.top, newPos.right, newPos.bottom, swp );
if (!IsWindow( hwnd )) return wasVisible;
else if( wndPtr->dwStyle & WS_MINIMIZE ) WINPOS_ShowIconTitle( wndPtr, TRUE );
}
if (wndPtr->flags & WIN_NEED_SIZE)
{
/* should happen only in CreateWindowEx() */
int wParam = SIZE_RESTORED;
wndPtr->flags &= ~WIN_NEED_SIZE;
if (wndPtr->dwStyle & WS_MAXIMIZE) wParam = SIZE_MAXIMIZED;
else if (wndPtr->dwStyle & WS_MINIMIZE) wParam = SIZE_MINIMIZED;
SendMessageW( hwnd, WM_SIZE, wParam,
MAKELONG(wndPtr->rectClient.right-wndPtr->rectClient.left,
wndPtr->rectClient.bottom-wndPtr->rectClient.top));
SendMessageW( hwnd, WM_MOVE, 0,
MAKELONG(wndPtr->rectClient.left, wndPtr->rectClient.top) );
}
// SendMessage(hwnd, WM_NCACTIVATE,TRUE,0);
// SendMessage(hwnd, WM_NCPAINT,CreateRectRgn(100,100,100, 100) ,0);
return wasVisible;
}
/*******************************************************************

File diff suppressed because it is too large Load diff