X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FWin32.cc;h=28023a1d7b1a4b78cdf750947aebe9d36f4bd699;hb=38c7cb80528704b6771220448f36da4199f66453;hp=195171b0d0b007e06193d88cfe33b5b73cdea628;hpb=8f64b15c136ba9040fbf03f69604477c53795af3;p=org.ibex.core.git diff --git a/src/org/xwt/plat/Win32.cc b/src/org/xwt/plat/Win32.cc index 195171b..28023a1 100644 --- a/src/org/xwt/plat/Win32.cc +++ b/src/org/xwt/plat/Win32.cc @@ -236,6 +236,17 @@ void org::xwt::plat::Win32::natInit() { // Platform Methods /////////////////////////////////////////////////////////////////// +jstring org::xwt::plat::Win32::_getEnv(jstring key) { + int len = JvGetStringUTFLength(key); + char buf[len + 1]; + JvGetStringUTFRegion(key, 0, len, buf); + buf[len] = '\0'; + char buf2[1024]; + DWORD ret = GetEnvironmentVariable(buf, buf2, 1024); + if (ret > 0 && ret < 1024) return JvNewStringLatin1(buf2); + return NULL; +} + jstring org::xwt::plat::Win32::_fileDialog(jstring suggestedFileName, jboolean write) { char buf[1024]; @@ -602,7 +613,7 @@ void org::xwt::plat::Win32$Win32Surface::natInit(jboolean framed) { hdc = (jint)GetDC((HWND)hwnd); } -void org::xwt::plat::Win32$Win32Surface::finalize() { /* DeleteObject((void*)hwnd); */ } +void org::xwt::plat::Win32$Win32Surface::finalize() { DeleteObject((void*)hwnd); } void org::xwt::plat::Win32$Win32Surface::toFront() { BringWindowToTop((HWND)hwnd); } void org::xwt::plat::Win32$Win32Surface::toBack() { SetWindowPos((HWND)hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); } void org::xwt::plat::Win32$Win32Surface::_dispose() { PostMessage((HWND)hwnd, WM_USER_DISPOSE, 0, 0); }