topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 2:33 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: ForegroundLockTimeout Value  (Read 60210 times)

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
ForegroundLockTimeout Value
« on: April 14, 2005, 10:44 PM »
I noticed that the install of the Process Tamer 2.0 beta changed my HKEY_CURRENT_USER\Control Panel\Desktop\\ForegroundLockTimeout value to 0 (from 200000).  This causes annoying problems with application windows not grabbing focus when opened.

Is it necessary for ForegroundLockTimeout to be set to 0 for Process Tamer to work properly or optimally?
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #1 on: April 14, 2005, 10:53 PM »
scott -

i was just about to tell you that there is no code in process tamer that sets this, until i rechecked and discovered that indeed there is.

here is the code:
   // F*CKING MICROSOFT SHOULD BURN IN HELL
   // this code is nesc. to allow pop up to get foreground focus
   #ifndef SPI_SETFOREGROUNDLOCKTIMEOUT
      #define SPI_SETFOREGROUNDLOCKTIMEOUT 0x2001
   #endif
   SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, (LPVOID)0,SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);

evidently i added it at some point in a pique of anger because a popup message from the tray tool was showing up behind other windows; the new process tamer doesnt use popups though, and uses tray balloons, so i am going to remove this code.

see:
http://support.micro...oft.com/?kbid=886217


now, the question is, should new versions of process tamer now revert this back to 200000 for users of prior versions?  im thinking yes.

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #2 on: April 14, 2005, 11:01 PM »
OK, I'm confused.  According to this MSKB article, setting the value of ForegroundLockTimeout to 0 is how you correct issues with windows not taking focus when expected.  But...  I don't think I ever had this problem until the value was set to 0.  Maybe I'm just nuts.

Thanks for the reply.  You replied while I was hacking out my own.   :)
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #3 on: April 14, 2005, 11:09 PM »
yes well,
MS says to set it to 0 to fix problems.
which is what i did.
and it seemed to help.

of course we shouldn't be surprised that given its from MS, it has some side effects.
i guess you were experiencing one of the side effects..
regardless, it's not needed any more by process tamer so i'm removing it.


new version is up on members page.
this version forces the value back to its default of 200000; in a couple more versions i will remove this forcing.

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #4 on: April 14, 2005, 11:12 PM »
I sure wasn't blaming you, no problems on my end...  I could have worked around it by setting it back to 200000 at each shutdown.  :)

I agree that it should be set back to 200000 by PT.  That would probably be appropriate for 99%+ of users.
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #5 on: April 15, 2005, 12:48 AM »
Wait...  I hope you're just setting the ForegroundLockTimeout value once, and not on every run.
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #6 on: April 15, 2005, 01:01 AM »
well in the current version it sets it when (every time) the process tamer tray starts up.
maybe i'll just remove this setting completely from the program and include in the next release 2 little .reg files for people who want to experiment with forcing this value between default value and 0.

war59312

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Will's Blog
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #7 on: April 27, 2005, 04:19 AM »
Glad to see new beta is like that. Since I have no issue. ;)
God Bless America

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #8 on: April 27, 2005, 04:29 AM »
the current version no longer messes with this registry key at all.
and it includes two .reg keys and a little readme for those who want to learn about it and try either setting for other purposes:

"Earlier versions of Process Tamer set the registry value
   HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout to 0
As described by the Microsoft bulletin for more information:
   http://support.micro...oft.com/?kbid=886217
In order to fix a problem where popup windows would lose foreground focus.

Because ProcessTamer now uses baloons to report information, it no longer
 sets this value, and you will find in this directory two registry files,
 which when double clicked will let you set this registry value to wither
 the default value of 200000 or the value described in the windows tweak
 and employed by the original ProcessTamer, 0.

Most people won't care about this or notice any difference, but we are
 providing them for the sake of completeness."


Astara

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #9 on: July 16, 2006, 06:19 PM »
Does anyone know if, or how this value relates to information bubbles that pop up when
hovering over taskbar objects?

My bubbles sometimes get into a mode where they come up behind the taskbar, making
them difficult or impossible to read.

Oddly though, it doesn't happen all the time -- seems to be working ok now, but wasn't last night.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,069
    • View Profile
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #10 on: July 16, 2006, 06:35 PM »
Does anyone know if, or how this value relates to information bubbles that pop up when
hovering over taskbar objects?

My bubbles sometimes get into a mode where they come up behind the taskbar, making
them difficult or impossible to read.

Oddly though, it doesn't happen all the time -- seems to be working ok now, but wasn't last night.

I think that is a bug in windows - the way I get round that is to set windows taskbar not to always be on top - then balloons are on top. I find I can then set the taskbar to be on top again (if that is required) and the balloons still come on top - until the next time.

It is nothing to do with ProcessTamer (I don't have it installed any more since I reinstalled windows but I still get this bug).

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #11 on: July 16, 2006, 07:03 PM »
Wouldn't it be better to set a key on first run and check for that key each time it's run?

something like firstrun = 0

And if that key isn't present, change ForegroundLockTimeout back to 200000 and create the firstrun key so you won't have to change it again next time it's run.

Astara

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #12 on: July 16, 2006, 07:50 PM »
I think that is a bug in windows ...
-Carol Haynes (July 16, 2006, 06:35 PM)

A bug?  In Windows?!?

I'm shocked.

:-)

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,069
    • View Profile
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #13 on: July 16, 2006, 08:30 PM »
LOL - shocking but true ;)

I think the best approach Mouser is to ask if earlier versions have been installed (or detect old INI files) and make the change once only after asking permission or use the registry files as you suggested.

neilw20

  • Participant
  • Joined in 2013
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: ForegroundLockTimeout Value
« Reply #14 on: April 09, 2016, 09:57 AM »
My findings:
I had ForegroundLockoutTimeout set to the default: 200000 -- 200 seconds - Heat your lunch and the problem might change??!!
Using timers is just bad programming MS!!
It all started when double click focus - most annoying - started appearing in programs due to multithreading issues.

Anyway, I have a VB.net program I wrote, and it was getting bigger and taking a while to load.
Thought I would be nice, and put up a splash screen.
After running my program, before the splash screen was added, Alt-F4, correctly, would exit my program.
After the splash screen was added, which took owner ship of the desktop, then disappeared as it got overwritten by my application, as it should
my program did not have focus (for 200 seconds!!) and the Alt-F4 offered to do shutdown!! wtf??

Try running regedit. It sits in the back ground, as do some programs.

HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockoutTimeout = 0 for me.
I made two .reg files, one to set to zero, and one to restore it.

You need to logout and back in for it to take effect.

And then during testing, if my test/program/think time exceeded 200 seconds, then it looked like I had made a mistake, then it sometimes worked again.
Bloody obscure secret timers!!

I spent a lot more than 200 seconds solving my problems, which should never have existed, if VB.net splash screen was implemented correctly.

All comments, good bad and otherwise appreciated.
Neil

---------contents of .reg file to set it to zero, and my saved value. I always put xxx   :D so I can easily find my changes.
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Desktop]
"ForegroundLockoutTimeout"=dword:0
"ForegroundLockoutTimeoutWas00030d40xxx"=dword:00030d40
end ---------

« Last Edit: April 09, 2016, 10:19 AM by neilw20 »