 |
|
|
 |
|
 |
Hi,
I Want Change This Great TaskDialogs Fonts And Use For Example Tahoma,
Can Anyone Help Me?
And a question that is this work in windows XP?
tnx
|
|
|
|
 |
|
 |
Excellent article this one !!
I am planning to use this source code in one of my commercial application for my company. Can I use it ? Do I need to mention your name or anything like that ?
I went through The Public Domain dedication. But it's quite confusing.
Please let me know what all should I do in order to use this source code.
Thanks and really appreciate your article.
|
|
|
|
 |
|
 |
First of all, thanks for this great work!
But I have got one problem with it:
The dialog does not seem to appear on Citrix systems when it contains expanded info.
Anyone who has got the same problem? What can I do?
Thanks!
|
|
|
|
 |
|
 |
Hi,
how can change the MainInstruction text from within the CallBack function ?
I call the taskDialog.UpdateMainInstruction method as i use the taskDialog.SetProgressBarPosition to change the position value for the progress bar.
I saw that in the EmulateTaskDialog class i need to extend the WndProc to catch the message, but the MainInstruction remains always the same.
Can you help ?
Can you explain how to use the Callback function ?
Thanks in advance,
Giuseppe.
|
|
|
|
 |
|
 |
This is great work, and is much appreciated; I started to do this myself in VB.NET, but ran out of time and kept hitting walls with the unsafe code.
You may, however, wish to document that there's a minor issue in the EnableButton() and EnableRadioButton() functions in ActiveTaskDialog.CS, when you call the code from VB.NET:
The True/False test appears to be reversed when calling these two functions from VB.NET, so that when you pass in the button id and False, the button is enabled. This is contrary to your documentation, which states that passing in False should disable the button, and is also contrary to the behavior when calling your code from C#, where it exhibits the proper behavior.
I can only guess that this has to do with the differing way in which the C-based languages treat 0/1 as true/false.
With that in mind, there are two approaches a VB.NET user can take to work around the issue.
The first, and simplest, is to just remember to reverse True/False when calling the 2 functions from VB.NET.
The second is to actually change the code in the C# source to match the documentation. This approach is probably preferable for the VB.NET programmer if and only if they are 100% certain the code will never be called from C#.
For those who choose the second option, the following line in both functions:
(IntPtr)(enable ? 0 : 1 ));
should be changed to read:
(IntPtr)(enable ? 1 : 0 ));
It is extremely important that the user document whichever approach they choose; the "enable" parameter in the XML comment above the function in the source code file should be changed to indicate either that VB.NET users should reverse the Boolean logic, or that C# users should.
-AndrewC
|
|
|
|
 |
|
 |
I'm using the TaskDialog for asking the user of my app if they want to restart the application to do the requested task because it requires elevated access, similiar to how VS 2008 asks when you try to do something that requires elevated access.
For the CommandButton that is for saying "Yes, elevate me", I would like to show the shield icon instead of just the standard green arrow. But I've yet to figure out how. I'm pretty sure it's possible because VS2008 does this, but who knows what VS is doing underneath the hood.
Have you tried to do this?
|
|
|
|
 |
|
 |
Hi,
I'd like to use Vista TaskDialog Wrapper and Emulator (by Hedley Muscroft) in commercial applications and asked him for permission to use his code.
While he allowed me to use his code, he also pointed out that his code uses part of your code and suggested that I should double check with you for licensing questions.
So: Is there a special license agreement I have to obey when using your code or am I allowed to use and/or modify your code as I need in both free and commercial applications?
Thanks for information,
Thorsten
|
|
|
|
 |
|
 |
Hi Kevin,
Just to let you know, I recently posted an article which builds on your superb project by including an 'emulator' so that the TaskDialog can be used pre-Vista too. I've given you full credit for this excellent article though, and included links to it from my article. I hope that's ok.
Thanks again.
http://www.codeproject.com/useritems/Vista_TaskDialog_Wrapper.asp
Hedley Muscroft
|
|
|
|
 |
|
 |
Hi,
how can I change the text of a button in the callback function?
Maybe it is possible to work with the handle, but I've got no idea how to do it.
|
|
|
|
 |
|
 |
You can't. If you look at the MSDN documentation for TaskDialog (link below) you can see that TaskDialog does not support updating the text of buttons (which is often a poor experience for your users anyway). You might consider having two buttons and using enable and disable, or if you want complete control creating your own dialog. Remember, TaskDialog is designed to meet a lot of requirements and save you creating custom dialogs for most common tasks but it is not the answer to all needs. Technically you could use the window handle of the active TaskDialog to get the window handle of buttons and change their text but that would be pretty evil and probably technically unsupported which means it might break on future versions (adjust layout correctly etc).
http://msdn2.microsoft.com/en-us/library/bb762715.aspx[^]
|
|
|
|
 |
|
 |
i m getting error like: "Unable to find an entry point named 'TaskDialogIndirect' in DLL 'ComCtl32'.".
application shows me this message: "Requires OS Version 6.0.5243 or later" near the "Show Task Dialog" button.
pls help.thanks.
-- modified at 10:46 Saturday 27th October, 2007
Pravin Parmar,
PravinParmar.ce@gmail.com
|
|
|
|
 |
|
 |
Very good - code was very helpful
|
|
|
|
 |
|
 |
