mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 02:40:45 +00:00
Added: #289 Support for Aero Snap on Windows
This commit is contained in:
@@ -111,6 +111,7 @@ import com.jpexs.decompiler.flash.gui.SearchInMemory;
|
||||
import com.jpexs.decompiler.flash.gui.SearchInMemoryListener;
|
||||
import com.jpexs.decompiler.flash.gui.SwfInMemory;
|
||||
import com.jpexs.decompiler.flash.gui.helpers.CheckResources;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import com.jpexs.decompiler.flash.gui.translator.Translator;
|
||||
import com.jpexs.decompiler.flash.helpers.FileTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin;
|
||||
@@ -190,7 +191,6 @@ import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import com.jpexs.process.Process;
|
||||
import com.jpexs.process.ProcessTools;
|
||||
import com.sun.jna.Platform;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import gnu.jpdf.PDFGraphics;
|
||||
import gnu.jpdf.PDFJob;
|
||||
import java.awt.Font;
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.console;
|
||||
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.WString;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Advapi32Util;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.SHELLEXECUTEINFO;
|
||||
@@ -26,6 +23,9 @@ import com.jpexs.decompiler.flash.gui.jna.platform.win32.Shell32;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Win32Exception;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinUser;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.WString;
|
||||
import java.io.File;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -107,9 +107,9 @@ public class ContextMenuTools {
|
||||
registryDeleteKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "Applications\\" + exeName + "\\shell\\open\\command");
|
||||
registryDeleteKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "Applications\\" + exeName + "\\shell\\open");
|
||||
registryDeleteKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "Applications\\" + exeName + "\\shell");
|
||||
registryDeleteKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "Applications\\" + exeName);
|
||||
registryDeleteKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "Applications\\" + exeName);
|
||||
}
|
||||
|
||||
|
||||
for (String ext : extensions) {
|
||||
|
||||
// 1) Add to context menu of SWF
|
||||
@@ -124,9 +124,8 @@ public class ContextMenuTools {
|
||||
Advapi32Util.registryCreateKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + clsName);
|
||||
Advapi32Util.registrySetStringValue(REG_CLASSES_HKEY, REG_CLASSES_PATH + clsName, "", "Flash Movie");
|
||||
}
|
||||
|
||||
|
||||
//Open with per extension
|
||||
|
||||
exists = Advapi32Util.registryKeyExists(REG_CLASSES_HKEY, REG_CLASSES_PATH + "." + ext + "\\OpenWithList\\" + exeName);
|
||||
if ((!exists) && add) { //add
|
||||
Advapi32Util.registryCreateKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "." + ext + "\\OpenWithList\\" + exeName);
|
||||
@@ -134,7 +133,7 @@ public class ContextMenuTools {
|
||||
if (exists && (!add)) { //remove
|
||||
registryDeleteKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "." + ext + "\\OpenWithList\\" + exeName);
|
||||
}
|
||||
|
||||
|
||||
if (add) {
|
||||
Advapi32Util.registrySetStringValue(REG_CLASSES_HKEY, clsName, verb);
|
||||
}
|
||||
@@ -175,8 +174,8 @@ public class ContextMenuTools {
|
||||
}
|
||||
if (add) {
|
||||
Advapi32Util.registrySetStringValue(REG_CLASSES_HKEY, REG_CLASSES_PATH + "SystemFileAssociations\\." + ext + "\\Shell\\" + verb, "", verbName);
|
||||
Advapi32Util.registrySetStringValue(REG_CLASSES_HKEY, REG_CLASSES_PATH + "SystemFileAssociations\\." + ext + "\\Shell\\" + verb + "\\Command", "", "\"" + appDir + exeName + "\" \"%1\"");
|
||||
Advapi32Util.registrySetStringValue(REG_CLASSES_HKEY, REG_CLASSES_PATH + "SystemFileAssociations\\." + ext + "\\Shell\\" + verb, "MUIVerb", "@" + appDir + exeName + ",-" + muiVerbCode);
|
||||
Advapi32Util.registrySetStringValue(REG_CLASSES_HKEY, REG_CLASSES_PATH + "SystemFileAssociations\\." + ext + "\\Shell\\" + verb + "\\Command", "", "\"" + appDir + exeName + "\" \"%1\"");
|
||||
Advapi32Util.registrySetStringValue(REG_CLASSES_HKEY, REG_CLASSES_PATH + "SystemFileAssociations\\." + ext + "\\Shell\\" + verb, "MUIVerb", "@" + appDir + exeName + ",-" + muiVerbCode);
|
||||
}
|
||||
if (exists && (!add)) { //remove
|
||||
registryDeleteKey(REG_CLASSES_HKEY, REG_CLASSES_PATH + "SystemFileAssociations\\." + ext + "\\Shell\\" + verb + "\\Command");
|
||||
|
||||
@@ -50,6 +50,8 @@ import com.jpexs.decompiler.flash.gui.debugger.DebugAdapter;
|
||||
import com.jpexs.decompiler.flash.gui.debugger.DebugLoaderDataModified;
|
||||
import com.jpexs.decompiler.flash.gui.debugger.DebuggerTools;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Advapi32Util;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg;
|
||||
import com.jpexs.decompiler.flash.gui.pipes.FirstInstance;
|
||||
import com.jpexs.decompiler.flash.gui.soleditor.CookiesChangedListener;
|
||||
import com.jpexs.decompiler.flash.gui.soleditor.SharedObjectsStorage;
|
||||
@@ -82,8 +84,6 @@ import com.jpexs.helpers.Stopwatch;
|
||||
import com.jpexs.helpers.streams.SeekableInputStream;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import com.sun.jna.Platform;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg;
|
||||
import java.awt.Component;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
@@ -151,7 +151,6 @@ import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingWorker;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
import javax.swing.WindowConstants;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
import javax.swing.tree.TreePath;
|
||||
import jsyntaxpane.DefaultSyntaxKit;
|
||||
|
||||
@@ -18,8 +18,16 @@ package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Dwmapi;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.User32;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinUser;
|
||||
import com.jpexs.decompiler.flash.treeitems.OpenableList;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@@ -28,6 +36,7 @@ import java.awt.Frame;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Window;
|
||||
@@ -36,24 +45,16 @@ import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.plaf.RootPaneUI;
|
||||
import org.pushingpixels.flamingo.api.ribbon.JRibbon;
|
||||
import org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
import org.pushingpixels.substance.api.SubstanceColorScheme;
|
||||
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
|
||||
import org.pushingpixels.substance.flamingo.ribbon.ui.SubstanceRibbonRootPaneUI;
|
||||
import org.pushingpixels.substance.internal.utils.SubstanceCoreUtilities;
|
||||
import org.pushingpixels.substance.internal.utils.SubstanceTitleButton;
|
||||
import org.pushingpixels.substance.internal.utils.icon.SubstanceIconFactory;
|
||||
import org.pushingpixels.substance.internal.utils.icon.TransitionAwareIcon;
|
||||
import org.pushingpixels.substance.internal.utils.SubstanceSizeUtils;
|
||||
|
||||
/**
|
||||
* @author JPEXS
|
||||
@@ -66,7 +67,6 @@ public final class MainFrameRibbon extends AppRibbonFrame {
|
||||
|
||||
public MainFrameRibbon() {
|
||||
super();
|
||||
|
||||
|
||||
Container cnt = getContentPane();
|
||||
cnt.setLayout(new BorderLayout());
|
||||
@@ -181,70 +181,175 @@ public final class MainFrameRibbon extends AppRibbonFrame {
|
||||
}
|
||||
});
|
||||
|
||||
View.centerScreenMain(this);
|
||||
/*addWindowListener(new WindowAdapter() {
|
||||
View.centerScreenMain(this);
|
||||
|
||||
enableAeroSnap();
|
||||
}
|
||||
|
||||
private void enableAeroSnap() {
|
||||
if (!Platform.isWindows()) {
|
||||
return;
|
||||
}
|
||||
Point posOnScreen = new Point();
|
||||
addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e) {
|
||||
update();
|
||||
}
|
||||
|
||||
private void update() {
|
||||
if (MainFrameRibbon.this.isVisible()) {
|
||||
posOnScreen.x = MainFrameRibbon.this.getLocationOnScreen().x;
|
||||
posOnScreen.y = MainFrameRibbon.this.getLocationOnScreen().y;
|
||||
}
|
||||
}
|
||||
});
|
||||
addWindowListener(new WindowAdapter() {
|
||||
private BaseTSD.LONG_PTR oldWndProc;
|
||||
private StdCallLibrary.StdCallCallback newProc;
|
||||
private Rectangle activeRect = new Rectangle();
|
||||
private AffineTransform trans;
|
||||
|
||||
@Override
|
||||
public void windowOpened(WindowEvent e) {
|
||||
RootPaneUI ui = getRootPane().getUI();
|
||||
if (ui instanceof SubstanceRibbonRootPaneUI) {
|
||||
SubstanceRibbonRootPaneUI sui = (SubstanceRibbonRootPaneUI) ui;
|
||||
JComponent titlePane = sui.getTitlePane();
|
||||
final String EXTRA_COMPONENT_KIND = "substancelaf.internal.titlePane.extraComponentKind";
|
||||
Object trailing = null;
|
||||
int i = 0;
|
||||
int cnt = titlePane.getComponentCount();
|
||||
for (; i < cnt; i++) {
|
||||
Component c = titlePane.getComponent(i);
|
||||
|
||||
if (c instanceof JComponent) {
|
||||
JComponent jc = (JComponent) c;
|
||||
Object o = jc.getClientProperty(EXTRA_COMPONENT_KIND);
|
||||
if ("TRAILING".equals("" + o)) {
|
||||
trailing = o;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trailing != null) {
|
||||
JButton button = new SubstanceTitleButton();
|
||||
button.setFocusPainted(false);
|
||||
button.setFocusable(false);
|
||||
button.setOpaque(true);
|
||||
|
||||
button.putClientProperty(EXTRA_COMPONENT_KIND, trailing);
|
||||
button.setText(null);
|
||||
button.setBorder(null);
|
||||
|
||||
Icon minIcon = new TransitionAwareIcon(button,
|
||||
new TransitionAwareIcon.Delegate() {
|
||||
@Override
|
||||
public Icon getColorSchemeIcon(
|
||||
SubstanceColorScheme scheme) {
|
||||
return SubstanceIconFactory
|
||||
.getTitlePaneIcon(
|
||||
SubstanceIconFactory.IconKind.MINIMIZE,
|
||||
scheme,
|
||||
SubstanceCoreUtilities
|
||||
.getSkin(rootPane)
|
||||
.getBackgroundColorScheme(
|
||||
DecorationAreaType.PRIMARY_TITLE_PANE));
|
||||
}
|
||||
}, "substance.titlePane.minIcon");
|
||||
|
||||
button.setIcon(minIcon);
|
||||
button.setToolTipText("Zkouska");
|
||||
button.putClientProperty(SubstanceLookAndFeel.FLAT_PROPERTY,
|
||||
Boolean.TRUE);
|
||||
|
||||
titlePane.remove(i);
|
||||
titlePane.add(button, i);
|
||||
titlePane.revalidate();
|
||||
}
|
||||
Window window = MainFrameRibbon.this;
|
||||
trans = View.getWindowDevice(window).getDefaultConfiguration().getDefaultTransform();
|
||||
if (trans == null) {
|
||||
trans = new AffineTransform();
|
||||
}
|
||||
|
||||
ComponentAdapter ad = new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
updateRect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e) {
|
||||
updateRect();
|
||||
}
|
||||
|
||||
private void updateRect() {
|
||||
int appButtonSize = (int) Math.round(trans.getScaleX() * Integer.getInteger("peacock.appButtonSize", 24));
|
||||
int titleIconsWidth
|
||||
= 3 + SubstanceSizeUtils.getTitlePaneIconSize() //close
|
||||
+ 10 + SubstanceSizeUtils.getTitlePaneIconSize() //maximize / restore
|
||||
+ 2 + SubstanceSizeUtils.getTitlePaneIconSize() //minimize
|
||||
+ 2 + SubstanceSizeUtils.getTitlePaneIconSize(); //always on top
|
||||
|
||||
Insets insets = titlePane.getInsets();
|
||||
if (insets == null) {
|
||||
insets = new Insets(0, 0, 0, 0);
|
||||
}
|
||||
activeRect = new Rectangle(
|
||||
insets.left + appButtonSize,
|
||||
4,
|
||||
titlePane.getWidth() - titleIconsWidth - insets.right - (insets.left + appButtonSize),
|
||||
titlePane.getHeight()
|
||||
);
|
||||
}
|
||||
};
|
||||
titlePane.addComponentListener(ad);
|
||||
|
||||
ad.componentShown(null);
|
||||
|
||||
WinDef.HWND hwnd = new WinDef.HWND(Native.getComponentPointer(window));
|
||||
|
||||
oldWndProc = User32.INSTANCE.GetWindowLongPtr(hwnd, WinUser.GWL_WNDPROC);
|
||||
|
||||
newProc = new StdCallLibrary.StdCallCallback() {
|
||||
public WinDef.LRESULT callback(WinDef.HWND hWnd, int uMsg, WinDef.WPARAM wParam, WinDef.LPARAM lParam) {
|
||||
if (!User32.INSTANCE.IsWindow(hwnd)) {
|
||||
return new WinDef.LRESULT(0);
|
||||
}
|
||||
if (uMsg == WinUser.WM_NCCALCSIZE) {
|
||||
return new WinDef.LRESULT(0);
|
||||
}
|
||||
if (uMsg == WinUser.WM_NCHITTEST) {
|
||||
int y = (short) ((lParam.longValue() >> 16) & 0xFFFF);
|
||||
int x = (short) (lParam.longValue() & 0xFFFF);
|
||||
|
||||
int BORDER_WIDTH = 4;
|
||||
WinDef.RECT winRect = new WinDef.RECT();
|
||||
User32.INSTANCE.GetWindowRect(hWnd, winRect);
|
||||
|
||||
boolean left = x >= winRect.left - BORDER_WIDTH && x < winRect.left + BORDER_WIDTH;
|
||||
boolean right = x < winRect.right + BORDER_WIDTH && x >= winRect.right - BORDER_WIDTH;
|
||||
boolean top = y >= winRect.top - BORDER_WIDTH && y < winRect.top + BORDER_WIDTH;
|
||||
boolean bottom = y < winRect.bottom + BORDER_WIDTH && y >= winRect.bottom - BORDER_WIDTH;
|
||||
|
||||
if (left && top) {
|
||||
return new WinDef.LRESULT(WinUser.HTTOPLEFT);
|
||||
}
|
||||
if (right && top) {
|
||||
return new WinDef.LRESULT(WinUser.HTTOPRIGHT);
|
||||
}
|
||||
if (left && bottom) {
|
||||
return new WinDef.LRESULT(WinUser.HTBOTTOMLEFT);
|
||||
}
|
||||
if (right && bottom) {
|
||||
return new WinDef.LRESULT(WinUser.HTBOTTOMRIGHT);
|
||||
}
|
||||
if (top) {
|
||||
return new WinDef.LRESULT(WinUser.HTTOP);
|
||||
}
|
||||
if (bottom) {
|
||||
return new WinDef.LRESULT(WinUser.HTBOTTOM);
|
||||
}
|
||||
if (left) {
|
||||
return new WinDef.LRESULT(WinUser.HTLEFT);
|
||||
}
|
||||
if (right) {
|
||||
return new WinDef.LRESULT(WinUser.HTRIGHT);
|
||||
}
|
||||
|
||||
Point p = new Point(x, y);
|
||||
|
||||
p.x = (int) Math.round(p.x / trans.getScaleX());
|
||||
p.y = (int) Math.round(p.y / trans.getScaleY());
|
||||
|
||||
p.x -= posOnScreen.x;
|
||||
p.y -= posOnScreen.y;
|
||||
if (activeRect.contains(p)) {
|
||||
return new WinDef.LRESULT(WinUser.HTCAPTION);
|
||||
}
|
||||
|
||||
//return new WinDef.LRESULT(WinUser.HTCLIENT);
|
||||
}
|
||||
return User32.INSTANCE.CallWindowProc(oldWndProc.toPointer(), hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
};
|
||||
|
||||
User32.INSTANCE.SetWindowLongPtr(hwnd, WinUser.GWL_WNDPROC, newProc);
|
||||
|
||||
int style = User32.INSTANCE.GetWindowLong(hwnd, WinUser.GWL_STYLE);
|
||||
style |= WinUser.WS_THICKFRAME;
|
||||
User32.INSTANCE.SetWindowLong(hwnd, WinUser.GWL_STYLE, style);
|
||||
User32.INSTANCE.SetWindowPos(hwnd, null, 0, 0, 0, 0,
|
||||
WinUser.SWP_NOMOVE | WinUser.SWP_NOSIZE | WinUser.SWP_NOZORDER | WinUser.SWP_FRAMECHANGED);
|
||||
|
||||
Dwmapi.MARGINS margins = new Dwmapi.MARGINS();
|
||||
margins.cxLeftWidth = 0;
|
||||
margins.cxRightWidth = 0;
|
||||
margins.cyTopHeight = 0;
|
||||
margins.cyBottomHeight = 0;
|
||||
|
||||
Dwmapi.INSTANCE.DwmExtendFrameIntoClientArea(hwnd, margins);
|
||||
}
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtendedState(int state) {
|
||||
if ((state & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH) {
|
||||
|
||||
@@ -31,14 +31,14 @@ package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*/
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLEByReference;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg.HKEY;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg.HKEYByReference;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
import com.sun.jna.win32.W32APIOptions;
|
||||
|
||||
@@ -19,12 +19,12 @@ package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
/**
|
||||
* @author JPEXS
|
||||
*/
|
||||
import com.sun.jna.Memory;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.EVENTLOGRECORD;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg.HKEY;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg.HKEYByReference;
|
||||
import com.sun.jna.Memory;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.sun.jna.Structure;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.LONG;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.LPVOID;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.WORD;
|
||||
import com.sun.jna.Structure;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2025 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HWND;
|
||||
import com.sun.jna.Library;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.win32.W32APIOptions;
|
||||
|
||||
public interface Dwmapi extends Library {
|
||||
|
||||
Dwmapi INSTANCE = (Dwmapi) Native.loadLibrary("dwmapi", Dwmapi.class, W32APIOptions.DEFAULT_OPTIONS);
|
||||
|
||||
class MARGINS extends Structure {
|
||||
|
||||
public int cxLeftWidth;
|
||||
public int cxRightWidth;
|
||||
public int cyTopHeight;
|
||||
public int cyBottomHeight;
|
||||
|
||||
@Override
|
||||
protected java.util.List<String> getFieldOrder() {
|
||||
return java.util.List.of("cxLeftWidth", "cxRightWidth", "cyTopHeight", "cyBottomHeight");
|
||||
}
|
||||
}
|
||||
|
||||
int DwmExtendFrameIntoClientArea(HWND hWnd, MARGINS pMarInset);
|
||||
}
|
||||
@@ -16,9 +16,6 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.DWORD;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HBITMAP;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HDC;
|
||||
@@ -27,6 +24,9 @@ import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinGDI.BITMAPINFO;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinGDI.BITMAPINFOHEADER;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinGDI.RGNDATA;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.ptr.PointerByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
import com.sun.jna.win32.W32APIOptions;
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.sun.jna.Structure;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.DWORD;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HBITMAP;
|
||||
import com.sun.jna.Structure;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.LPVOID;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.NativeLong;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.LPVOID;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
import com.sun.jna.ptr.NativeLongByReference;
|
||||
import com.sun.jna.win32.W32APIOptions;
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD.SIZE_T;
|
||||
import com.sun.jna.NativeLong;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD.SIZE_T;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.WString;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HINSTANCE;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HWND;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinReg.HKEY;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.WString;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HICON;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.platform.win32.WinDef.DWORD;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.HICON;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD.DWORD_PTR;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.UINT;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.ptr.PointerByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
import com.sun.jna.win32.W32APIOptions;
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD.LONG_PTR;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.Callback;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.WString;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD.LONG_PTR;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.ptr.ByteByReference;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
@@ -1445,4 +1446,41 @@ public interface User32 extends StdCallLibrary, WinUser {
|
||||
public static final int DI_DEFAULTSIZE = 8;
|
||||
|
||||
int FillRect(HDC hDC, RECT lprc, HANDLE hbr);
|
||||
|
||||
boolean IsWindow(HWND hWnd);
|
||||
|
||||
/**
|
||||
* Passes message information to the specified window procedure.
|
||||
*
|
||||
* @param lpPrevWndFunc
|
||||
* The previous window procedure. If this value is obtained by calling
|
||||
* the GetWindowLong function with the nIndex parameter set to GWL_WNDPROC
|
||||
* or DWL_DLGPROC, it is actually either the address of a window or dialog
|
||||
* box procedure, or a special internal value meaningful only to
|
||||
* CallWindowProc.
|
||||
*
|
||||
* @param hWnd
|
||||
* A handle to the window procedure to receive the message.
|
||||
*
|
||||
* @param Msg
|
||||
* The message.
|
||||
*
|
||||
* @param wParam
|
||||
* Additional message information. The content of this parameter
|
||||
* depends on the value of the Msg parameter.
|
||||
*
|
||||
* @param lParam
|
||||
* Additional message information. The content of this parameter
|
||||
* depends on the value of the Msg parameter.
|
||||
*
|
||||
* @return The return value is the result of the message processing and depends on
|
||||
* the message.
|
||||
* <p>
|
||||
* If the function fails, the return value is zero. To get extended
|
||||
* error information, call {@link Kernel32#GetLastError}.
|
||||
*/
|
||||
LRESULT CallWindowProc(Pointer lpPrevWndFunc, HWND hWnd, int Msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
Pointer SetWindowLongPtr(WinDef.HWND hWnd, int nIndex, Callback wndProc);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.sun.jna.Union;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.ptr.ByteByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD.LONG_PTR;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.IntegerType;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD.LONG_PTR;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.ptr.ByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
import java.awt.Rectangle;
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.jna.platform.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.ptr.ByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
|
||||
|
||||
@@ -187,6 +187,8 @@ public interface WinUser extends StdCallLibrary, WinDef {
|
||||
int WS_EX_LAYERED = 0x80000;
|
||||
|
||||
int WS_EX_TRANSPARENT = 32;
|
||||
|
||||
int WS_THICKFRAME = 0x00040000;
|
||||
|
||||
int LWA_COLORKEY = 1;
|
||||
|
||||
@@ -441,6 +443,20 @@ public interface WinUser extends StdCallLibrary, WinDef {
|
||||
int WM_SIZE = 0x0005;
|
||||
|
||||
int WM_DESTROY = 0x0002;
|
||||
|
||||
int WM_NCCALCSIZE = 0x0083;
|
||||
int WM_NCHITTEST = 0x0084;
|
||||
|
||||
int HTCLIENT = 1;
|
||||
int HTCAPTION = 2;
|
||||
int HTLEFT = 10;
|
||||
int HTRIGHT = 11;
|
||||
int HTTOP = 12;
|
||||
int HTTOPLEFT = 13;
|
||||
int HTTOPRIGHT = 14;
|
||||
int HTBOTTOM = 15;
|
||||
int HTBOTTOMLEFT = 16;
|
||||
int HTBOTTOMRIGHT = 17;
|
||||
|
||||
public static final int WM_DEVICECHANGE = 0x0219;
|
||||
|
||||
@@ -713,6 +729,10 @@ public interface WinUser extends StdCallLibrary, WinDef {
|
||||
|
||||
int RDW_NOFRAME = 0x0800;
|
||||
|
||||
int SWP_NOSIZE = 0x0001;
|
||||
int SWP_NOMOVE = 0x0002;
|
||||
int SWP_FRAMECHANGED = 0x0020;
|
||||
|
||||
/**
|
||||
* The retrieved handle identifies the window of the same type that is
|
||||
* highest in the Z order.
|
||||
|
||||
@@ -20,9 +20,9 @@ import com.jpexs.decompiler.flash.ApplicationInfo;
|
||||
import com.jpexs.decompiler.flash.gui.Main;
|
||||
import com.jpexs.decompiler.flash.gui.View;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.platform.win32.WinError;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT;
|
||||
import java.awt.Window;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package com.jpexs.decompiler.flash.gui.pipes;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import com.sun.jna.Platform;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package com.jpexs.decompiler.flash.gui.pipes;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Kernel32;
|
||||
import com.sun.jna.Platform;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
package com.jpexs.process.win32;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.DWORD;
|
||||
import com.jpexs.helpers.ProgressListener;
|
||||
import com.jpexs.process.Process;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef.DWORD;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
@@ -16,11 +16,6 @@
|
||||
*/
|
||||
package com.jpexs.process.win32;
|
||||
|
||||
import com.jpexs.helpers.ProgressListener;
|
||||
import com.jpexs.process.ProcessTools;
|
||||
import com.sun.jna.Memory;
|
||||
import com.sun.jna.NativeLong;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.Advapi32;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BITMAP;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.BaseTSD;
|
||||
@@ -37,6 +32,11 @@ import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinBase;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinDef;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT;
|
||||
import com.jpexs.decompiler.flash.gui.jna.platform.win32.WinNT.HANDLE;
|
||||
import com.jpexs.helpers.ProgressListener;
|
||||
import com.jpexs.process.ProcessTools;
|
||||
import com.sun.jna.Memory;
|
||||
import com.sun.jna.NativeLong;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
import com.sun.jna.ptr.NativeLongByReference;
|
||||
import com.sun.jna.ptr.PointerByReference;
|
||||
|
||||
Reference in New Issue
Block a user