Added some user32 functions.

svn path=/trunk/; revision=534
This commit is contained in:
Boudewijn Dekker 1999-06-05 19:02:54 +00:00
parent 9083091f7b
commit f298282475
14 changed files with 883 additions and 5 deletions

View file

@ -0,0 +1,48 @@
/*
* Window classes definitions
*
* Copyright 1993 Alexandre Julliard
*/
#ifndef __WINE_CLASS_H
#define __WINE_CLASS_H
#include <user32/winproc.h>
struct tagDCE;
#define MAX_CLASSNAME 255
#define CLASS_MAGIC ('C' | ('L' << 8) | ('A' << 16) | ('S' << 24))
typedef struct tagCLASS
{
struct tagCLASS *next; /* Next class */
UINT magic; /* Magic number */
UINT cWindows; /* Count of existing windows */
UINT style; /* Class style */
WNDPROC winproc; /* Window procedure */
INT cbClsExtra; /* Class extra bytes */
INT cbWndExtra; /* Window extra bytes */
char menuNameA[MAX_CLASSNAME];
WCHAR menuNameW[MAX_CLASSNAME]; /* Default menu name (Unicode) */
struct tagDCE *dce; /* Class DCE (if CS_CLASSDC) */
HINSTANCE hInstance; /* Module that created the task */
HICON hIcon; /* Default icon */
HICON hIconSm; /* Default small icon */
HCURSOR hCursor; /* Default cursor */
HBRUSH hbrBackground; /* Default background */
ATOM atomName; /* Name of the class */
char classNameA[MAX_CLASSNAME]; /* Class name (ASCII string) */
WCHAR classNameW[MAX_CLASSNAME]; /* Class name (Unicode) */
LONG wExtra[1]; /* Class extra bytes */
} CLASS;
void CLASS_DumpClass( CLASS *class );
void CLASS_WalkClasses(void);
void CLASS_FreeModuleClasses( HMODULE hModule );
CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance );
#endif /* __WINE_CLASS_H */

View file

@ -0,0 +1,32 @@
/*
* Windows hook definitions
*
* Copyright 1994 Alexandre Julliard
*/
#ifndef __WINE_HOOK_H
#define __WINE_HOOK_H
#include <windows.h>
#define HOOK_WIN32A 0x01
#define HOOK_WIN32W 0x02
#define HOOK_INUSE 0x80
/* hook type mask */
#define HOOK_MAPTYPE (HOOK_WIN32A | HOOK_WIN32W)
HOOKPROC HOOK_GetProc( HHOOK hhook );
WINBOOL HOOK_IsHooked( INT id );
LRESULT HOOK_CallHooksA( INT id, INT code, WPARAM wParam,
LPARAM lParam );
LRESULT HOOK_CallHooksW( INT id, INT code, WPARAM wParam,
LPARAM lParam );
void HOOK_FreeModuleHooks( HMODULE hModule );
void HOOK_FreeQueueHooks( HQUEUE hQueue );
void HOOK_ResetQueueHooks( HQUEUE hQueue );
HOOKPROC HOOK_GetProc( HHOOK hook );
#endif /* __WINE_HOOK_H */

View file

@ -0,0 +1,47 @@
/*
* Message definitions
*
* Copyright 1993 Alexandre Julliard
*/
#ifndef __WINE_MESSAGE_H
#define __WINE_MESSAGE_H
#include <user32/win.h>
#include <user32/queue.h>
#define MAX_QUEUE_SIZE 256
extern WINBOOL MouseButtonsStates[3];
extern WINBOOL AsyncMouseButtonsStates[3];
extern BYTE InputKeyStateTable[256];
extern BYTE QueueKeyStateTable[256];
extern BYTE AsyncKeyStateTable[256];
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
#define WM_NCMOUSELAST WM_NCMBUTTONDBLCLK
typedef enum { SYSQ_MSG_ABANDON, SYSQ_MSG_SKIP,
SYSQ_MSG_ACCEPT, SYSQ_MSG_CONTINUE } SYSQ_STATUS;
extern MESSAGEQUEUE *pCursorQueue; /* queue.c */
extern MESSAGEQUEUE *pActiveQueue;
/* message.c */
WINBOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd,
HWND hwndOwner, WPARAM code,
WORD flags, WINBOOL sendIdle );
WINBOOL MSG_PeekMessage( LPMSG msg, HWND hwnd, WORD first, WORD last,
WORD flags, WINBOOL peek );
void MSG_CallWndProcHook( LPMSG pmsg, WINBOOL bUnicode );
LRESULT MSG_SendMessage( HQUEUE hDestQueue, HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam, WORD flags );
void joySendMessages(void);
#endif /* __WINE_MESSAGE_H */

