Coder Social home page Coder Social logo

Comments (16)

NazmusLabs avatar NazmusLabs commented on May 18, 2024 2

@T8z5h3 yes, but in this case, it is the API that you are referring to itself that has apparently been deprecated, which is the reason for my surprise.

from winfile.

NazmusLabs avatar NazmusLabs commented on May 18, 2024 1

I think we should have that menu item just call the native Windows format disk UI, the one you get when you right click a drive on file explorer and click "Format Disk...".

from winfile.

matthewjustice avatar matthewjustice commented on May 18, 2024 1

I like @NazmusLabs's suggestion of invoking the current Windows format disk UI (shown below). However, I also have a concern with this approach.

Today when a user invokes this UI from the shell, explorer.exe calls ShFormatDrive which displays the UI. Unfortunately, MSDN says that ShFormatDrive is deprecated. So if we want to use this exact UI, we'll need to rely on a deprecated function. Of course explorer.exe is still using it, so that's something. I haven't yet come across a supported Windows API function that does the same thing.

format-explorer2

from winfile.

matthewjustice avatar matthewjustice commented on May 18, 2024 1

PR #108 submitted. I went with the SHFormatDrive approach.

from winfile.

ZanderBrown avatar ZanderBrown commented on May 18, 2024 1

Would make sense, it seems the item is enabled based on the value of nFloppies

https://github.com/Microsoft/winfile/blob/c57f75539c91c461754910850e3d8c7b01e65640/src/wfinit.c#L1332-L1347

And as you can see that value is calculated based on the assumption a removable drive is a floppy disk so as far as the logic cares your external harddrive is a floppy

from winfile.

NazmusLabs avatar NazmusLabs commented on May 18, 2024 1

@ZanderBrown nice! Thanks for confirming my assumption. So it appears it may not have anything to do with having a card reader, but rather any removal drive. πŸ™‚

from winfile.

T8z5h3 avatar T8z5h3 commented on May 18, 2024

ether that or call disk management MMC

from winfile.

matthewjustice avatar matthewjustice commented on May 18, 2024

@daviunic - Are you referring to the menu item in the screenshot below?

format

Because if so, it is always disabled for me (and I would assume for most users today), because I have no floppy drives. See this line of code:

https://github.com/Microsoft/winfile/blob/a06f6f19a9eedbbd1fbcd6462737055be8c39eb9/src/wfinit.c#L411

I'm curious, is it enabled for you, and do you have a floppy drive on your system? Thanks!

from winfile.

craigwi avatar craigwi commented on May 18, 2024

It is clear that the old FormatDisk code isn't doing what we think is should. That's also true of other things like the old Security menu.

I would prefer to map out a simple approach to enable this functionality (FormatDisk in this case) or, if that is not possible, to delete the feature.

from winfile.

daviunic avatar daviunic commented on May 18, 2024

@matthewjustice it is enabled for me and invoking it causes the error I mentioned. No floppy drives, but I have a USB 3.0 + card reader combo device installed via USB 3.0 headers and for every type of card it supports it displays a drive in explorer, acting much like a floppy drive would. So it seems it misdetects removable drives which behave this way.

And I'm not sure why they would deprecate a function they continue to use anyway and fail to provide an alternative for.

from winfile.

T8z5h3 avatar T8z5h3 commented on May 18, 2024

@daviunic that would make sense because to windows your Card reader looks like a USB Floppy drive but i think how the programming interacts with the card reader is incomparable.

from winfile.

NazmusLabs avatar NazmusLabs commented on May 18, 2024

@matthewjustice I'm shocked to see this listed as deprecated. Usually things that get deprecated usually have had newer API calls or alternatives for a long time now. This doesn't seem to have any. Or does MS want to use the CMD for that now? And, like you said, Explorer uses this....

Regardless, I'm confident this feature won't go away anytime soon until Microsoft introduces an alternative and creates a redirect.

For example, the classic "calc" run command now redirects a call to launch the Calculator UWP app so that things like hardware calculator buttons on keyboards don't break.

from winfile.

matthewjustice avatar matthewjustice commented on May 18, 2024

@daviunic Thanks for confirming. Good to know that card readers can cause that menu option to enable.

@NazmusLabs Agreed that the deprecation it is a bit surprising without an alternative available! It does seem unlikely that support for it would be completely dropped in the near term.

from winfile.

T8z5h3 avatar T8z5h3 commented on May 18, 2024

@NazmusLabs i feel that microsoft want the programer to do the simplest things when it comes to formatting witch is why they have a API call for the built in formatting tool

from winfile.

NazmusLabs avatar NazmusLabs commented on May 18, 2024

Funny thing: it used to be disabled for me. Now it's enabled all of the sudden, and I don't know why. I don't have a card reader. I always had an external USB 3.0 hard drive. Perhaps it for disconnected and reconnected, causing file manager to enable it. Back in the early to mid 90s, a drive wouldn't just pop up on a running operating systems, as USB mass storage devices werent yet a thing. The only way to have a drive being added while the OS was running, I'd imagine, would be if a floppy was inserted. So, maybe, the fact that my external hard drive got disconnected an reconnected caused the drive to disappear and reappear on my PC, could have triggered the Winfile app to enable the menu item. I'll need to check the code to see if it include such trigger events. Either that, or someone else can explain it better.

from winfile.

craigwi avatar craigwi commented on May 18, 2024

We have a solution and there don't appear to be specific next steps here. Reopen if you disagree.

from winfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.