codyj110
June 5th, 2014, 01:16 AM
Ok so I had to do a little fiddling around with this function and noticed almost no were on the internet is there a good example of working code.
#include <windows.h>
#include <winuser.h>
using namespace std;
int main()
{
HWND hWnd = FindWindow(L"SciCalc",0);
SetForegroundWindow(hWnd);
}
SciCalc is the classname of windows calculator. To find the class name of a window download WinSpy++. You will need to add L in front of any string you want to use in arguments.
#include <windows.h>
#include <winuser.h>
using namespace std;
int main()
{
HWND hWnd = FindWindow(L"SciCalc",0);
SetForegroundWindow(hWnd);
}
SciCalc is the classname of windows calculator. To find the class name of a window download WinSpy++. You will need to add L in front of any string you want to use in arguments.