-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep deskband after restart #25
Comments
This is done by other deskbands but I am not sure how or what is missing |
Not sure if its just a bug in the current windows 10 version but toolbars only persist sometimes when resizing or moving a deskband. Even for the built in toolbars. |
Did you find out what caused it,I also find that it must be moved to leftside and then move back (horizontal mode),after that it will possibly remains open when restart |
Never found out the cause, but in my experience now, it works properly if you just leave it for a bit. I know windows writes the current toolbars to the registry so maybe theres some delays or it does it every set interval. |
I find another DeskBand Project on Github and its Sample works fun : sharpshell |
Your English is fine. Thanks for looking into it. Do you have a link to which COM interfaces are different? |
I think Probably these interfaces IDeskBand2, IPersistStream, IObjectWithSite, IInputObject ,they are all with return type 'int' in SharpShell, I remembered I have change All the interfaces expect those used to create ContextMenu. |
I updated the interfaces and it works fine for me. I checked the registry |
I spent a lot of time exploring the root causes of this problem. It's worth celebrating that I found a solution. First of all it is caused by the BUG of the system itself. Secondly, the problem lies in the language status bar. Third, the toolbar of the system itself has similar problems. Windows7's language status bar is on the left, where deskband is currently located. But the initial restart state of Windows10 is actually the same as that of Windows7. The language status bar still defaults to the left and then automatically moves to the right. This process creates the problem of blocking the toolbar. In fact, toolbars still exist, deskband is working, but they are invisible. So we just need to force the task bar to refresh at the right time. For example:
Personally, I suggest that the above code can be sent several times after the system startup. The problem of keeping deskband after restart has been solved, and the project should be excellent now. |
Since there are many self-startup programs when the operating system is booted, it is not recommended that the author build the above solution in "CSDeskBand" under such complicated circumstances. |
Interesting. Thanks for the details. Let me pin this issue for visibility. |
I currently have this problem. The deskband does indeed start, it's just invisible. I tried the SendNotifyMessage method (confirmed a true boolean was returned), but the deskband stayed invisible. Right now the only thing working is to restart explorer through task manager and then it's visible. |
I have tested several versions of Windows10, and all of the above methods are effective. You should send a "SendNotifyMessage" when the toolbar is not visible, but we don't know when the toolbar will disappear. So you can use "Timer()" to send messages continuously within five minutes of the Windows10 startup. It must be noted that sending only once is absolutely not enough. |
I made a standalone application that I ran at startup. Every 2 seconds it sends the "SendNotifyMessage" command. I let that run for a couple of minutes, but the deskband still did not appear. Can you share your code so that I may test it? |
I'm sure you didn't quote my code, but wrote your own global "BROADCAST", right? The key to success is not the number of messages sent, but the parameters I set. Your "SendNotifyMessage" code must be the same as mine. This is a message code that is only valid for Windows10, and Windows10 has a large number of Undocumented APIs. |
I just wrote a simple "Timer()" and sent messages every 15 seconds, a total of 12 times. There is no doubt that the problem is not a timer. I tested almost all Windows10 versions and they worked perfectly. |
This is what I did. What values did you use for HWND_BROADCAST and WM_SETTINGCHANGE?
|
Yeah, it seems all right. The most important "TraySettings" parameter settings are fine. It seems that we need to discuss our respective development environments. I used: CSDeskBand Version 3.1 + WPF + VS2017. |
I used CSDeskBand v3.1, WPF .NET Framework 4.7.2, VS2019. I attached the separate program I'm using to send the broadcast. I run the .exe in /bin/debug at startup. It sends the broadcast every 5 seconds until you press a key in the console window. Thank you for your help! |
It's strange that it works well on my computer. |
Well that's unfortunate for me then. The deskband stays invisible unless I restart explorer.exe |
Restarting the desktop process is effective, which shows that my point of view is correct. I even tested Windows Server 2016 on a virtual machine, and your program is still worked well. So maybe the error originated from your DLL file? |
Potentially. Did you add anything extra to your deskband in terms of window visiblity, etc., that could affect it? I attached my deskband so you may try it on your computer. |
This DLL file may have problems. There is no "TaskbarInfo" event in your code, and I guess that's why it can't receive messages. The DLL file can't even work after Windows Server 2016 system restart. I think you should study the author's demo carefully.
Don't let the content here be empty. The author of "CSDeskBand" has another excellent project that you can refer to: https://github.com/dsafa/audio-band |
I found the issue after adding my code piece by piece to the ExampleWpf until it stopped working after reboot. It turns out it was this line I was using in UserControl to programmatically set the height to be the taskbar height. Since the deskband is just for myself I have hard coded the height of the UserControl, and now the deskband is visible after rebooting! The reason it wasn't working after reboot is that the taskbar did not exist by the time the deskband started so it set the UserControl height to 0. To confirm it was user error and there are no problems with CSDeskBand. Thank you for the help. |
@MattBlessinger I think it could help, overriding the event callbacks OnInitialized and OnRenderSizeChanged, like I mentioned in #51. Thanks for you comment by the way, which was helpful for me. :) |
So there is any solution? |
Not sure if this can be done or not but something to look into.
The text was updated successfully, but these errors were encountered: