>   
> 
> void CALLBACK HandleWinEvent(HWINEVENTHOOK hook, DWORD event, HWND hwnd, LONG 
> idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) {
> if (event == EVENT_SYSTEM_FOREGROUND) {
>  TCHAR tmp[255];
>  int r = GetClassName(hwnd, tmp, 250);
>  if (wcscmp(tmp, L"WorkerW")==0) {
>  for (int i = 0; i < 10; ++i) { // usually works on first try, but sometimes 
> needs 2 or 3 
>   //SetForegroundWindow(myHandle); //doesn't work on Vista/Win7
>   SetWindowPos(myHandle, (HWND) -1, 0,0,0,0,3);
>   SetWindowPos(myHandle, (HWND) -2, 0,0,0,0,67);
>   if (myHandle == GetForegroundWindow()) break;
>  }
> }
> }
> 
> HWINEVENTHOOK g_hook;
> g_hook = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, 
> NULL, HandleWinEvent,0,0,0);
> ...
> UnhookWinEvent(g_hook);
>


My suggestion is that you write a plugin to do this for you (and anyone else 
that is interested in this type of positioning).

I don't think you can do it in PowerPro scripting completely.



Reply via email to