LBCService icon indicating copy to clipboard operation
LBCService copied to clipboard

Remember backlight state on wake not working

Open prat89 opened this issue 4 years ago • 11 comments

Seems that "Remember backlight state on wake" does not work on my ThinkPad X1 Extreme Gen2, Windows 10 64-bit. I can provide some more details - just tell me how.

prat89 avatar May 12 '20 19:05 prat89

Seems that I'm getting mixed results for the same HandlerCallback although I did not change any settings ("Remember backlight state on wake" disabled).

2020-05-13 20:11:40 - HandlerCallback(control:13, eventType:32787, eventData:8393460, context: 0) 2020-05-13 20:11:40 - Detected system resume but backlight state option enabled, not activating. 2020-05-14 07:37:49 - HandlerCallback(control:13, eventType:32787, eventData:8393460, context: 0) 2020-05-14 07:37:49 - Detected system resume. Activating backlight. 2020-05-14 07:37:50 - Starting new PipeServer.

prat89 avatar May 14 '20 05:05 prat89

Occasionally I'm also getting this .NET Framework error:

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at LBCServiceSettings.SettingsForm.HideSettingsForm() at LBCServiceSettings.SettingsForm.OnFormClosing(FormClosingEventArgs e) at System.Windows.Forms.Form.WmClose(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

LBCServiceSettings Assembly Version: 1.5.0.0 Win32 Version: 1.5.0.0 CodeBase: file:///C:/Program%20Files/LBCService/LBCServiceSettings.exe

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.ServiceProcess Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceProcess/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

prat89 avatar May 14 '20 08:05 prat89

I just updated it again, using the old code (jjb666 branch). I believe I worked out a way to stop the service from crashing. It may also resolve your "Remember State" issue as well. Try the new build and let me know.

JooJooBee666 avatar May 22 '20 15:05 JooJooBee666

Seems like the backlight state is now remember even without "remember state" option checked. However every time I'm trying to shut down I'm getting the message "Microsoft .NET Framework is preventing the system from shutdown." Not sure if that's .NET Framework issue or LBCService issue.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at LBCServiceSettings.SettingsForm.HideSettingsForm() at LBCServiceSettings.SettingsForm.OnFormClosing(FormClosingEventArgs e) at System.Windows.Forms.Form.WmClose(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

LBCServiceSettings Assembly Version: 1.6.0.0 Win32 Version: 1.6.0.0 CodeBase: file:///C:/Program%20Files/LBCService/LBCServiceSettings.exe

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.ServiceProcess Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceProcess/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.8.3752.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

prat89 avatar May 22 '20 18:05 prat89

Ok, so I played with it a little and:

  • when "Remember backlight state on wake" is UNchecked the backlight state actually IS remembered but every time I'm trying to shut down the system I'm getting this ".NET Framework is preventing from shutdown" message and it won't shut down until I click "Continue Anyway".
  • when "Remember backlight state on wake" is CHECKED the backlight state actually IS NOT remembered however I do not have any issues with shutting down. That's quite surprising and contradictory but that's the way it is. Please let me know if you require any further logs.

prat89 avatar May 22 '20 19:05 prat89

Meh....don't bother, it's still crashing. I'm pulling the release for now.

JooJooBee666 avatar May 23 '20 11:05 JooJooBee666

Just wanted to ask if you're going to try to make it work. If yes, would you know when we can expect new release?

prat89 avatar Jun 08 '20 19:06 prat89

Hi, any chance for the new release?

prat89 avatar Dec 10 '20 15:12 prat89

New release is up. I added some code to help with crashing but I'm not certain. Let me know if you still have the same issue.

JooJooBee666 avatar Jan 03 '21 21:01 JooJooBee666

Hi JooJooBee666,

Great work on this.

I'm currently using v1.7.0.0. I have some information you may or may not know about why I think the .NET crashes when the laptop is shutdown or rebooted. I've noticed that the "LBCServiceSettings.exe" is showing up in the "Apps" section on Task Manager, not sure why this is. When it shows here .NET crashes every time when the laptop is rebooting or shutting down. However, if you right click the the LB Settings in the hidden icons on the taskbar and click on settings, then close the settings when the app pops up, this is now not showing in in the "Apps" section on Task Manager. This then stops the .NET crashing when the laptop is rebooting or shutting down. I'm not sure how to fix this, but hopefully this helps and you may be able to fix it.

Thanks for your hard work on this, it's a great app.

styoda avatar May 03 '21 14:05 styoda

I also had some .NET errors. Especially when trying to save changes, I'm now running the application as admin (right click on the LBCSerivceSettings.exe under C:\Program Files -> Compaility -> Change settings for all users -> Run as administrator). I have no more .NET errors.

However, I can confirm what styoda is stating; when UNcheck the remember setting, the state is actually remembered which is not the case when it's checked.

Nevertheless, this is the only application I got the backlight to to turn on on each sign-in and wake-up. Nice work! :)

LufinityLucas avatar Dec 09 '21 21:12 LufinityLucas