Office 2013 and later

Last modified: July 01, 2011

Applies to: Excel 2013 | Office 2013 | Visual Studio

Installs ExcelCursorProc so that it is called before the Microsoft Excel main WndProc.

extern void FAR PASCAL HookExcelWindow(HANDLE hWndExcel);

hWndExcel (HANDLE)

The Excel main Windows handle.

The function does not return a value.

The function obtains the address of the Excel WndProc through the use of GetWindowLong(). It stores this value in a global that can be used to call the default WndProc and also to restore it. Finally, it replaces this address with the address of ExcelCursorProc using SetWindowLong().


See \SAMPLES\GENERIC\GENERIC.C for the source code for this function.