Is it possible to change the sequence of application windows in c #, for example, an event has occurred in the application and its window in relation to other applications becomes the main in Win.

  • Do you mean change the order of the windows ? - VladD
  • When an event fires, move the focus to the desired window - Alexsandr Ter
  • Nene in the Wndows itself between applications - SergD29
  • And you can "expand" the idea that you want to implement? and which UI: WinForms or WPF? - rdorn

1 answer 1

For c ++ it would be like this: First you need to get the window identifier:

HWND hWnd = FindWindow(NULL, "Untitled - Notepad"); 

Then pass this identifier to the function:

 SetActiveWindow(hWnd); 
  • You are not mistaken language? - VladD
  • Should I have been wrong? You are not familiar with WinAPI? - LionisIAm
  • Why same, sign. Are you familiar with C #? - VladD
  • I assumed that I was acquainted) I see that you are more experienced on SO, explain what is wrong? - LionisIAm
  • Well, in C # you cannot use #include , and it is not compatible with C ++ from source. Therefore, there is no type HWND (and it can not be connected). And functions from WinAPI are connected through interop . - VladD