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
  1. Home
  2. General Programming
  3. C#
  4. Detecting full screen applications

Detecting full screen applications

Scheduled Pinned Locked Moved C#
questiongame-dev
3 Posts 3 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.
  • C Offline
    C Offline
    Cesa37
    wrote on last edited by
    #1

    I have an application that runs in the background and pops up windows with reminders, thing is I don't want it to pop up the windows if I play a full screen game. How can I detect if a full screen application is running?

    P 1 Reply Last reply
    0
    • C Cesa37

      I have an application that runs in the background and pops up windows with reminders, thing is I don't want it to pop up the windows if I play a full screen game. How can I detect if a full screen application is running?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Don't, but take a look at Form.Activate

      L 1 Reply Last reply
      0
      • P PIEBALDconsult

        Don't, but take a look at Form.Activate

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        If you really want this (and I can understand some popups are annoying in the middle of a game), you could use PInvoke to get at EnumWindows, and check if there is any main window with a size equal to the screen size. It may be insufficient for exact size match (e.g. a maximized window is larger than the screen, just check it), and having multiple monitors might also complicate matters. Two prototypes to get you started: /// /// Enumerate all windows, calling a delegate for each of them. /// /// /// /// [DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)] public static extern int EnumWindows(LP_EnumWindowsProc ewp, object lParam); /// /// delegate used for EnumWindows() callback function /// public delegate bool LP_EnumWindowsProc(IntPtr hWnd, int lParam); :) Luc Pattyn

        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