From 0a34205cad57162627090d5df350e667eea32b2d Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 12 Feb 2013 16:52:35 +0000 Subject: [PATCH] Corretta ricerca finesta __CAMPO_HOST_WINDOW__ git-svn-id: svn://10.65.10.50/branches/R_10_00@22803 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/oswin32.cpp | 33 ++------------------------------- xvaga/xvtextra.cpp | 2 +- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/xvaga/oswin32.cpp b/xvaga/oswin32.cpp index 55982d5a1..627ee827c 100755 --- a/xvaga/oswin32.cpp +++ b/xvaga/oswin32.cpp @@ -656,11 +656,10 @@ static BOOL CALLBACK EnumCampoMenuChildrenProc(HWND hwnd, LPARAM lParam) char str[_MAX_PATH]; if (::GetWindowText(hwnd, str, sizeof(str))) { - const wxString title = str; - if (title.StartsWith("Base - ")) // Scandisco solo i figli del menu + if (strstr(str, " - ") != NULL) { - ::EnumChildWindows(hwnd, EnumCampoChildrenProc, lParam); const TFindWindowInfo* w = (TFindWindowInfo*)lParam; + ::EnumChildWindows(hwnd, EnumCampoChildrenProc, lParam); if (w->_hwnd != NULL) return FALSE; // Fine della ricerca } @@ -668,9 +667,6 @@ static BOOL CALLBACK EnumCampoMenuChildrenProc(HWND hwnd, LPARAM lParam) return TRUE; // Continua a cercare } -#include -#include - unsigned int OsWin32_FindMenuContainer() { wxString strApp; @@ -678,31 +674,6 @@ unsigned int OsWin32_FindMenuContainer() strApp.MakeLower(); if (strApp == "ba0" || strApp == "ba1" || strApp == "ba7") 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; w._file = "__CAMPO_HOST_WINDOW__"; diff --git a/xvaga/xvtextra.cpp b/xvaga/xvtextra.cpp index 9653924ca..ad184c418 100755 --- a/xvaga/xvtextra.cpp +++ b/xvaga/xvtextra.cpp @@ -667,7 +667,7 @@ RCT* xvt_print_get_next_band(void) return NULL; const TwxPrintOut& po = m_PrintoutCache.Get(NULL); - int w, h; + int w = 0, h = 0; po.GetPageSizePixels(&w, &h); rct.left = rct.top = 0; rct.right = w;