Patch level : 12.0 644
Files correlati : ba7.exe Commento : Aggiunta funzione per rivelvare se la taskbar è visibile
This commit is contained in:
parent
1ba75cc8f2
commit
ffe1040fe5
@ -1085,7 +1085,7 @@ bool Win32ProgressIndicator::SetProgress(long nCurrent, long nTotal)
|
|||||||
{
|
{
|
||||||
const int nSpeed = nCurrent / nSec > 0 ? nCurrent / nSec : 1;
|
const int nSpeed = nCurrent / nSec > 0 ? nCurrent / nSec : 1;
|
||||||
const int nRemaining = nTotal - nCurrent;
|
const int nRemaining = nTotal - nCurrent;
|
||||||
const int remainingTime = nRemaining / nSpeed;
|
const int remainingTime = nSpeed > 0 ? nRemaining / nSpeed : 0;
|
||||||
int s = nSec;
|
int s = nSec;
|
||||||
const int h = s / 3600; s %= 3600;
|
const int h = s / 3600; s %= 3600;
|
||||||
const int m = s / 60; s %= 60;
|
const int m = s / 60; s %= 60;
|
||||||
@ -1243,3 +1243,23 @@ void OsWin32_ProgressSetText(WXHWND prog, const char* msg)
|
|||||||
pd->SetText(msg);
|
pd->SetText(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OsWin32_IsdTaskbarVisible()
|
||||||
|
{
|
||||||
|
HWND hTaskbarWnd = FindWindow("Shell_TrayWnd", NULL);
|
||||||
|
HMONITOR hMonitor = MonitorFromWindow(hTaskbarWnd, MONITOR_DEFAULTTONEAREST);
|
||||||
|
MONITORINFO info = { sizeof(MONITORINFO) };
|
||||||
|
|
||||||
|
if (GetMonitorInfo(hMonitor, &info))
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
GetWindowRect(hTaskbarWnd, &rect);
|
||||||
|
|
||||||
|
if ((rect.top >= info.rcMonitor.bottom - 4) ||
|
||||||
|
(rect.right <= 2) ||
|
||||||
|
(rect.bottom <= 4) ||
|
||||||
|
(rect.left >= info.rcMonitor.right - 2))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (IsWindowVisible(hTaskbarWnd));
|
||||||
|
|
||||||
|
}
|
@ -35,6 +35,8 @@ void OsWin32_ProgressDestroy(WXHWND hProgDlg);
|
|||||||
bool OsWin32_ProgressSetStatus(WXHWND hProgDlg, long nCurrent, long nTotal);
|
bool OsWin32_ProgressSetStatus(WXHWND hProgDlg, long nCurrent, long nTotal);
|
||||||
void OsWin32_ProgressSetText(WXHWND hProgDlg, const char* msg);
|
void OsWin32_ProgressSetText(WXHWND hProgDlg, const char* msg);
|
||||||
|
|
||||||
|
bool OsWin32_IsdTaskbarVisible();
|
||||||
|
|
||||||
//#define SPEECH_API 1
|
//#define SPEECH_API 1
|
||||||
#ifdef SPEECH_API
|
#ifdef SPEECH_API
|
||||||
bool OsWin32_InitializeSpeech();
|
bool OsWin32_InitializeSpeech();
|
||||||
|
@ -3179,6 +3179,18 @@ SLIST_ELT xvt_slist_get_next(SLIST list, SLIST_ELT item)
|
|||||||
return (SLIST_ELT)(list != NULL && item != NULL ? item->next : NULL);
|
return (SLIST_ELT)(list != NULL && item != NULL ? item->next : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SLIST_ELT xvt_slist_find_str(SLIST list, const char* str) // Cerca una stringa all'interno di una SLIST
|
||||||
|
{
|
||||||
|
SLIST_ELT e = NULL;
|
||||||
|
for (e = xvt_slist_get_first(list); e; e = xvt_slist_get_next(list, e))
|
||||||
|
{
|
||||||
|
const char* val = xvt_slist_get(list, e, NULL);
|
||||||
|
if (xvt_str_compare_ignoring_case(str, val) == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// XVT Strings???
|
// XVT Strings???
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -3911,6 +3923,25 @@ BOOLEAN xvt_fsys_rename_file(const char *src_pathname, const char *dst_pathname)
|
|||||||
return wxRenameFile(src_pathname, dst_pathname);
|
return wxRenameFile(src_pathname, dst_pathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN xvt_fsys_fupdate(const char* src, const char* dst) // Aggiorna il file dst se più vecchio di src
|
||||||
|
{
|
||||||
|
bool ok = false;
|
||||||
|
if (xvt_fsys_file_exists(src))
|
||||||
|
{
|
||||||
|
const long tsrc = xvt_fsys_file_attr(src, XVT_FILE_ATTR_MTIME);
|
||||||
|
if (tsrc > 0)
|
||||||
|
{
|
||||||
|
long tdst = 0;
|
||||||
|
if (xvt_fsys_file_exists(dst))
|
||||||
|
tdst = xvt_fsys_file_attr(dst, XVT_FILE_ATTR_MTIME);
|
||||||
|
if (tsrc > tdst)
|
||||||
|
ok = xvt_fsys_fcopy(src, dst) != 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Timers
|
// Timers
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -4559,6 +4590,15 @@ void xvt_win_trap_pointer(WINDOW win)
|
|||||||
_mouse_trapper = &w;
|
_mouse_trapper = &w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN xvt_win_is_taskbar_visible()
|
||||||
|
{
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
return OsWin32_IsdTaskbarVisible();
|
||||||
|
#else
|
||||||
|
return OsLinux_IsdTaskbarVisible();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Status bar
|
// Status bar
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user