View file

@ -0,0 +1,123 @@
/*
* Message queues definitions
*
* Copyright 1993 Alexandre Julliard
*/
#ifndef __WINE_QUEUE_H
#define __WINE_QUEUE_H
//#include "wine/winuser16.h"
#include <windows.h>
/***** Window hooks *****/
#define WH_MIN (-1)
#define WH_MAX 12
#define WH_MINHOOK WH_MIN
#define WH_MAXHOOK WH_MAX
#define WH_NB_HOOKS (WH_MAXHOOK-WH_MINHOOK+1)
#define HQUEUE HANDLE
/* Message as stored in the queue (contains the extraInfo field) */
typedef struct tagQMSG
{
DWORD extraInfo; /* Only in 3.1 */
MSG msg;
} QMSG;
typedef struct
{
LRESULT lResult;
WINBOOL bPending;
} QSMCTRL;
#pragma pack(1)
typedef struct tagMESSAGEQUEUE
{
HQUEUE next; /* 00 Next queue */
HANDLE hTask; /* 02 hTask owning the queue */
WORD msgSize; /* 04 Size of messages in the queue */
WORD msgCount; /* 06 Number of waiting messages */
WORD nextMessage; /* 08 Next message to be retrieved */
WORD nextFreeMessage; /* 0a Next available slot in the queue */
WORD queueSize; /* 0c Size of the queue */
DWORD GetMessageTimeVal; /* 0e Value for GetMessageTime */
DWORD GetMessagePosVal; /* 12 Value for GetMessagePos */
HQUEUE self; /* 16 Handle to self (was: reserved) */
DWORD GetMessageExtraInfoVal; /* 18 Value for GetMessageExtraInfo */
WORD wParamHigh; /* 1c High word of wParam (was: reserved)*/
LPARAM lParam; /* 1e Next 4 values set by SendMessage */
WPARAM wParam; /* 22 */
UINT msg; /* 24 */
HWND hWnd; /* 26 */
DWORD SendMessageReturn; /* 28 Return value for SendMessage */
WORD wPostQMsg; /* 2c PostQuitMessage flag */
WORD wExitCode; /* 2e PostQuitMessage exit code */
WORD flags; /* 30 Queue flags */
QSMCTRL* smResultInit; /* 32 1st LRESULT ptr - was: reserved */
WORD wWinVersion; /* 36 Expected Windows version */
HQUEUE InSendMessageHandle; /* 38 Queue of task that sent a message */
HANDLE hSendingTask; /* 3a Handle of task that sent a message */
HANDLE hPrevSendingTask; /* 3c Handle of previous sender */
WORD wPaintCount; /* 3e Number of WM_PAINT needed */
WORD wTimerCount; /* 40 Number of timers for this task */
WORD changeBits; /* 42 Changed wake-up bits */
WORD wakeBits; /* 44 Queue wake-up bits */
WORD wakeMask; /* 46 Queue wake-up mask */
QSMCTRL* smResultCurrent; /* 48 ptrs to SendMessage() LRESULT - point to */
WORD SendMsgReturnPtr[1]; /* values on stack */
HANDLE hCurHook; /* 4e Current hook */
HANDLE hooks[WH_NB_HOOKS]; /* 50 Task hooks list */
QSMCTRL* smResult; /* 6c 3rd LRESULT ptr - was: reserved */
QMSG messages[1]; /* 70 Queue messages */
} MESSAGEQUEUE;
#pragma pack(4)
/* Extra (undocumented) queue wake bits - see "Undoc. Windows" */
#define QS_SMRESULT 0x8000 /* Queue has a SendMessage() result */
#define QS_SMPARAMSFREE 0x4000 /* SendMessage() parameters are available */
/* Queue flags */
#define QUEUE_SM_ASCII 0x0002 /* Currently sent message is Win32 */
#define QUEUE_SM_UNICODE 0x0004 /* Currently sent message is Unicode */
void QUEUE_DumpQueue( HQUEUE hQueue );
void QUEUE_WalkQueues(void);
WINBOOL QUEUE_IsExitingQueue( HQUEUE hQueue );
void QUEUE_SetExitingQueue( HQUEUE hQueue );
MESSAGEQUEUE *QUEUE_GetSysQueue(void);
void QUEUE_Signal( HANDLE hTask );
void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit );
void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit );
void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue );
void QUEUE_WaitBits( WORD bits );
void QUEUE_IncPaintCount( HQUEUE hQueue );
void QUEUE_DecPaintCount( HQUEUE hQueue );
void QUEUE_IncTimerCount( HQUEUE hQueue );
void QUEUE_DecTimerCount( HQUEUE hQueue );
WINBOOL QUEUE_CreateSysMsgQueue( int size );
WINBOOL QUEUE_DeleteMsgQueue( HQUEUE hQueue );
HANDLE QUEUE_GetQueueTask( HQUEUE hQueue );
WINBOOL QUEUE_AddMsg( HQUEUE hQueue, MSG * msg, DWORD extraInfo );
int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND hwnd,
int first, int last );
void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos );
void QUEUE_FlushMessages(HQUEUE);
void hardware_event( WORD message, WORD wParam, LONG lParam,
int xPos, int yPos, DWORD time, DWORD extraInfo );
HQUEUE STDCALL InitThreadInput( WORD unknown, WORD flags );
HQUEUE WINAPI SetThreadQueue( DWORD thread, HQUEUE hQueue );
HQUEUE WINAPI GetThreadQueue( DWORD thread );
VOID WINAPI SetFastQueue( DWORD thread, HANDLE hQueue );
HANDLE STDCALL GetFastQueue( void );
#endif /* __WINE_QUEUE_H */

