Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. int WS_EX_TOPMOST = 0x00000008;
  6. int GWL_EXSTYLE = -20;
  7. foreach (Process proc in Process.GetProcesses())
  8. {
  9. IntPtr hWnd = proc.MainWindowHandle;
  10. int res = GetWindowLong(hWnd, GWL_EXSTYLE);
  11. if ((res & WS_EX_TOPMOST) == WS_EX_TOPMOST)
  12. {
  13. Console.WriteLine("Topmost window found for process " + proc.ProcessName);
  14. }
  15. }
  16. }
  17.  
  18. [DllImport("user32.dll")]
  19. static extern int GetWindowLong(IntPtr hWnd, int nIndex);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement