public static List<MEMORY_BASIC_INFORMATION> getPageRanges(WinNT.HANDLE hOtherProcess) { List<MEMORY_BASIC_INFORMATION> ret = new ArrayList<>(); MEMORY_BASIC_INFORMATION mbi; WinBase.SYSTEM_INFO si = new WinBase.SYSTEM_INFO(); Kernel32.INSTANCE.GetSystemInfo(si); Pointer lpMem = si.lpMinimumApplicationAddress; while (pointerToAddress(lpMem) < pointerToAddress(si.lpMaximumApplicationAddress)) { mbi = new MEMORY_BASIC_INFORMATION(); BaseTSD.SIZE_T t = Kernel32.INSTANCE.VirtualQueryEx(hOtherProcess, lpMem, mbi, new BaseTSD.SIZE_T(mbi.size())); if (t.longValue() == 0) { Logger.getLogger(Win32ProcessTools.class.getName()).log(Level.SEVERE, "Cannot get page ranges. Last error:" + Kernel32.INSTANCE.GetLastError()); break; } ret.add(mbi); lpMem = new Pointer(pointerToAddress(mbi.baseAddress) + mbi.regionSize.longValue()); } return ret; }
public static BufferedImage getShellIcon(String path) { SHFILEINFO fi = new SHFILEINFO(); BaseTSD.DWORD_PTR r = Shell32.INSTANCE.SHGetFileInfo(path, 0, fi, fi.size(), Shell32.SHGFI_ICON | Shell32.SHGFI_SMALLICON); if (r.intValue() == 0) { return null; } return iconToImage(fi.hIcon); }
BaseTSD.LONG_PTR GetWindowLongPtr(Pointer hWnd, int index);
BaseTSD.LONG_PTR GetWindowLong(Pointer hWnd, int index);
public BaseTSD.LONG_PTR GetWindowLongPtr(WinDef.HWND hWnd, int nIndex);
public BaseTSD.LONG_PTR SetWindowLongPtr(WinDef.HWND hWnd, int nIndex, Callback callback);
public WinDef.LRESULT CallWindowProc(BaseTSD.LONG_PTR lpPrevWndFunc, WinDef.HWND hWnd, WinDef.UINT Msg, WinDef.WPARAM wParam, WinDef.LPARAM lParam);