View file

@ -0,0 +1,27 @@
/*
* Message Logging functions
*/
#ifndef __WINE_SPY_H
#define __WINE_SPY_H
#define SPY_DISPATCHMESSAGE 0x0101
#define SPY_SENDMESSAGE 0x0103
#define SPY_DEFWNDPROC 0x0105
#define SPY_RESULT_OK 0x0001
#define SPY_RESULT_INVALIDHWND 0x0003
#define SPY_RESULT_DEFWND 0x0005
extern const char *SPY_GetMsgName( UINT msg );
extern void SPY_EnterMessage( INT iFlag, HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam );
extern void SPY_ExitMessage( INT iFlag, HWND hwnd, UINT msg,
LRESULT lReturn );
extern int SPY_Init(void);
#endif /* __WINE_SPY_H */

View file

@ -0,0 +1,248 @@
/*
* Window definitions
*
* Copyright 1993 Alexandre Julliard
*/
#ifndef __WINE_WIN_H
#define __WINE_WIN_H
typedef HANDLE HTASK;
typedef HANDLE HQUEUE;
#include <user32/class.h>
#define WND_MAGIC 0x444e4957 /* 'WIND' */
/* Built-in class names (see _Undocumented_Windows_ p.418) */
#define POPUPMENU_CLASS_NAME "#32768" /* PopupMenu */
#define DESKTOP_CLASS_NAME "#32769" /* Desktop */
#define DIALOG_CLASS_NAME "#32770" /* Dialog */
#define WINSWITCH_CLASS_NAME "#32771" /* WinSwitch */
#define ICONTITLE_CLASS_NAME "#32772" /* IconTitle */
#define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
#define DESKTOP_CLASS_ATOM ((ATOM)32769) /* Desktop */
#define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
#define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
#define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
/* Built-in 32-bit classes */
typedef enum
{
BIC32_BUTTON,
BIC32_EDIT,
BIC32_LISTBOX,
BIC32_COMBO,
BIC32_COMBOLB,
BIC32_POPUPMENU,
BIC32_STATIC,
BIC32_SCROLL,
BIC32_MDICLIENT,
BIC32_DESKTOP,
BIC32_DIALOG,
BIC32_ICONTITLE,
BIC32_NB_CLASSES
} BUILTIN_CLASS;
/* PAINT_RedrawWindow() control flags */
#define RDW_C_USEHRGN 0x0001
#define RDW_C_DELETEHRGN 0x0002
struct tagDCE;
struct tagDC;
struct tagCLASS;
typedef struct tagWND
{
struct tagWND *next; /* Next sibling */
struct tagWND *child; /* First child */
struct tagWND *parent; /* Window parent (from CreateWindow) */
struct tagWND *owner; /* Window owner */
struct tagCLASS *class; /* Window class */
void *winproc; /* Window procedure */
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND hwndSelf; /* Handle of this window */
HINSTANCE hInstance; /* Window hInstance (from CreateWindow) */
RECT rectClient; /* Client area rel. to parent client area */
RECT rectWindow; /* Whole window rel. to parent client area */
LPWSTR text; /* Window text */
void *pVScroll; /* Vertical scroll-bar info */
void *pHScroll; /* Horizontal scroll-bar info */
void *pProp; /* Pointer to properties list */
struct tagDCE *dce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
HGLOBAL hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */
HRGN hrgnWindow; /* region where the os permits drawing == max update region */
HWND hwndLastActive;/* Last active popup hwnd */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
DWORD helpContext; /* Help context ID */
WORD flags; /* Misc. flags (see below) */
HMENU hSysMenu; /* window's copy of System Menu */
DWORD userdata; /* User private data */
// struct _WND_DRIVER *pDriver; /* Window driver */
// void *pDriverData; /* Window driver data */
DWORD wExtra[1]; /* Window extra bytes */
} WND;
typedef struct tagCREATESTRUCTA {
LPVOID lpCreateParams;
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
LPCSTR lpszName;
LPCSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCTA, *LPCREATESTRUCTA;
typedef struct tagCREATESTRUCTW {
LPVOID lpCreateParams;
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
LPCWSTR lpszName;
LPCWSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCTW, *LPCREATESTRUCTW;
typedef struct
{
CREATESTRUCTA *lpcs;
HWND hwndInsertAfter;
} CBT_CREATEWNDA, *LPCBT_CREATEWNDA;
typedef struct
{
CREATESTRUCTW *lpcs;
HWND hwndInsertAfter;
} CBT_CREATEWNDW, *LPCBT_CREATEWNDW;
typedef struct _STARTUPINFOW {
DWORD cb;
LPWSTR lpReserved;
LPWSTR lpDesktop;
LPWSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
LPBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
} STARTUPINFOW, *LPSTARTUPINFOW;
typedef struct _WND_DRIVER
{
void (*pInitialize)(WND *);
void (*pFinalize)(WND *);
WINBOOL (*pCreateDesktopWindow)(WND *, struct tagCLASS *, WINBOOL);
WINBOOL (*pCreateWindow)(WND *, struct tagCLASS*, CREATESTRUCTW *, WINBOOL);
WINBOOL (*pDestroyWindow)(WND *);
WND* (*pSetParent)(WND *, WND *);
void (*pForceWindowRaise)(WND *);
void (*pSetWindowPos)(WND *, const WINDOWPOS *, WINBOOL);
void (*pSetText)(WND *, LPCSTR);
void (*pSetFocus)(WND *);
void (*pPreSizeMove)(WND *);
void (*pPostSizeMove)(WND *);
void (*pScrollWindow)(WND *, struct tagDC *, INT, INT, const RECT *, WINBOOL);
void (*pSetDrawable)(WND *, struct tagDC *, WORD, WINBOOL);
WINBOOL (*pIsSelfClipping)(WND *);
} WND_DRIVER;
typedef struct
{
RECT rectNormal;
POINT ptIconPos;
POINT ptMaxPos;
HWND hwndIconTitle;
} INTERNALPOS, *LPINTERNALPOS;
/* WND flags values */
#define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
#define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
#define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
#define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
#define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
/* Used to have WIN_NO_REDRAW 0x0020 here */
#define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
#define WIN_ISDIALOG 0x0200 /* Window is a dialog */
#define WIN_ISWIN 0x0400 /* Understands Win32 messages */
#define WIN_SAVEUNDER_OVERRIDE 0x0800
/* BuildWinArray() flags */
#define BWA_SKIPDISABLED 0x0001
#define BWA_SKIPHIDDEN 0x0002
#define BWA_SKIPOWNED 0x0004
#define BWA_SKIPICONIC 0x0008
#define SWP_DEFERERASE 0x2000
/* Offsets for GetWindowLong() and GetWindowWord() */
#define GWW_ID (-12)
#define GWW_HWNDPARENT (-8)
#define GWW_HINSTANCE (-6)
#define GWL_WNDPROC (-4)
/* Window functions */
HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, ATOM classAtom );
WND* WIN_FindWndPtr( HWND hwnd );
WND* WIN_GetDesktop(void);
void WIN_DumpWindow( HWND hwnd );
void WIN_WalkWindows( HWND hwnd, int indent );
WINBOOL WIN_UnlinkWindow( HWND hwnd );
WINBOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
HWND WIN_FindWinToRepaint( HWND hwnd, HQUEUE hQueue );
WINBOOL WIN_ResetQueueWindows( WND* wnd, HQUEUE hQueue, HQUEUE hNew);
WINBOOL WIN_CreateDesktopWindow(void);
HWND WIN_GetTopParent( HWND hwnd );
WND* WIN_GetTopParentPtr( WND* pWnd );
WINBOOL WIN_IsWindowDrawable(WND*, WINBOOL );
HINSTANCE WIN_GetWindowInstance( HWND hwnd );
WND** WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
void WIN_UpdateNCArea(WND* wnd, WINBOOL bUpdate);
void WIN_SendDestroyMsg( WND* pWnd );
WND* WIN_DestroyWindow( WND* wndPtr );
HWND WIN_FindWindow( HWND parent, HWND child, ATOM className,
LPCWSTR title );
LONG WIN_GetWindowLong( HWND hwnd, INT offset );
LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval );
WINBOOL WIN_EnumChildWindows( WND **ppWnd, ENUMWINDOWSPROC func,
LPARAM lParam );
#endif /* __WINE_WIN_H */

