Skip to content
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

Add ability to disable message about explorer restart. #118

Open
ghost opened this issue Oct 20, 2017 · 31 comments
Open

Add ability to disable message about explorer restart. #118

ghost opened this issue Oct 20, 2017 · 31 comments

Comments

@ghost
Copy link

ghost commented Oct 20, 2017

Thanks for T-Clock Redux, i like it so much(the fonts are rendered way better than in T-Clock), there is one more thing I want to ask you about:

Sometimes i restart explorer(to refresh icon, etc.) and T-Clock keep saying that it causes these restarts or detects multiple restarts. I want you to add an option in ini settings for advanced users to disable that message.

@White-Tiger
Copy link
Owner

won't happen... that message is a safety measure... and should only happen when the explorer restarts 3 times within 30 seconds.
Why do you kill it so often?

@ghost
Copy link
Author

ghost commented Oct 21, 2017

when the explorer restarts 3 times within 30 seconds.

@White-Tiger Ah, that how it is, now i at least will know how to avoid it.

Why do you kill it so often?

I didn't know that its 3 times, but as i said earlier to refresh icons, restore tray icons(sometimes they dissappering for me) and etc.

Thanks for answering.

@White-Tiger
Copy link
Owner

Sure... you're free to do that.. and if you really have to, it wouldn't hurt once in a while, but why so often within that short time frame?
I could probably adjust some parameters but I had to give it some room for slow computers.

@ghost
Copy link
Author

ghost commented Oct 22, 2017

but why so often within that short time frame?

@White-Tiger I don't think i do it so often, just killing explorer and starting new. How does explorer crash determination works? I guess it checks whetever explorer.exe process exist every 1 second, and add 1 to counter each time when process dissappered(e.g. crashed). Or there appropriate Window Message when explorer crashes?

but I had to give it some room for slow computers.

Then maybe add a rule which will check if computer is slow, and do things that needed?

@White-Tiger
Copy link
Owner

White-Tiger commented Oct 22, 2017

Or there appropriate Window Message when explorer crashes?

Close, it's a message when Explorer was started ;) Which allows T-Clock to hook into it once again.

@ghost
Copy link
Author

ghost commented Oct 22, 2017

@White-Tiger And what about starting bunch of explorer.exe?(There is such option in folder properties in control panel, which starts every folder in new process.)

@White-Tiger
Copy link
Owner

It should only trigger for the main explorer.. / desktop because it's a message that's send for the creation of the taskbar. https://msdn.microsoft.com/en-us/library/windows/desktop/cc144179(v=vs.85).aspx#Taskbar_Creation_Not

Do you have multiple monitors / taskbars? What kind of modifications / 3rd-party apps are running? Which version of Windows?

@ghost
Copy link
Author

ghost commented Oct 22, 2017

OK, got it.

1 monitor, 1 taskbar, Classic Shell, Windows 7 x64.

@ghost
Copy link
Author

ghost commented Oct 22, 2017

@White-Tiger I done fix for me, https://github.com/BladeMight/T-Clock/commit/6f8bf5479ab63c04365f3e169dd895382de53abc . Just decreased 30 seconds to 2.3 sec, so nevermind now.

@White-Tiger
Copy link
Owner

why did you have to decrease it to such a low number?
It's quite likely that it wouldn't work, even if it were crashing directly by T-Clocks injection, as an Explorer restart takes close to a second even if conditions are ideal.

@ghost
Copy link
Author

ghost commented Nov 6, 2017

@White-Tiger But its fine for me, so nevermind.

White-Tiger added a commit that referenced this issue Jan 28, 2018
+ also added "Restart Explorer" to advanced context menu.
@White-Tiger
Copy link
Owner

You might try my new release: https://github.com/White-Tiger/T-Clock/releases/tag/v2.4.4%23492-rc
It might actually fix your issue, but even if it doesn't, it now supports an inbuilt Explorer restart function.
So you could at least properly workaround the "issue".

Bear in mind that T-Clock does a proper shutdown, or rather tries to.. this means it'll give Explorer 15 seconds of time to exit. It'll kill it otherwise though your desktop icons etc. should be saved anyway. (means T-Clock will be slower than your kill script)

However: if you insist on using your kill script, you can kill the Explorer and call Clock /exit-explorer afterwards. So you'll get "full speed" and still inform T-Clock about a "proper" exit.

@ghost
Copy link
Author

ghost commented Jan 29, 2018

@White-Tiger Thanks for the fix, but it still says about it even after i say T-Clock about "proper" exit, but it happens less often though.

@White-Tiger
Copy link
Owner

How does your script look like? If you execute Clock /exit-explorer you're basically resetting the internal "crash" counter... so if it's executed to exit the Explorer, or after it was already dead, it shouldn't be able to complain about the next few Explorer crashes... (you might as well kill it outside of T-Clock, but use Clock /restart-explorer to simply start it... so you can kill it the way you want, but use T-Clock to run it again)

