Hi all, I'm having trouble getting information on how to enumerate a folder that I created. My folder is under the "System" directory, and I want to display the contents in a menu (much like the "Send To" menu). I found the "Navigating the Namespace" article on MSDN, but but that just finds the "first" folder to enumerate. I have a an IShellFolder interface pointed to the system folder: hr = SHGetMalloc(&pMalloc); hr = SHGetFolderLocation(NULL, CSIDL_SYSTEM, NULL, NULL, &pidlSystem); hr = SHGetDesktopFolder(&psfDesktop); hr = psfDesktop->BindToObject(pidlSystem, NULL, IID_IShellFolder, (LPVOID *) &psfSystem); if (SUCCEEDED(hr)) { hr = psfDesktop->QueryInterface(IID_IShellFolder, (LPVOID *) &psfSystem); psfDesktop->Release(); } hr = psfSystem->EnumObjects(NULL, SHCONTF_FOLDERS, &ppenum);
Now how can I get an this pointed to my folder? I'm familiar with IShellFolder::ParseDisplayName
, but I just don't know how to implement this (if this is in fact what I need). Could someone point me in the right direction? Thanks, Matt
Matt Eckerson
Posts
-
Navigating the namespace -
Kill a screensaver...Hello Alexander, Well after implementing your idea, I've come to find out that it works great on Win2k, but not on NT. I didn't have the opportunity to test it on XP, but I've since found a newsgroup posting that suggests that it does (his code and sugguestions were very similar). I ended up using this: http://www.mooremvp.freeserve.co.uk/Win32/framed\_tip022.htm; and modified it a bit 'til it started working. Like I said, yours worked great for 2k (and probably XP). I've stored your reply for future use if needed. You might test it on NT and see what your results are. If you find something, let me know since it's alot easier than doing it like the link above shows. Can't thank you enough for your help. Your instructions were comprehensive and easy to follow. Thanks again, Matt
-
Return to the previous active window?Found that
::SetForegroundWindow(hwnd);
seems to work. Just didn't look deep enough. Sometimes things are staring you right in the face and you don't even realize it. :mad: Matt
-
Return to the previous active window?Hi all, I have a dialog that pops up every hour or so, and I'd like it to return to the previous active window after the user clicks OK on the dialog. I've got a HWND member variable that gets the previous active window in PreCreateWindow, and a SetActiveWindow function in the PostNcDestroy of the popup dialog class. I'm not sure about where else to put these functions, --and it does bomb with an error, "...memory could not be read." Could someone point me in the right direction? Where's the best place to do this? Thanks in advance. Matt
-
Kill a screensaver...Excellent! This looks exactly like what I need. I'll try this out and let you know. Thanks Alexander for your time. Matt
-
Kill a screensaver...Hello all, I have a dialog app that sits in the tray and pops up a dialog to remind the user of something every hour. It obviously does no good if a screensaver is running.:) I did some searching around and found ways of interrupting it and found some good stuff from Bob Moore's site:
void CMCAlarmDlg::KillScreenSaver()
{
HWND hwnd;if (hwnd = ::FindWindow ("WindowsScreenSaverClass", NULL)) { ::PostMessage(hwnd, WM\_CLOSE, 0, 0); // or tried //::SendMessage(hwnd, WM\_CLOSE, 0, 0); } else { if (hwnd = ::FindWindow ("Default Screen Saver", NULL)) { ::PostMessage(hwnd, WM\_CLOSE, 0, 0); } }
}
This does work on Win2K, but not on NT 4. I've tried several other things (tried this one too: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q140723)but haven't had any success. Several people have mentioned how unreliable FindWindow() can be. My question is, is there another way to interrupt the screensaver by a keyboard or a mouse? Bob Moore mentions doing this himself with hooks, but doesn't elaborate. Hooks are a bit beyond my beginners skill level anyway. Or has anyone had good luck with something that works across the board (9x, NT, 2K, XP) Ideas? :-D Thank you all (again) in advance. Matt
-
Pathetic humor - 1 of fewNot bad Ravi! :-D I always enjoy your posts sprinkled with bits of your humor. Your site is great too. Keep it up! Matt
-
I came across this neat game from 1995...Oh man, I remember playing Shanghai: GM a lot during college. That was a great game (still have it too, although I think you need a patch to run it in Win98). Michael Dunn wrote: Has anyone else found old games that still hold up over time? I'm not talking about 80s arcade games you play with MAME, but old PC games. I recently ran across some old LucasArts titles I had collecting dust such as Day of the Tentacle and Full Throttle. They were easy and quick to finish, but entertaining with colorful characters and storylines. Matt
-
Hey, John S. O/P. . .From one ex-blueshirt to another, Happy Veteran's Day. I saw your squid picture on your site. Man, are we talkin' old Navy or what? ;P The same to all you other Vets. Matt
-
More violence on US TV.Well, it's airing at 8 PM (or 7 PM in some time zones). Usually programs for s only (e.g. NYPD Blue) are relegated to the 10/9 PM time slot. My point was to show again how f'ed up we are in how we show all kinds of on TV, then wonder why kids are hurting and shooting each other in school. Agreed Mike. There's way more violence in TV today than there should be. But in this case, I think people should sit through Private Ryan for education more than anything. While the story is fiction, the content is close to (if not) accurate. It's a documentary of the hell these men went through. IMO, its humbling to think that many of these guys were drafted and suddenly they're dumped on Omaha Beach dodging bullets. Granted, everybody's different and discern things they see or hear differently. But I'd tend to think that the majority of people who'd see P.R. would be more respectful or patient of that old man in the hat driving 20mph in a 45. ;) Just a veteran's $.02. Matt
-
Halloween leftovers...>> it looks a lot like a piece of crap. Heh, it does. Take one to a public pool sometime and have some fun. ;P Matt
-
Halloween leftovers...Man! There is nothing like having some Baby Ruth® bars and a cup o' joe to start the day with. I bet the alien (is he named yet?) would love a Baby Ruth with a little Vegemite spread on it. :-) Matt
-
What's an excellent CD writing package?Did anyone mention Nero is an excellent choice? :-D My recommendation, too. Matt
-
Outlook address book???Actually, I did refer to MSDN, as well as several other places. The problem was, I just didn't know what to look for. Thanks for the suggestion, Igor. Regards, Matt
-
Outlook address book???Hi, Wondering if anyone knows (if its possible) how access the dialog that displays the list of recipients from an Outlook address book. More specifically, its the "Select Names" dialog you get when you click the "To" button on a new message. Can I also select the recipients and put their email addresses in variables? Thanks in advance, Matt
-
Ever built your own system?I'm the same way. I'd rather build my own. Have been for the past 6 yrs or so. I'm no overclocking genius either (maybe someday). But I like the fact of knowing where each component came from. I also like the ease of upgrading if needed. Its a pain to upgrade most pre-built systems since a lot of them have integrated stuff on the motherboard. We do the same thing at work. There are 11 servers and 160 workstations all built from scratch. My occupation is net admin, --but I think there's a developer in me screaming to come out :-D. Mike: Just don't ask me where we get our parts. You might get ticked! :-O Matt
-
How old are you people??30, going on 4. :-D Matt
-
St. Pat's announcementSo, I guess that'd make you "Pickled Michael Dunn." You may not be the "preferred snack" after tonight. ;P Have fun, Matt
-
New Registered user iconHmmm...I dunno David, it seems to be missing something. Maybe the icon needs a pink rope around his shoulder ;P (we love you Chris...) Matt
-
Snowboarders vs SkiersI've always been a skier, --in fact, just went 2 weeks ago. I'm out here in Colorado so it's a sin if I don't make it at least once a year. :-D Been dying to try snowboarding tho. Seems to be more fun than skiing. Snowboarding is also more appealing to me since: 1. The boots look way more comfortable. 2. No poles. 3. More maneuverability, --easier 180°'s and so forth. 4. Less junk to carry around. Anyone who's done both agree? Matt