Corretta ricerca finesta __CAMPO_HOST_WINDOW__

git-svn-id: svn://10.65.10.50/branches/R_10_00@22803 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2013-02-12 16:52:35 +00:00
parent ad139bbae4
commit 0a34205cad
2 changed files with 3 additions and 32 deletions

View File

@ -656,11 +656,10 @@ static BOOL CALLBACK EnumCampoMenuChildrenProc(HWND hwnd, LPARAM lParam)
char str[_MAX_PATH]; char str[_MAX_PATH];
if (::GetWindowText(hwnd, str, sizeof(str))) if (::GetWindowText(hwnd, str, sizeof(str)))
{ {
const wxString title = str; if (strstr(str, " - ") != NULL)
if (title.StartsWith("Base - ")) // Scandisco solo i figli del menu
{ {
::EnumChildWindows(hwnd, EnumCampoChildrenProc, lParam);
const TFindWindowInfo* w = (TFindWindowInfo*)lParam; const TFindWindowInfo* w = (TFindWindowInfo*)lParam;
::EnumChildWindows(hwnd, EnumCampoChildrenProc, lParam);
if (w->_hwnd != NULL) if (w->_hwnd != NULL)
return FALSE; // Fine della ricerca return FALSE; // Fine della ricerca
} }
@ -668,9 +667,6 @@ static BOOL CALLBACK EnumCampoMenuChildrenProc(HWND hwnd, LPARAM lParam)
return TRUE; // Continua a cercare return TRUE; // Continua a cercare
} }
#include <psapi.h>
#include <tlhelp32.h>
unsigned int OsWin32_FindMenuContainer() unsigned int OsWin32_FindMenuContainer()
{ {
wxString strApp; wxString strApp;
@ -678,31 +674,6 @@ unsigned int OsWin32_FindMenuContainer()
strApp.MakeLower(); strApp.MakeLower();
if (strApp == "ba0" || strApp == "ba1" || strApp == "ba7") if (strApp == "ba0" || strApp == "ba1" || strApp == "ba7")
return 0; // Special programs that can't be hosted by ba0 return 0; // Special programs that can't be hosted by ba0
const DWORD pid = ::GetCurrentProcessId();
HANDLE h = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32 pe = { 0 }; pe.dwSize = sizeof(PROCESSENTRY32);
DWORD ppid = 0;
for(BOOL ok = ::Process32First(h, &pe); ok; ok = ::Process32Next(h, &pe))
{
if (pe.th32ProcessID == pid)
{
ppid = pe.th32ParentProcessID;
break;
}
}
::CloseHandle(h);
char strParentPath[_MAX_PATH] = "";
HMODULE m = (HMODULE)::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, ppid);
::GetModuleFileNameEx(m, 0, strParentPath, sizeof(strParentPath) - 1);
::CloseHandle(m);
wxFileName::SplitPath(strParentPath, NULL, &strApp, NULL);
strApp.MakeLower();
if (strApp != "ba0")
return 0; // Parent process is not ba0
TFindWindowInfo w; TFindWindowInfo w;
w._file = "__CAMPO_HOST_WINDOW__"; w._file = "__CAMPO_HOST_WINDOW__";

View File

@ -667,7 +667,7 @@ RCT* xvt_print_get_next_band(void)
return NULL; return NULL;
const TwxPrintOut& po = m_PrintoutCache.Get(NULL); const TwxPrintOut& po = m_PrintoutCache.Get(NULL);
int w, h; int w = 0, h = 0;
po.GetPageSizePixels(&w, &h); po.GetPageSizePixels(&w, &h);
rct.left = rct.top = 0; rct.left = rct.top = 0;
rct.right = w; rct.right = w;