Is it possible to drag and drop (files, text) to the taskbar icon of a WindowsForms application (C#)?
I know there's no easy way to do it for the tray icon (it involves using Win32 API and hooks), but I was wondering if it's possible for the taskbar.
That's not possible, but the window manager automatically restores the minimized window if you hover over it long enough in the taskbar. Once restored, you can access all the drop targets your window implements.
It is possible, at least in Windows 7. Note that the blog post which the two older answers refer to is from 2004. In Windows 7 and possibly previous versions, it is possible to drop files onto applications on the taskbar if you hold shift while dropping. Examples of applications that support this are Firefox, Internet Explorer, Notepad, etc.
In order to support it, your exe needs to be able to support the command line myapp.exe <some file path> and I believe you need registry entries similar to those described in this SO answer.
Update:
I added this to one of my applications, and it works. You do not need the registry entries.
This is fundamentally impossible.
Related
I've researched this a bit and can't seem to find an answer. A few articles here on SO also go unanswered or provide answers that don't seem to work so I'm running out of luck and hoping someone can help.
I've got a WinForms project, coded in VB.Net, using .Net Framework 4.6.2.
I wanted to the app to load in the system tray, and when clicked the actual form comes up. I got this to work using feedback from another article which implies creating a separate Module, include a Sub Main() declaration, load the Notification item in there and when system tray icon is clicked then load the main form.
To do this, I had to go to my project settings, select the "Sub Main" as the startup object, and un-check the "Enable application framework" box.
Everything works as it's supposed to, the notification icon is loaded in the taskbar, and when clicked my form opens up.
Here's the issue, when my buttons are rendered they look way different than when I setup the project to run the form instead of the windowless module. Example:
Buttons should look like:
But look like:
A few articles pointed to enabling the following options in my main module:
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(True)
Application.DoEvents()
This fixed the way my ListViews were rendering, but not the text. As you can see in the images, the top one is much more smooth and well-spaced than the bottom which looks bolder and misaligned.
I've tried changing the form's AutoScaleMode settings, AutoSize, and nothing works.
Any idea on how to fix this?
Setting the default font of the form worked, as #Çöđěxěŕ recommended.
By default, Windows hides the notify icons in the taskbar, and user can see them by clicking on the arrow button. But user can drag those and drop them into the taskbar, so it'll be always visible. This preference will be saved for that executable.
However, my WPF app uses Squirrel.Windows for installation and update, and Squirrel.Windows creates a new executable (in a different path) for each update. So Windows will treat it as another executable, and that preference about notify icon is reset. (It hides again, even if user dragged it to taskbar in the previous version)
Is there any way I can preserve that preference of user across updates?
Maybe there's an identifier or something I can uniquely set? or any other ideas?
I'm currently using System.Windows.Forms.NotifyIcon on my WPF app. But I'm open to using alternatives if an alternative can help solving this issue.
I am developing a security and kiosk library in my framework. The problem here is I have the proper methods and routines to disable various features of the Windows Shell. The main feature I am discussing here is the Windows Taskbar.
I have properly disabled, and hid the Windows Taskbar. The problem is that the WorkingArea of the Window's desktop is not updated by ShowWindow/EnableWindow calls to the Taskbar, and still leaves the reserved space for the Taskbar on the desktop.
After reading almost all the topics regarding this, I am dissappointed. I am not looking to simply make my program "Full Screen", "Top Most", those are not acceptable answers. I am actually looking to either unregister the Taskbar as an AppBar, or update the WorkingArea. Any other solution is not what I am looking for as they are just "workarounds" and not actually resolutions.
Any links, whitepapers, or code samples/guidance is appreciated.
You are going to have to be more flexible if you want a solution. The only odds you'll have for a 'perfect' solution is SHAppBarMessage with ABM_REMOVE. The odds aren't good, especially on Win7. I don't want to try this myself, I like my taskbar :)
Is it possble to Modify the Window's Login screen and add our own buttons/links? For example is it possible to do something like this?
alt text http://www.allaboutmoss.com/wp-content/uploads/2010/04/windowsxp_login.jpg
The above screen has a link and when clicked it should start a win forms application?
For Windows XP, you can build a GINA DLL, and for Vista+ you need to use the new credential providers system. In both cases, you basically have to build the UI from scratch and so it's not really possible to just take the existing UI and add a few controls here and there.
Of course, you could build your own GINA DLL that displays UI that's the same as the standard Windows XP one, with your own additions, but it's not exactly a simple task.
How to put a C# programm (ex WPF or WF) under desctop Icons (like a wallpaper)?
I want my Old Good XP Active Desktop made by a some open source C# programm on my Win 7!)
Something like this - Fences .
They have there "windows" appearing underneath icons. I do not want to manage Icons - just put my window under them... BTW any one knows about such operations in other OS’s (Mac etc)?
And I DO NOT WANT TO MANAGE ALL THE ICONS ON MY OWN LIKE bumptop
I think it is quite possible, try this:
Find handle to window with the class "Progman".
Create some window in your application (or, perhaps, in some separate application, you will see the purpose later) and turn off its borders.
Set the parent of the newly created window to desktop handle.
Set the parent of "Progman" window you have found previousely to the window you created.
Desktop will be put on a window owned by your application and it will be possible to manipulate it in the way you want (namely, put something under it).
Also, do not forget to restore desktop's parent when application owning it is closed.
Look for FindWindow, GetClassName and SetParent at http://www.pinvoke.net/
Short answer is you can't really do it (in managed C# anyway). If it's possible, you would need to use Interop, and you'd likely be calling something that Windows doesn't offer as an API.
... although... as Ole Jak mentioned, Stardock looks to be doing it somehow...
The desktop is its own contained item. The same process handles the icons and the wallpaper "behind" those icons.
You are allowed to change the wallpaper to a different image, and you used to be able to create an Active Desktop where HTML content would be displayed, but this was discontinued in Vista.
What are you actually trying to do? Maybe there's another way to achieve a similar result?
There was DreamScene for vista. You could put a video as explorer background. I dont know if you could run a C# program to output the background video.