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.
The main core of Windows is spread out among three DLLs -- for 32 bit Windows, they are called kernel32.dll, user32.dll and gdi32.dll.
You are likely wanting to use them in a managed manner and those DLLs -- by default do not provide an unmanaged to managed interface, so -- you have a lot to learn -- not only about these three DLLs, but also about managed and unmanaged memory.
You have selected a very challenging task, but -- the Windows SDK is a great source for studying the componetry of Windows and .NET documentation will help some.
There is a website pinvoke.net that is a wiki about Interop -- the way to manage an unmanaged to managed application.
To ease the process -- I suggest that you procure an older version of Windows and first learn those DLLs in an unmanaged manner. XP is good for that.
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).
modified 7-Feb-14 3:06am.
Last Visit: 20-Nov-18 2:02 Last Update: 20-Nov-18 2:02