Announcement

Collapse
No announcement yet.

what is the way to wakeup my app. after windows wakedup from sleep?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • what is the way to wakeup my app. after windows wakedup from sleep?

    my app. start with windows from start up menu it work good
    it use timer to minimize and restore to system tray
    but
    when windows sleep it stop timers and not work after windows waked up
    any way to push page timer to work after windows waked up from sleep.

  • #2
    Subclass the window with MemoryEx and catch the WM_POWERBROADCAST notification :yes

    Embrace change in your life, you never know, it could all work out for the best

    Comment


    • #3
      thanks but if possible example please .

      Comment


      • #4
        Code:
                      ---On Show
                      WM_POWERBROADCAST = 0x218;
                      WM_DESTROY = 0x0002;
                      PBT_APMPOWERSTATUSCHANGE = 10;
                      PBT_APMRESUMEAUTOMATIC = 18;
                      PBT_APMRESUMESUSPEND = 7;
                      PBT_APMSUSPEND = 4;
                      PBT_POWERSETTINGCHANGE = 32787;
                      local s = Subclass.Create(Application.GetWndHandle(), function(hWnd, uMsg, wParam, lParam)
                        if(uMsg == WM_DESTROY)then
                         Subclass.Remove(Application.GetWndHandle());
                         return 0
                        end
                        if(uMsg == WM_POWERBROADCAST)then
                         if (wParam == PBT_APMPOWERSTATUSCHANGE) then
                         
                         elseif (wParam == PBT_APMRESUMEAUTOMATIC) then
                         
                         elseif (wParam == PBT_APMRESUMESUSPEND) then
                         
                         elseif (wParam == PBT_APMSUSPEND) then
                         
                         elseif (wParam == PBT_POWERSETTINGCHANGE) then
                         
                         end
                        end
                      return Subclass.OldWinProc(hWnd, uMsg, wParam, lParam);
                      end)
        something like that, it just mirrors whats linked to, grab MemoryEx here:

        Comment


        • #5
          full example will be best

          Comment


          • #6
            I did what I could without result . can you help me by full example

            Comment


            • #7
              all work OK but not work when application minimized . and i look for it work in minimized mode .

              Comment


              • #8
                A handle to minimized window is the solve .. how to get it?

                Comment


                • #9
                  Code:
                  Handle = Application.GetWndHandle()

                  Comment


                  • #10
                    not work in minimized to system try

                    Comment


                    • #11
                      my application not receive WM_POWERBROADCAST MSG when it minimized to system tray

                      Comment


                      • #12
                        Create a hidden generic window and hook that to receive desired event

                        or hook desktop window to do that ,but be careful with that because any exception might cause your app to crash or explorer.exe who owns the desktop window

                        you should implement my first advise , this is the way to do it

                        DLLs,Console apps, Shell extensions etc. using that way to catch broadcast messages
                        amsplugins.com Is Closed.

                        Facebook Page

                        Comment


                        • #13
                          how to Create a hidden generic window?

                          Comment

                          Working...
                          X