I'm working in pretty unfamiliar terrain, so I apologise if this is the wrong place to ask this question or if the question is wrong.
I'm trying to write code that acts on events in Microsoft software. I've worked out how to do this for generic Windows hooks like for keyboard entries, but can't work out how to do it for Office events (e.g., saving or printing a document).
Can anyone point me to a reference of hooks available in Office?
Please could you recommend a good book about programming for Windows 8.1 in Visual C++ which:-
* Lists all the Windows API functions and what they do and how to call them, including the difference between 1-byte and 2-byte characters.
* Says what a device-context etc is, and likewise all the technicalities of programming for Windows API.
There is no book that lists all of the Windows API functions. It would be way too thick. The only place that haas that information is MSDN.
As for "how to call all of them", you learn how to pass the various kinds of parameters then apply that knowledge to any API call you want. You will not find a "how to call this function" for every function in the API library.
But, for a book, there's these[^]. You will probably not find all the information you want in a single book.
If the screen window displays text, if the vertical bar's thumb is moved down a bit, so that the text on the window must be displayed n pixels higher, then it is quickest to scroll the window's existing contents up by n pixels, then I must rewrite only the bottom n rows of pixels. So please how, in a given screen area, to move every pixel upwards by n pixels?
I guess you are looking for an USB sniffer that is monitoring and logging data.
With Linux, you can use usbmon which is part of the kernel and Wireshark[^].
With Windows there are multiple commercial tools and some free (e.g. usbsnoop[^]). Just google for 'windows usb sniffer'. The Windows Wireshark version can also sniff USB traffic when installing an additional tool like USBPcap (see the above link).
I have a dialog-based application, and I use a portion of the dialog for drawing some graphics. I have a problem when I minimize and then restore the dialog...
I handle WM_SIZE (wParam == SIZE_RESTORED) to redraw my graphics, but this doesn't work because WM_PAINT occurs afterwards and redraws the entire dialog, leaving my graphics area blank. I tried moving my update function to WM_PAINT, but even that doesn't work, because the system redraws the dialog after my handler returns!!
How is this problem typically solved??
For now, I'm going to start a 50msec timer in WM_SIZE, and redraw my graphics in that, then stop the timer. I've used this trick before, and it works well enough, but I know that's not how this is supposed to be done!!
Within your WM_PAINT handler, call the default handler first to let the system draw the dialog. Then call your own routine to draw the graphics. Note that your handler must return zero to indicate that the message has been processed.
You may also draw your graphics by handling the WM_ERASEBKGND message using the same method (call default handler first and return zero EDIT: nonzero here).
To call the default handler, call DefWindowProc() when using the Windows API. When using MFC, override OnPaint() or OnEraseBkgnd() and call the base class function first (e.g. CDialog::OnEraseBkgnd()).
Note that there is an error in my previous post (I will edit it): WM_ERASEBKGND handlers must return nonzero when the background has been erased.
You may also just get the return value of the default function and return that.
I am using getopenfilename API to create a standard file open windows dialog. However this dialog is not able to show the mapped drive. If it is a long path over network. This is case for"look-in" field of dialog box. Is this a known bug?
I googled around but could not any info. Please help