Hi,
I'm wondering why .net 3.0 framework has no managed way to use task dialogs. When does MS extend .net to provide managed support for vista platform features?
Anybody tought about an legacy implementation of ITaskDialog for task dialogs in .net 2.0 running on windows xp sp2. Maybe there could be something like a migration path for code running currently on xp using custom task dialog implementations today but will run with slightly changes on a future .net framework for vista system.
myMsg.BehindDaKeys = "Chris Richner";
|
|
|
|
 |
|
 |
Agreed; I would love to have a pretty and functional fallback using a custom form for Windows XP. I simply cannot use the new TaskDialog if the dialogs on the OS with the currently still major user base will have reduced functionality. A legacy implementation, using the "real" API under Vista, would be most welcome here, although I understand if there is some effort involved in achieving that...
|
|
|
|
 |
|
 |
Seems like we have to find someone to write that
btw: Paint.net makes use of the new concept and provides custom task dialogs (.net 2.0)
-- modified at 12:48 Monday 3rd September, 2007
|
|
|
|
 |
|
 |
- http://www.naughter.com/xtaskdialog.html
- http://www.codeproject.com/useritems/taskdialogs.asp
Edit: Oh and here's CodeJock's component! Here:
http://www.codejock.com/downloads/samples/controls.asp#controls_vistataskdialog
Scroll to the bottom of that page, and download the sample application they made. I think the last one is a commercial component, but it looks pretty good and I could not even distinguish the difference easily, at least when running the app on Vista and comparing it with the native mode box. (I believe the control suppports some flag that tells if it should use the native TaskDialog API if available)
|
|
|
|
 |
|
|
 |
|
 |
Yes, that one is indeed just perfect and what I think we were looking for. Thanks!
|
|
|
|
 |
|
 |
Hello, there's a problem when I run the TaskDialog in the source code example.
I think that it may be because of 64 bit edition.
The message is:
System.ArgumentException: El valor no está dentro del intervalo esperado.
en Microsoft.Samples.UnsafeNativeMethods.TaskDialogIndirect(TASKDIALOGCONFIG& pTaskConfig, Int32& pnButton, Int32& pnRadioButton, Boolean& pfVerificationFlagChecked)
en Microsoft.Samples.TaskDialog.PrivateShow(IntPtr hwndOwner, Boolean& verificationFlagChecked, Int32& radioButtonResult)
en Microsoft.Samples.TaskDialog.Show(IWin32Window owner, Boolean& verificationFlagChecked, Int32& radioButtonResult)
en FormPlay.Form1.TaskDialogButton_Click(Object sender, EventArgs e)
en System.Windows.Forms.Control.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ButtonBase.WndProc(Message& m)
en System.Windows.Forms.Button.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
|
|
 |
|
 |
Oops. That's embarasing. It needs Pack=1 on the interop structures. In UnsafeNativeMethods.cs change line 309 to be:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
internal struct TASKDIALOGCONFIG
and TaskDialog.cs line 212 to be:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct TaskDialogButton
I'll update the original code and resubmit.
|
|
|
|
 |
|
 |
KevinGre wrote: Oops. That's embarasing. It needs Pack=1 on the interop structures. In UnsafeNativeMethods.cs change line 309 to be:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
internal struct TASKDIALOGCONFIG
and TaskDialog.cs line 212 to be:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct TaskDialogButton
I'll update the original code and resubmit.
I don't mean to be nag but 2010 is upon us and it looks like you wrote this article (very good btw! thanks!) in 2007....I downloaded the source and got the ArgumentException error discussed in this thread....looks like the update still has not been posted....thanks for posting it!
Sincerely Yours,
Brian Hart
|
|
|
|
 |
|
 |
KevinGre wrote: Oops. That's embarasing. It needs Pack=1 on the interop structures. In UnsafeNativeMethods.cs change line 309 to be:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
internal struct TASKDIALOGCONFIG
and TaskDialog.cs line 212 to be:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct TaskDialogButton
I'll update the original code and resubmit.
I changed my downloaded code thusly and ran, and the task dialog popped up fine so long as I do not use Command Links. If I do, then all goes to hell once again.
Sincerely Yours,
Brian Hart
|
|
|
|
 |
|
 |
> I look forward to seeing a lot fewer Message Boxes in you applications and I hope this makes it easier.
Perhaps I'm mistaken but Task Dialog's seem more like a potential MessageBox replacement (let's face it, no matter how hard you try you always end up with one of the pesky buggers in your UI anyway).
My thoughts are that perhaps this library would be useful in creating "standardised" MessageBox helper functions perhaps with some logic for platform detection to display either a MessageBox if we're in a non-vista executing environment or TaskDialog's with all the nice bell's and whistles if we are in Vista.
Anyone else's thoughts? Does anyone know of similar implementations?
|
|
|
|
 |
|
 |
It is indeed a replacement for messagebox. I should clarify my comment. I look forward to seeing a lot less Yes No and OK Cancel message boxes and a lot more rich clear Task Dialogs in their place.
The code will not prevent your app running on XP and will only fail if you call Show on a pre-Vista OS. There is a static boolean property TaskDialog.IsAvailableOnThisOS which will tell you if Task Dialog is available. You can call MessageBox instead if it returns false.
You could alter the TaskDialog.PrivateShow method to use MessageBox on pre-Vista operating systems but that would mean ignoring many features of TaskDialog and what would you do with custom button text? This is why I left it up to the application to decide what to do on pre-Vista operating systems.
|
|
|
|
 |