|
I thought there would be some way of centrally registering if a document is unsaved. After all, doesn't then main 'Power Off' button in Windows prompt you with an 'You have unsaved data. Are you sure you want to close down?' type message? - which suggests that this is the case for at least some applications.
|
|
|
|
|
Ben Aldhouse wrote: I thought there would be some way of centrally registering if a document is
unsaved. No. You simply keep a dirty-flag somewhere in your application.
Ben Aldhouse wrote: 'You have unsaved data. Are you sure you want to close down?' type message? It will say that some applications aren't responding and that you might lose data if you close them anyway.
In WinForms you get a closing-event that is fired when Windows shuts down; the application should then shut down, but some applications show a dialog asking the user whether or not to shut down. Meaning Windows asks them to close, and they simply refuse and hang around.
Next question from Windows; do you want to terminate the applications that did not shut down?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for your replies Richard and Eddy. I think I may have discovered a 'feature' of Windows 10 here. I have just done some experiments with Notepad++ v6.7.7 and Inkscape v0.91. Notepad is so advanced that an unsaved document gets saved anyway and opened up next time you open Notepad++. I think Visual Studio tends towards this level of foolproofness, too. It will give a message when you open it up asking if you would like to 'recover' unsaved files from the last session. Inkscape, however, will lose what you were working on if you haven't saved it.
When I try and close Inkscape with an unsaved document it will produce a dialog asking me if really want to close it. However, when I close Windows 10 with an unsaved Inkscape document the document is lost. I think that this dialog would have caused the shutdown process to ask for user feedback in older versions of Windows. Not so in the current version of 10.
Is it Windows policy now that all applications should save documents on the fly or users be more careful? Is it an oversight in Windows 10? May be it will be fixed soon and I won't have to write my little program...
|
|
|
|
|
When you close an application (Inkscape for instance), it will receive a WM_CLOSE[^] message form the OS and as response to it it will ask you to save (or not to save) the unsaved documents...
When you close the whole OS the messages to send is WM_QUERYENDSESSION[^] and WM_ENDSESSION[^].
If those messages are not handled the application will lost data...
So it is entirely up to the application...
However you may replace the standard shutdown process with your own, where before any other messages you send a WM_CLOSE to each (top-level) window...If the window returns 0 (means, it handled the message), you continue to the next, but if not you can pop a message to alert the user and bring the window to focus...If you got to the end of the list, you can shut down the OS...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
This looks interesting. May be I'll get around to having a look at what is going on with these messages eventually. It would be an interesting exercise.
However, now I have seen that it isn't just short cuts to shutdown.exe that cause Windows to close down in a way that can cause unsaved work to be lost I've come to the conclusion that this is a possible oversight by Microsoft and I'll probably leave it for a while to see if they change it back themselves before I attempt to write my own fix.
Oh for just a little bit more time per day to get things done...
|
|
|
|
|
Ben Aldhouse wrote: Notepad is so advanced that an unsaved document gets saved anyway and opened up
next time you open Notepad++. That is not exactly advanced, just a choice. One usually copies the document to the temp-folder and have the user edit that, saving each edit. Or when the application shuts down - without blocking that process, if it does, it will be terminated and all data will be lost.
Ben Aldhouse wrote: Is it an oversight in Windows 10? Probably more a reaction to applications blocking/preventing Windows from shutting down.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Probably more a reaction to applications blocking/preventing Windows from shutting down.
Windows not closing down is actually useful to me, though, seeing as I am often daft enough to try and close down my computer before I have saved my work!
|
|
|
|
|
I have properly set the formats for these, but no matter how wide I make the Taskbar, only the short form for these shows. I cannot figure out how to make it show the long form.
Thanks in advance.
|
|
|
|
|
That's the same as in Windows 7.
BTW These forums are for programming questions.
|
|
|
|
|
No, it doesn't work the same as for Windows 7.
I thought this was a forum for any Windows question. if it is possible, I can move it to The Lounge, where I usually post general how-to questions.
|
|
|
|
|
swampwiz wrote: I can move it to The Lounge
Please don't. Pick an appropriate forum to post in. IMHO, this fine here.
You can lead a developer to CodeProject, but you can't make them think.
The Theory of Gravity was invented for the sole purpose of distracting you from investigating the scientific fact that the Earth sucks.
|
|
|
|
|
OK, I've just done the big upgrade to Windows 10. One thing that is bugging me is that the the windows (forms) now have a white top and no border. I'd like to get the regular color & border like I had it for Windows 7. I can't figure out how to do this.
Thanks in advance.
|
|
|
|
|
Applications that run on Windows 10 will generally take on the appearance of Windows 10 - so, the Aero interface is gone (it went in Windows 8).
|
|
|
|
|
We're looking at developing a new instrument control and analysis UI as Windows Universal Apps running on Windows 10 (desktop).
We're expecting marketing to push back and say that the software (analysis, at least) must be able to be run on Windows 7.
Is there any way to be able to do this?
A back-compatibility API/SDK?
Even recompiling for Windows 7 would be acceptable. (It doesn't need to be the exact same executable FILE, just the application functionality.)
Doing parallel development of two otherwise identical applications for Windows 7 and Windows 10 is not sensible.
Would our only option be to forego the Windows Universal Platform completely, and develop as regular WPF/MVVM for Windows 7 and then just run it in Windows 10?
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
AFAIK, a W10 "universal app" won't even run on W8/8.1; you'd have to specifically target 8.0/8.1 to have it run on those platforms, which would restrict the APIs you could use.
I haven't seen any way to get a "universal app" / "store app" to run on W7.
If you need to support W7, and don't want to write multiple applications, WPF is the way to go - so long as you don't need it to run on a Windows phone, or a Windows RT device.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks, That's what I expected, but asking the "collected wisdom" of CP seemd to be a good idea.
Retargeting for W7 would be acceptable if there was an SDK/API that could be used for the W7 version that provided the "universal app" (desktop flavor) functionality.
I'm hoping for the ability to do a single development that lets me use the universal app features (of course, only some would even be relevant...). This would make possible future tablet/phone app versions (subset functionality) easier to implement.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Matt T Heffron wrote: I'm hoping for the ability to do a single development that lets me use the universal app features
No such luck. You can't even "retarget" for Windows 7 because Universal Apps live in a sandbox and use their own special sandboxed API to talk to the OS. There is nothing you can do other than write two different apps or use WPF or Windows Forms or Win32.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I wanted to learn Windows 10 applications, and sadly it uses Windows Runtime. I have been working with .NET framework (specially WPF) and there is a very much simple way to update the title of the Window (which does not exist as a Control in Windows Runtime, instead is just a component of Application object), in Windows Runtime I am unable to change the Title of the application. It remains same as it was, initially; for example Win10Test.
I have not found any member of Application [^], Window [^] or CoreWindow [^] object that might let me update the Title for the application. I have also tried to tinker with Assembly attributes and changed their values but they also don't work.
Is there any way to update the title of the application, or would I need to name the application while creating the project? I have yet not found anything at all so I thought maybe WinRT developers might know what to do.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Double click on package.appxmanifest to open up the manifest editor in Visual Studio. Select the first tab (application). The top textbox (Display Name) is where you change the title of the application.
|
|
|
|
|
Thank you very much for your reply Pete, I did try that one but that is not the solution in Windows 10 applications. Also, Visual Studio doesn't open the manifest editor (I am using Visual Studio 2015), it instead opened up XML editor.
Now, if you didn't know it before. I would give you the How-to of changing the application's name in Windows 10. In the manifest, there is another node Applications, which contains the UAP (Universal application platform) and other properties that each of the application under the project holds.
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="Win10App.App">
<uap:VisualElements
DisplayName="My App"
Square150x150Logo="Assets\Logo.png"
Square44x44Logo="Assets\SmallLogo.png"
Description="Win10App"
BackgroundColor="#464646">
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
The DisplayName property of this Application was to be edited, not for the project (that was of project, or application... I am not sure, can you clear me?)
Anyways, the solution of yours is still applicable, because indeed it is the DisplayName property, but the child node was having some troubles.
Thank you.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: that is not the solution in Windows 10 applications Sorry, I missed that in your post. I got it into my head that you were talking about W8 - probably because you posted in the Win8 forum and not the separate VS2015 forum.
|
|
|
|
|
Oh my bad Pete, but this can be categorized in Windows 10 or Universal Application Platform more specifically.
I would try to make a suggestion to Chris for this category also.
Thank you very much for your time and support, Pete.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hello,
The File association can found on Publish option by default.
How can we make it programmatically & work on Window 8 WinRT & Metro??
I found it can make it programmatically on Desktop but for metro i not found yet.
Please give any idea.
Thank you.
|
|
|
|
|
There is no way to do it programmatically in a Windows Store app. That is by design because they don't want your app to have the power to take over file associations at will.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hello,
I found that on Desktop app like window form & wpf they can possible to embedding exe application & then execution it work so well.
How about Metro app (Window store) is that possible to do like that ??
I take 1 week on this problem but not yet found any idea. Please help me!
Thank you in advance !
|
|
|
|