O
Kurzes Code Beispiel
Wnd = NULL;
hWnd = ::FindWindow(TEXT("TApplication"),TEXT("smartision ScreenCopy"));
if(hWnd){
::SetForegroundWindow(hWnd);
::ShowWindow(hWnd,SW_SHOW);
RECT rect;
::GetWindowRect(hWnd,&rect);
::SetWindowPos(hWnd,HWND_TOPMOST,200,200,0,0,SWP_NOSIZE);
e = GetLastError();
}else{
ShellExecute(NULL,_T("open"),PFAD_BILDSCHRIRM_FOTOGRAFIEREN,_T(""),_T("C:\\Program Files\\ScreenCopy\\"),SW_SHOW | SW_SHOWNORMAL );
hWnd = ::FindWindow(TEXT("TApplication"),TEXT("smartision ScreenCopy"));
if (hWnd)
{
RECT rect;
::GetWindowRect(hWnd,&ttt);
DWORD e;
BOOL erg = ::SetWindowPos(hWnd,HWND_TOPMOST,200,200,0,0,SWP_NOSIZE);//::MoveWindow(hWnd,200,200,500,500,FALSE);
e = GetLastError();
::GetWindowRect(hWnd,&rect);
}
}
Rückgabewert von GetLastError ist 0.
Oli_1977