Also, did you yet try to execute Clock /restart-explorer (or use T-Clock's context menu to do the same) a few dozen times? It's always working for me...

@ghost
Copy link
Author

ghost commented Jan 29, 2018

or use T-Clock's context menu to do the same

I can't see the restart explorer in context menu.

My script is:

taskkill /IM explorer.exe /F
start explorer.exe

called by h.exe from my AutoHotkey program(script) by global hotkey which i can press at any time to restart explorer.

#NoTrayIcon
#SingleInstance Force
#Persistent	
#!F3:: ; Hotkey Win+Alt+F3
  run h D:\Program\Scripts\Batch\exres.cmd ; Call script
  return

And so you are saying that i should start explorer with Clock /restart-explorer instead?

@White-Tiger
Copy link
Owner

either would work...
You can use T-Clock to exit Explorer or to restart Explorer or to start Explorer... as long as one "method" is used, it shouldn't cause any troubles.
So yes, replacing start explorer.exe with C:\My\Path\To\Clock.exe /restart-explorer should work.

And the Exit/Restart options are accessible the same way the usual "Exit Explorer" would be avaible... Ctrl+Shift+Right Click on the Taskbar area (or in this example, on T-Clock)

@ghost
Copy link
Author

ghost commented Jan 29, 2018

@White-Tiger After i replaced with Clock /restart-explorer it still shows warning if i restart it 3 times through my script, or through T-Clock's context menu... Seems i need my unsafe fix, just that satisfies...

@White-Tiger
Copy link
Owner

hmm... something must be wrong in that case. What kind of background apps are running? Especially stuff that modifies parts of Windows (like something that modifies the taskbar like T-Clock, your AV, toolbars, startmenu, explorer extensions etc.)

From what you describe, it seems like something causes multiple TaskbarCreated messages to be send when Explorer restarts.. though it's weird... you also said you'll only receive it if you use the restart 3 times in a row... though each one resets the counter so that shouldn't be possible.
I could provide a debug build to do some logging.

@ghost
Copy link
Author

ghost commented Jan 29, 2018

I could provide a debug build to do some logging.

That would be helpful.

though each one resets the counter so that shouldn't be possible.

I'we been thinking same, but its ends up otherwise.

T-Clock, your AV, toolbars, startmenu, explorer extensions etc.

Nope, i have only T-Clock, i also, tested with only Explorer and T-Clock running, same result. About Classic Shell i mentioned earlier, i'm not using it anymore.
P.S. I don't believe in AV(Anti-Virus), so i never wan't to have one, just to slow down my pc, since i do a lot of things that would seems weird to AV... Even just compiling with gcc seems weird to AV's....

@White-Tiger
Copy link
Owner

White-Tiger commented Feb 13, 2018

sorry for the delay, I've attached (T-Clock_logging.zip) the logging build (T-Clock.log on your desktop), let's hope it'll give some insights.
You can extract it over your existing T-Clock or close yours and run it from a different folder.
(to revert back to the non-logging, you'd have to close the logging build, run the non-logging T-Clock and restart Explorer.exe because it doesn't close the log and you're thus unable to delete it)

I've made some other tweaks as well, so we'll see if they change anything. Just post your log when you've received the "nag screen" and closed T-Clock
There's also a fix for Clock /restart-explorer preventing T-Clock from closing... (if T-Clock started before the Explorer was running)

@ghost
Copy link
Author

ghost commented Feb 13, 2018

Here is the log: T-Clock.log.gz (Tried a bunch of times to restart through /restart-explorer switch and with my script)
And about fix for preventing T-Clock from closing it works, but one time i able to get the window with message to close T-Clock, clicked yes, and the Clock64.exe was still running in the background, and have not been into taskbar.
Btw just now i guessed that "why not to restart T-Clock with explorer in my script", that would be safely right?

taskkill /IM explorer.exe /F
taskkill /IM Clock64.exe /F
start explorer.exe
start D:\Path\To\Clock64.exe

@White-Tiger
Copy link
Owner

White-Tiger commented Feb 23, 2018

Thank you so far for your patience and help.

I think this one might fix it: T-Clock.zip
I've also adjusted the log output to make it a bit easier to read (and made it unload properly, so Explorer won't hold the log open)

Would be nice if you could try that one out and post your log. (even if it's working, I'd like to know how it's working just in case there's something to improve)

I can't really comment on the "safety" when you're killing T-Clock... (though you might also exit it properly... I mean, there's a switch for it) I wouldn't trust Windows on that^^ But yeah, if you're not currently editing a timer or stuff like that, there's nothing that should be lost.

@ghost
Copy link
Author

ghost commented Feb 23, 2018

@White-Tiger Well now it says about explorer crashes exactly after 3+ explorer crashes(e.g. 3+ explorer restarts from taskkill) when not using the /restart-explorer switch, and now with it.... It actually works fine!! It doesn't notify me anymore no mather how many times i restart it!
Latest script:

taskkill /IM explorer.exe /f
Clock64.exe /restart-explorer

T-Clock.log.gz
Could you give me(or publish to releases) build with same fixes and without log? ^^)

Thank you so far for your patience and help.

My, my! I think the same way.

@White-Tiger
Copy link
Owner

I'll push the changes first thing tomorrow morning. So that'll be about 11h for now :P
Your log pointed me to another issue I should probably take care of.

Yet, I still don't quite get why the TaskbarCreated message is sent so often... I originally wanted to add some logging about the program that sent it, but I couldn't find a way to do it... Seems like Windows doesn't allow one to find the origin of a message.

@ghost
Copy link
Author

ghost commented Feb 24, 2018

TaskbarCreated message

I think it is send by explorer itself when it is started, no mather what the program called it.

TaskbarCreated message is sent so often

I think its because i restart explorer like crazy, just for testing :3

White-Tiger added a commit that referenced this issue Feb 24, 2018
…ash" count #118

! fixed recursive/overlapping injection calls
! fixed sending MAINM_CLOCKINIT early
White-Tiger added a commit that referenced this issue Feb 24, 2018
@White-Tiger
Copy link
Owner

do you really need a build? you've compiled it yourself before :P
However, I plan on adding some kind of "nightly" binaries (though I can't really host them on Github) but I'm not sure if I'll finish that today.

@ghost
Copy link
Author

ghost commented Feb 24, 2018

However, I plan on adding some kind of "nightly" binaries (though I can't really host them on Github)

You can use AppVeyor for that, as i done for my project:

  1. Created tag latest-commit in repository.
  2. Created artifacts in AppVeyor.
  3. Configured deploy to github releases, part of my YAML:
before_deploy:
  # Combine commit message and commit message description.
  ps: $env:de = $env:APPVEYOR_REPO_COMMIT_MESSAGE + $env:l + $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED
deploy:
  provider: GitHub
  # Tag to which to deploy, you also can use here something like "nightly $(appveyor_build_version)" 
  tag: latest-commit
  # This is our release title
  release: Mahou latest commit release. ($(appveyor_build_version))
  # Release description( variable from before_deploy)
  description: $(de)
  auth_token: # secure
  artifact: /.*\.zip/ # Artifacts to publish
  prerelease: true # E.g. Nightly 
  force_update: true # Re-write my latest-commit tag.
  1. With these settings my project has always latest-commit build published to github relelases automatically.

do you really need a build? you've compiled it yourself before :P

Yay source code!

@White-Tiger
Copy link
Owner

White-Tiger commented Feb 24, 2018

well... I thought about using a "dynamic" tag on Github... but it doesn't feel right^^ Not even sure if that's error free.
AppVeyor can provide binaries directly btw.. so no need for Github there.

Though I have my own requirements..

  • has to be build by Travis CI (I don't want the MSVC build)
  • should be directly on Github or some other known/trusted provider which provides more or less direct links. (eg. Google Cloud storage)
  • should have no issue with frequent updates
  • should be the same link / only the latest compiled binaries so it won't waste tons of space.
  • should be free (I could host it myself, yet that'll fail point 2)

@ghost
Copy link
Author

ghost commented Feb 24, 2018

has to be build by Travis CI

Travis has similar deploy to GitHub releases.

should have no issue with frequent updates

Just after you push commit to github, travis builds, then deploys.

should be the same link / only the latest compiled binaries so it won't waste tons of space.

But why not? Just use same tag and same file naming to get same link e.g. github tag "dynamic", filename "TClockRedux.zip" and configure overwrite in travis, so it will use that only tag, and latest binary for it. The link then will be https://github.com/White-Tiger/T-Clock/releases/dynamic/ and direct download link will be: https://github.com/White-Tiger/T-Clock/releases/download/dynamic/TClockRedux.zip.

but it doesn't feel right^^ Not even sure if that's error free.

It is safe enough, look here at my project's "dynamic" release. Even though it says 300+ commits to master since this release^^ it is the build by latest commit.

@White-Tiger
Copy link
Owner

so... you're in fact using a static tag... I thought at first that you're "moving" the tag with each commit... (this is the "not safe" part I've been talking about)
Well... I don't like to have that kind of dummy tag^^ Which is why I prefer not to use Github until there's a better way. I played with it once, eg. I tried to make a draft, hidden / unreleased tag but people aren't allowed to download files (since it's unreleased)

I still have to tryout some options and see how it works before I decide what to do.

@ghost
Copy link
Author

ghost commented Feb 24, 2018

Goodluck finding out your own way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant