I'm trying to write a piece of code to minimize an application based on the text displaying in the title bar (any application running on the system, not just my own). I've been able to perform the task in an AHK but the desired result isn't ideal and I'd definitely rather it be an active piece of my application then an external one. The AHK is:
#Persistent
#SingleInstance
SetTimer, NoCashierOrHEM, 300
return
NoCashierOrHEM:
IfWinExist , Cashier
WinClose , Cashier
IfWinExist , Hold’em + Omaha Manager
WinMinimize , Hold’em + Omaha Manager
return
Which will minimize any window that has the title bar "Hold'em + Omaha Manager" and close any window that has the title "Cashier". What direction should I be looking in for solving this problem in C#?