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#
  4. Does C# contain shell programming?

Does C# contain shell programming?

Scheduled Pinned Locked Moved C#
questioncsharpc++linux
5 Posts 4 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.
  • T Offline
    T Offline
    T i T i
    wrote on last edited by
    #1

    I want to know does C# supports shell programming or not? in other words ,I want to no. of the already opened windows or applications in the operataing system...So my question is : Is there is a way to do that with c# or only C++? and if so ,HOW? thank you for helping

    M H 2 Replies Last reply
    0
    • T T i T i

      I want to know does C# supports shell programming or not? in other words ,I want to no. of the already opened windows or applications in the operataing system...So my question is : Is there is a way to do that with c# or only C++? and if so ,HOW? thank you for helping

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      T i T i wrote: want to know does C# supports shell programming or not? It does. Search in C# section shell programming and you wuill find sme articles there. Mazy "A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope

      1 Reply Last reply
      0
      • T T i T i

        I want to know does C# supports shell programming or not? in other words ,I want to no. of the already opened windows or applications in the operataing system...So my question is : Is there is a way to do that with c# or only C++? and if so ,HOW? thank you for helping

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        Getting the open windows has nothing to do with the shell - that's a function of the window manager. You can use System.Diagnostics.Process.GetProcesses to get a Process[] array. To determine which running processes are window applications, enumerate the array and check Process.MainWindowHandle to determine if it is IntPtr.Zero (not a window application) or not (a window application).

        Microsoft MVP, Visual C# My Articles

        S 1 Reply Last reply
        0
        • H Heath Stewart

          Getting the open windows has nothing to do with the shell - that's a function of the window manager. You can use System.Diagnostics.Process.GetProcesses to get a Process[] array. To determine which running processes are window applications, enumerate the array and check Process.MainWindowHandle to determine if it is IntPtr.Zero (not a window application) or not (a window application).

          Microsoft MVP, Visual C# My Articles

          S Offline
          S Offline
          SherKar
          wrote on last edited by
          #4

          but this code is good to get the process not the applications so if the opened windows ("c:","MyComputer")only one process will appear under the name of Explorer so wt can we do ??

          H 1 Reply Last reply
          0
          • S SherKar

            but this code is good to get the process not the applications so if the opened windows ("c:","MyComputer")only one process will appear under the name of Explorer so wt can we do ??

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            If you have the option set in Windows Explorer for each window to be opened in a separate process, this will work. If not, you'll have to P/Invoke EnumWindows and create an EnumWindowsProc delegate (not necessarily by name but by signature). There's already been several articles outlining this here on CodeProject, so instead of explaining it just see the highlighted portions of Window Hiding with C#[^].

            Microsoft MVP, Visual C# My Articles

            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