diff options
Diffstat (limited to 'installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/Windows/Window.cpp')
-rw-r--r-- | installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/Windows/Window.cpp | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/Windows/Window.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/Windows/Window.cpp new file mode 100644 index 000000000..5f6d2f3e9 --- /dev/null +++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/Windows/Window.cpp @@ -0,0 +1,92 @@ +// Windows/Window.cpp + +#include "StdAfx.h" + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWidgets headers) +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif + +#ifndef _UNICODE +#include "Common/StringConvert.h" +#endif +#include "Windows/Window.h" + +class LockGUI +{ + bool _IsMain; + public: + LockGUI() { + _IsMain = wxThread::IsMain(); + if (!_IsMain) wxMutexGuiEnter(); + } + ~LockGUI() { if (!_IsMain) wxMutexGuiLeave(); } +}; + +namespace NWindows { + +HWND GetDlgItem(HWND dialogWindow, int ControlID) +{ + LockGUI lock; + if (dialogWindow) return dialogWindow->FindWindow(ControlID); + return 0; +} + +void MySetWindowText(HWND wnd, LPCWSTR s) +{ + if (wnd == 0) return; + + LockGUI lock; + + wxString str = s; + /* + int id = wnd->GetId(); + if ( (id != wxID_OK) && (id != wxID_CANCEL) && (id != wxID_HELP) && (id != wxID_YES) && (id != wxID_NO)) + */ + { + wnd->SetLabel(str); + } +} + + bool CWindow::GetText(CSysString &s) + { + wxString str; + { + LockGUI lock; + str = _window->GetLabel(); + } + s = str; + return true; + } + + bool CWindow::IsEnabled() + { + LockGUI lock; + return _window->IsEnabled(); + } +} + +////////////////////////////////// Windows Compatibility +#include <sys/resource.h> + +void Sleep(unsigned millisec) +{ + wxMilliSleep(millisec); +} + +t_processID GetCurrentProcess(void) { + return getpid(); +} + +void SetPriorityClass(t_processID pid , int priority) { + setpriority(PRIO_PROCESS,pid,priority); +} + |