Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GetDesktopWindow() and Window Hooks

GetDesktopWindow() and Window Hooks

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialc++question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Madhu_Rani
    wrote on last edited by
    #1

    I am capturing the screen by using GetDesktopWindow(). Now I want that when ever desktop (captured screen)changes/updates, I get the information, so that I would capture it again. I have heard the word " window hooks" but do not know how to apply it. please guide? The application is MFC based.

    A 1 Reply Last reply
    0
    • M Madhu_Rani

      I am capturing the screen by using GetDesktopWindow(). Now I want that when ever desktop (captured screen)changes/updates, I get the information, so that I would capture it again. I have heard the word " window hooks" but do not know how to apply it. please guide? The application is MFC based.

      A Offline
      A Offline
      Adam Roderick J
      wrote on last edited by
      #2

      use the SetWindowsHookEx with WH_GETMESSAGE will be helpful For more info refer. http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx[^]

      Величие не Бога может быть недооценена.

      M 2 Replies Last reply
      0
      • A Adam Roderick J

        use the SetWindowsHookEx with WH_GETMESSAGE will be helpful For more info refer. http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx[^]

        Величие не Бога может быть недооценена.

        M Offline
        M Offline
        Madhu_Rani
        wrote on last edited by
        #3

        LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { int x=12; if (nCode==HCBT_MINMAX) { AfxMessageBox(_T("Called")); } return 0; } CSDITESTView::CSDITESTView() { SetWindowsHookEx(WH_CBT,&CBTProc,NULL,0); } After reading the mentioned article, I wrote these lines, but it is not working? I am expecting that when I minimize the window , the associated call back function should be called.

        1 Reply Last reply
        0
        • A Adam Roderick J

          use the SetWindowsHookEx with WH_GETMESSAGE will be helpful For more info refer. http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx[^]

          Величие не Бога может быть недооценена.

          M Offline
          M Offline
          Madhu_Rani
          wrote on last edited by
          #4

          LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { int x=12; if (nCode==HCBT_MINMAX) { AfxMessageBox(_T("Called")); } return 0; } CSDITESTView::CSDITESTView() { SetWindowsHookEx(WH_CBT,&CBTProc,NULL,0); } After reading the mentioned article, I wrote these lines, but it is not working? I am expecting that when I minimize the window , the associated call back function should be called.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups