• 0

[Visual C++ 6] File Transfer Dialog Box


Question

OK, I haven't used C++ in years so please bear with me.

I have a line of code that looks like this:

CopyFile(argv[2], argv[3], false);

While the file is copying, I want it to display a dialog box to show the progress of the transfer. You usually see this in Windows Explorer when you're transferring large files. How can I get this to work?

Thanks.

Link to comment
https://www.neowin.net/forum/topic/581364-visual-c-6-file-transfer-dialog-box/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Like I said, I haven't used C++ in years. What's wrong with my code? It keeps crashing.

		SHFILEOPSTRUCTA fop;

		fop.hwnd = NULL;
		fop.wFunc = FO_COPY;

		CString from = argv[2];
		from += "\ 0 \ 0"; //Double-null terminate? Is this how you do it? There's no spaces, but I put in the spaces so it would show up on the forums
		CString to = argv[3];
		to += "\ 0 \ 0"; //Double-null terminate? There's no spaces, but I put in the spaces so it would show up on the forums

		fop.pFrom = from;
		fop.pTo = to;
		fop.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_SIMPLEPROGRESS;

		SHFileOperation(&fop);

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • The sound never left. My Windows 10 installation still has it enabled, I found the checkbox in an earlier build and turned it on and my PC chimes every time it cold boots. That's how I know Windows Update didn't shut down after updating despite me telling it to. That being said... seeing Apple Liquid Glass has me thinking, if Windows 11 brought back the 7 Aero Glass running on top of the new kernel, minus the AI crap, I might actually be willing to move to it.
    • These days the differences are small, so if you're a petty nerd over dumb things, you'll be forever stuck behind and won't ever enjoy the latest and current niceties. Yup, it's a real life lesson too.
    • Microsoft 365 Roadmap Weekly: New features for the new Outlook, Copilot updates and more by David Uzondu This week, Microsoft added a slew of new entries to the public Microsoft 365 Roadmap, including plans for Teams, the new Outlook, and, of course, Copilot and Copilot Chat. Starting with Outlook, three practical updates are headed for the new Outlook for Windows client. First up, you'll finally be able to add attachments to emails while you are offline, a basic function that has been sorely missed. The remaining two features are slated for August. One will let you create a rule that specifically triggers a desktop alert. The other adds a folder deletion warning. If you try to delete a folder on which an email rule depends, Outlook will stop you and prompt you to fix the rule first. Like Google with Gemini, Microsoft continues to push Copilot deeper into its applications, with several updates planned for mid-2025. Later this month, Copilot will be able to give you a quick summary of recent changes and comments on a file right from the backstage view in Word, Excel, and PowerPoint, before you even open the document. Also, Copilot Chat will get the ability to limit its responses to selected content sources, like specific SharePoint sites or files, which should make its answers more focused. Next month, PowerPoint users will get two more Copilot tricks. You will be able to rewrite selected text using a custom natural language prompt and add entirely new topics to an existing presentation, with Copilot generating slides that match the existing look and feel. Edge is not left out, as its integrated Copilot Chat will soon be able to access content across multiple open tabs, not just the active one, with that update scheduled for August. Finally, for organizations that heavily use Teams Rooms Pro on Windows, an August update will allow for simultaneous town hall and webinar views. This will keep the presenter's backstage controls, like green room and backroom chat, hidden from the main audience display in the room.
    • The only reason I have Windows 11 is because it came with the new machine. I was quite happy with Windows 10. Windows 11 has its own issues just like any OS, but honestly after the fear-mongering towards Windows 11 while I was on Windows 10, I thought I would be more frustrated. I still prefer my daily OS, but Windows 11 isn't the worst thing in the world for what I use it for.
  • Recent Achievements

    • Apprentice
      Wireless wookie went up a rank
      Apprentice
    • Week One Done
      bukro earned a badge
      Week One Done
    • One Year In
      Wulle earned a badge
      One Year In
    • One Month Later
      Wulle earned a badge
      One Month Later
    • One Month Later
      Simmo3D earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      610
    2. 2
      ATLien_0
      285
    3. 3
      +FloatingFatMan
      179
    4. 4
      Michael Scrip
      151
    5. 5
      Steven P.
      112
  • Tell a friend

    Love Neowin? Tell a friend!