View file

@ -0,0 +1,45 @@
/*
* Window procedure callbacks definitions
*
* Copyright 1996 Alexandre Julliard
*/
#ifndef __WINE_WINPROC_H
#define __WINE_WINPROC_H
//#include "wintypes.h"
typedef enum
{
WIN_PROC_A,
WIN_PROC_W
} WINDOWPROCTYPE;
typedef enum
{
WIN_PROC_CLASS,
WIN_PROC_WINDOW,
WIN_PROC_TIMER
} WINDOWPROCUSER;
typedef HANDLE HWINDOWPROC;
// base.h defines WNDPROC
typedef struct _MSGPARAM
{
WPARAM wParam;
LPARAM lParam;
LRESULT lResult;
} MSGPARAM;
WINBOOL WINPROC_Init(void);
WNDPROC WINPROC_GetProc( HWINDOWPROC proc, WINDOWPROCTYPE type );
WINBOOL WINPROC_SetProc( HWINDOWPROC *pFirst, WNDPROC func,
WINDOWPROCTYPE type, WINDOWPROCUSER user );
void WINPROC_FreeProc( HWINDOWPROC proc, WINDOWPROCUSER user );
WINDOWPROCTYPE WINPROC_GetProcType( HWINDOWPROC proc );
#endif /* __WINE_WINPROC_H */

