![]() ![]() The valid values for this parameter are in the Table 1 and can be combined with the logical or operator. If you specify a value of 0 (or NULL), then a value of GMEM_FIXED is assumed. The uFlags parameter is used to specify to Windows how the memory is to be allocated. HGLOBAL GlobalAlloc(UINT uFlags, SIZE_T dwBytes) Figure 1 shows these steps in a standard UML Sequence Diagram with the subsequent sections going into more detail about each step. Another thing to realize at this point is that regardless of the type of data being transferred to the clipboard, the same basic programmatic steps are taken any time you are transferring data to or from the Clipboard. If you're familiar with the Windows API - especially the means by which memory is allocated via the GlobalAlloc and GlobalLock functions - the steps needed to use the Clipboard will be all the easier to learn. ![]() Since the Clipboard API is by far the most common method used, most of the demos in this little series will use this technique. The first involves using the Windows Clipboard API and the second uses OLE. There are actually two distinct mechanisms for interfacing to the Clipboard. After I've gone over the basics steps, which are used no matter what data format is on the Clipboard, I'll present a demo application that illustrates how to programmatically transfer simple (ANSI) text to and from the Clipboard. In this first instalment of a four-part series of articles on programmatically transferring data to and from the Windows Clipboard, I'll explain the basic steps of using the Clipboard using the Clipboard API. With just a few lines of code, you can easily add Clipboard functionality to your application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |