valpasob.blogg.se

Office 2011 identities folder mac
Office 2011 identities folder mac











office 2011 identities folder mac
  1. #OFFICE 2011 IDENTITIES FOLDER MAC CODE#
  2. #OFFICE 2011 IDENTITIES FOLDER MAC WINDOWS#

SHCreateStreamOnFileEx(pszFile, STGM_READ,įILE_ATTRIBUTE_NORMAL, FALSE, nullptr, &spStream) void RestorePositions(IFolderView *pView, PCWSTR pszFile) The Save­Positions function enumerates all the icons in a view and writes their identities and positions to a file. IStream_Write(spStream, &pt, sizeof(pt)) PView->Items(SVGIO_ALLVIEW, IID_PPV_ARGS(&spEnum)) SHCreateStreamOnFileEx(pszFile, STGM_CREATE | STGM_WRITE,įILE_ATTRIBUTE_NORMAL, TRUE, nullptr, &spStream) void SavePositions(IFolderView *pView, PCWSTR pszFile) Second reminder: These “Little Programs” do no error checking because they are intended as demonstrations, not production-ready applications.

office 2011 identities folder mac

More seriously, we can we put the two pieces together to make a program that saves and restores desktop icon positions. Hey, look, your icons shifted randomly by a few pixels.įor extra hijinx, drop a call to spView-> Set­Current­Folder­Flags( FWF_ AUTO­ARRANGE | FWF_ SNAP­TO­GRID, 0) before you enter the loop (to programmatically turn off auto-arrange and snap-to-grid), then put this program in a loop, and slip it onto a friend’s (or enemy’s) computer. Turn off Auto arrange icons and Align icons to grid on the desktop, and then run this program. This time, instead of printing the item’s name and position, we jiggle the icon position by a few pixels randomly, then set the jiggled coordinates as the new position. int _cdecl wmain(int argc, wchar_t **argv) Okay, that was neat, but you can do more than just query the positions. For each item, we ask the IShell­Folder for its name, and we ask the IFolder­View for its position. We ask the view for its Items enumeration, then proceed to enumerate each of the items. This isn’t actually necessary for enumerating the icons, but it lets us print their names. Wprintf(L"At %4d,%4d is %ls\n", pt.x, pt.y, spszName) Īfter getting the IFolder­View, we also ask for the corresponding IShell­Folder. SpFolder->GetDisplayNameOf(spidl, SHGDN_NORMAL, &str) SpView->Items(SVGIO_ALLVIEW, IID_PPV_ARGS(&spEnum)) SpView->GetFolder(IID_PPV_ARGS(&spFolder))

office 2011 identities folder mac

Int _cdecl wmain(int argc, wchar_t **argv)įindDesktopFolderView(IID_PPV_ARGS(&spView)) CCoInitialize incorporated by reference Okay, we already have enough to be able to enumerate all the desktop icons and print their names and locations. We use SWFO_ NEED­DISPATCH to say, “Please return the IDispatch in the sixth parameter.” And the sixth parameter is where we want the IDispatch to be returned. The fifth parameter specifies the search options. The fourth parameter receives the window handle, which is of no interest to us, but the parameter is mandatory, so we have to give it something.

office 2011 identities folder mac

#OFFICE 2011 IDENTITIES FOLDER MAC WINDOWS#

We use the special SWC_ DESKTOP flag (available starting in Windows Vista) to say, “Hey, I know the desktop isn’t the sort of thing people think of when they go looking for Explorer windows, but I know what I’m talking about, so let me have it.” The third parameter describes the types of windows we are looking for. The second parameter is reserved and must be VT_EMPTY. In our case, we are looking for the desktop. Everything here should look familiar (just in a different costume), aside from the call to Find­Window­SW, because we are looking for a specific window by location rather than just enumerating through all of them.

#OFFICE 2011 IDENTITIES FOLDER MAC CODE#

The Find­Desktop­Folder­View function takes the code from that earlier article and uses it to extract the shell view for the desktop. SpBrowser->QueryActiveShellView(&spView) SWC_DESKTOP, &lhwnd, SWFO_NEEDDISPATCH, &spdisp) SpShellWindows.CoCreateInstance(CLSID_ShellWindows) void FindDesktopFolderView(REFIID riid, void **ppv) Reminder: These “Little Programs” do no error checking because they are intended as demonstrations, not production-ready applications. The entire program is just scaffolding to get us far enough that we can call IFolder­View:: Get­Item­Position and IFolder­View:: Select­And­Position­Items.įirst, we adapt the code we saw some time ago that extracts the IFolder­View from a window. Today’s little program demonstrates how you can manipulate the positions of desktop icons.













Office 2011 identities folder mac