View file

@ -1,4 +1,4 @@
# $Id: makefile_rex,v 1.2 1999/05/15 13:35:57 ea Exp $
# $Id: makefile_rex,v 1.3 1999/06/05 19:02:15 ariadne Exp $
#
# ReactOS Operating System
#
@ -21,12 +21,14 @@ endif
all: $(DLLTARGET)
MISC_OBJECTS = misc/sprintf.o misc/exitwin.o misc/dllmain.o
MISC_OBJECTS = misc/sprintf.o misc/exitwin.o misc/dllmain.o misc/string.o
RESOURCE_OBJECT = $(TARGET).coff
#RESOURCE_OBJECT = $(TARGET).coff
WINDOWS_OBJECTS = windows/message.o windows/wndproc.o windows/win.o windows/hook.o windows/spy.o\
windows/queue.o
OBJECTS = $(MISC_OBJECTS) $(RESOURCE_OBJECT)
OBJECTS = $(MISC_OBJECTS) $(WINDOWS_OBJECTS)
ifeq ($(DOSCLI),yes)
CLEAN_FILES = misc\*.o \

View file

@ -1,4 +1,4 @@
/* $Id: sprintf.c,v 1.1 1999/05/08 07:09:31 ea Exp $
/* $Id: sprintf.c,v 1.2 1999/06/05 19:02:15 ariadne Exp $
*
* user32.dll
*
@ -12,6 +12,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include "windows.h"
#define WPRINTF_LEFTALIGN 0x0001 /* Align output on the left ('-' prefix) */

