Results 1 to 10 of 10

Thread: Lid Problem

  1. #1

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,480

    Lid Problem

    Oh !

    I thought I'd fixed the problem with the non starting of the applications in my startup folder. (My previous thread).

    Yes they work when I do a start or restart, but not when the laptop wakes up from sleep or hibernation.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,968

    Re: Lid Problem

    https://superuser.com/questions/1662...s-task-on-wake

    Schedule a task to be executed on "Wake Up"-Event, executing a bat-file running your Programs in the StartUp-Folder.

    That said: Are those Programs a "onetime-Run" Programs, or are they like "services"?
    because if they are like services (running as long the computer is on), they should still be "running" after wake-up
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  3. #3

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,480

    Re: Lid Problem

    Thanks Zvoni,

    Two are 'Service' type app's (single instance, so can't be started twice) and two are 'Run once and stop'. The 'Service' types do continue running after a wake up, the others need to run at wake up as well but don't. All app's run at start and restart.
    .
    Making a .bat file is easy enough I used to do that quite often, but I don't remember how to start an application using one.

    This version of Windows 10 seems to be lacking a lot of stuff I expect to be there, including the ability to schedule a task.
    App's in the Startup folder should run at wake up too, they always have previously in Windows, including Windows 10.

    I think Microsoft are trying to force us to use Windows 11. I suspect I'd find similar problems in that too.

    The annoying thing is that we bought a much cheaper Windows 10 laptop for my wife at the same time and everything works as expected on that one.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  4. #4
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,148

    Re: Lid Problem

    To run a program at sleep or hibernate resume, use Task Scheduler. For each program you want to create a task that executes that program when the required trigger occurs. For an example for resuming from hibernate see:
    https://learn.microsoft.com/en-us/an...r-comes-out-of

    Any event that occurs in the system log can be used for a trigger.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  5. #5

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,480

    Re: Lid Problem

    This version of Windows 10 does not have a Task Scheduler !

    I'm currently writing a new version of the application to incorporate the extra commands which are ignored in the Startup folder.

    Poppa
    Along with the sunshine there has to be a little rain sometime.

  6. #6
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,469

    Re: Lid Problem


  7. #7
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,148

    Re: Lid Problem

    What version of Windows 10 are you using?

    To open the task Scheduler you should be able to
    Press Windows key + R at the same time. Then, type taskschd.msc
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  8. #8

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,480

    Re: Lid Problem

    Thanks 2kaud,
    That was very useful and seems to work, I don't actually have time to try using it at the moment, but it does pull up the scheduler.

    Didn't find that anywhere else on line.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  9. #9
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,819

    Re: Lid Problem

    Since this is a programming forum and all, you can write your own program to do things when the lid opens or closes. You can monitor it using the RegisterPowerSettingNotification API with GUID_LIDSWITCH_STATE_CHANGE.

    I have a twinBASIC sample of how to use this API on GitHub. (tB is VB6 backwards compatible, if you haven't been following the classic VB forum).

    https://github.com/fafalone/clsPresenceMon

  10. #10

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,480

    Re: Lid Problem

    I've got rid of the lid problem with the new lapyop... I've dumped the laptop.

    Pop.
    Along with the sunshine there has to be a little rain sometime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width