View file

@ -0,0 +1,30 @@
/*
* Windows hook functions
*
* Copyright 1994, 1995 Alexandre Julliard
* 1996 Andrew Lewycky
*
* Based on investigations by Alex Korobka
*/
/***********************************************************************
* HOOK_CallHooks32W
*
* Call a hook chain.
*/
#include <windows.h>
LRESULT HOOK_CallHooksA( INT id, INT code, WPARAM wParam,
LPARAM lParam )
{
}
LRESULT HOOK_CallHooksW( INT id, INT code, WPARAM wParam,
LPARAM lParam )
{
}
WINBOOL HOOK_IsHooked( INT id )
{
return FALSE;
}

View file

@ -0,0 +1,162 @@
#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
*/
LRESULT STDCALL SendMessageA( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam )
{
WND * wndPtr;
WND **list, **ppWnd;
LRESULT ret;
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 (!IsWindow(wndPtr->hwndSelf)) continue;
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION)
SendMessageA( wndPtr->hwndSelf, msg, wParam, lParam );
}
HeapFree( GetProcessHeap(), 0, list );
return TRUE;
}
if (HOOK_IsHooked( WH_CALLWNDPROC ))
MSG_CallWndProcHook( (LPMSG)&hwnd, FALSE);
if (!(wndPtr = WIN_FindWndPtr( hwnd )))
{
//WARN(msg, "invalid hwnd %08x\n", hwnd );
return 0;
}
#if 0
if (QUEUE_IsExitingQueue(wndPtr->hmemTaskQ))
return 0; /* Don't send anything if the task is dying */
#endif
SPY_EnterMessage( SPY_SENDMESSAGE, hwnd, msg, wParam, lParam );
if (wndPtr->hmemTaskQ != GetFastQueue())
ret = MSG_SendMessage( wndPtr->hmemTaskQ, hwnd, msg, wParam, lParam,
QUEUE_SM_ASCII );
else
ret = CallWindowProcA( (WNDPROC)wndPtr->winproc,
hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK, hwnd, msg, ret );
return ret;
}
LRESULT STDCALL SendMessageW(
HWND hwnd, /* Window to send message to. If HWND_BROADCAST,
the message will be sent to all top-level windows. */
UINT msg, /* message */
WPARAM wParam, /* message parameter */
LPARAM lParam /* additional message parameter */
) {
WND * wndPtr;
WND **list, **ppWnd;
LRESULT ret;
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 (!IsWindow(wndPtr->hwndSelf)) continue;
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION)
SendMessageW( wndPtr->hwndSelf, msg, wParam, lParam );
}
HeapFree( GetProcessHeap(), 0, list );
return TRUE;
}
if (HOOK_IsHooked( WH_CALLWNDPROC ))
MSG_CallWndProcHook( (LPMSG)&hwnd, TRUE);
if (!(wndPtr = WIN_FindWndPtr( hwnd )))
{
//WARN(msg, "invalid hwnd %08x\n", hwnd );
return 0;
}
#if 0
if (QUEUE_IsExitingQueue(wndPtr->hmemTaskQ))
return 0; /* Don't send anything if the task is dying */
#endif
SPY_EnterMessage( SPY_SENDMESSAGE, hwnd, msg, wParam, lParam );
if (wndPtr->hmemTaskQ != GetFastQueue())
ret = MSG_SendMessage( wndPtr->hmemTaskQ, hwnd, msg, wParam, lParam,
QUEUE_SM_ASCII | QUEUE_SM_UNICODE );
else
ret = CallWindowProcW( (WNDPROC)wndPtr->winproc,
hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK, hwnd, msg, ret );
return ret;
}
/***********************************************************************
* MSG_SendMessage
*
* Implementation of an inter-task SendMessage.
*/
LRESULT MSG_SendMessage( HQUEUE hDestQueue, HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam, WORD flags )
{
return 0;
}
/************************************************************************
* 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;
}

View file

@ -0,0 +1,9 @@
#include <windows.h>
int SPY_EnterMessage( UINT id, HWND hwnd, UINT msg, WPARAM wParam,LPARAM lParam )
{
}
int SPY_ExitMessage( UINT id, HWND hwnd, UINT msg, LRESULT res )
{
}

View file

@ -0,0 +1,22 @@
#include <windows.h>
#include <user32/win.h>
WINBOOL IsWindow(HANDLE hWnd)
{
return TRUE;
}
WND * WIN_FindWndPtr( HWND hwnd )
{
return NULL;
}
WND* WIN_GetDesktop(void)
{
return NULL;
}
WND **WIN_BuildWinArray( WND *wndPtr, UINT bwaFlags, UINT* pTotal )
{
return NULL;
}

View file

@ -0,0 +1,82 @@
#include <windows.h>
#include <user32/winproc.h>
/**********************************************************************
* CallWindowProc
*
* The CallWindowProc() function invokes the windows procedure _func_,
* with _hwnd_ as the target window, the message specified by _msg_, and
* the message parameters _wParam_ and _lParam_.
*
* Some kinds of argument conversion may be done, I'm not sure what.
*
* CallWindowProc() may be used for windows subclassing. Use
* SetWindowLong() to set a new windows procedure for windows of the
* subclass, and handle subclassed messages in the new windows
* procedure. The new windows procedure may then use CallWindowProc()
* with _func_ set to the parent class's windows procedure to dispatch
* the message to the superclass.
*
* RETURNS
*
* The return value is message dependent.
*
* CONFORMANCE
*
* ECMA-234, Win32
*/
LRESULT WINAPI CallWindowProcA(
WNDPROC func,
HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam
)
{
}
LRESULT WINAPI CallWindowProcW(
WNDPROC func,
HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam
)
{
}
/***********************************************************************
* DefWindowProc Calls default window message handler
*
* Calls default window procedure for messages not processed
* by application.
*
* RETURNS
* Return value is dependent upon the message.
*/
//FIXME DefWindowProcW should be fundamental
LRESULT WINAPI DefWindowProcA(
HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam )
{
}
LRESULT WINAPI DefWindowProcW(
HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam )
{
}