Search in sources :

Example 1 with APPBARDATA

use of com.sun.jna.platform.win32.ShellAPI.APPBARDATA in project jna by java-native-access.

the class Shell32Test method queryPos.

private void queryPos(APPBARDATA data) {
    UINT_PTR h = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_QUERYPOS), data);
    assertNotNull(h);
    assertTrue(h.intValue() > 0);
}
Also used : DWORD(com.sun.jna.platform.win32.WinDef.DWORD) UINT_PTR(com.sun.jna.platform.win32.WinDef.UINT_PTR)

Example 2 with APPBARDATA

use of com.sun.jna.platform.win32.ShellAPI.APPBARDATA in project jna by java-native-access.

the class Shell32Test method removeAppBar.

private void removeAppBar() {
    APPBARDATA data = new APPBARDATA.ByReference();
    data.cbSize.setValue(data.size());
    UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_REMOVE), data);
    assertNotNull(result);
}
Also used : DWORD(com.sun.jna.platform.win32.WinDef.DWORD) UINT_PTR(com.sun.jna.platform.win32.WinDef.UINT_PTR) APPBARDATA(com.sun.jna.platform.win32.ShellAPI.APPBARDATA) PointerByReference(com.sun.jna.ptr.PointerByReference)

Example 3 with APPBARDATA

use of com.sun.jna.platform.win32.ShellAPI.APPBARDATA in project jna by java-native-access.

the class Shell32Test method testResizeDesktopFromBottom.

public void testResizeDesktopFromBottom() throws InterruptedException {
    newAppBar();
    APPBARDATA data = new APPBARDATA.ByReference();
    data.uEdge.setValue(ShellAPI.ABE_BOTTOM);
    data.rc.top = User32.INSTANCE.GetSystemMetrics(User32.SM_CYFULLSCREEN) - RESIZE_DELTA;
    data.rc.left = 0;
    data.rc.bottom = User32.INSTANCE.GetSystemMetrics(User32.SM_CYFULLSCREEN);
    data.rc.right = User32.INSTANCE.GetSystemMetrics(User32.SM_CXFULLSCREEN);
    queryPos(data);
    UINT_PTR h = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_SETPOS), data);
    assertNotNull(h);
    assertTrue(h.intValue() >= 0);
    removeAppBar();
}
Also used : DWORD(com.sun.jna.platform.win32.WinDef.DWORD) UINT_PTR(com.sun.jna.platform.win32.WinDef.UINT_PTR) APPBARDATA(com.sun.jna.platform.win32.ShellAPI.APPBARDATA) PointerByReference(com.sun.jna.ptr.PointerByReference)

Example 4 with APPBARDATA

use of com.sun.jna.platform.win32.ShellAPI.APPBARDATA in project jna by java-native-access.

the class Shell32Test method newAppBar.

private void newAppBar() {
    APPBARDATA data = new APPBARDATA.ByReference();
    data.cbSize.setValue(data.size());
    data.uCallbackMessage.setValue(WM_USER + 1);
    UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_NEW), data);
    assertNotNull(result);
}
Also used : DWORD(com.sun.jna.platform.win32.WinDef.DWORD) UINT_PTR(com.sun.jna.platform.win32.WinDef.UINT_PTR) APPBARDATA(com.sun.jna.platform.win32.ShellAPI.APPBARDATA) PointerByReference(com.sun.jna.ptr.PointerByReference)

Example 5 with APPBARDATA

use of com.sun.jna.platform.win32.ShellAPI.APPBARDATA in project jna by java-native-access.

the class Shell32Test method testResizeDesktopFromTop.

public void testResizeDesktopFromTop() throws InterruptedException {
    newAppBar();
    APPBARDATA data = new APPBARDATA.ByReference();
    data.uEdge.setValue(ShellAPI.ABE_TOP);
    data.rc.top = 0;
    data.rc.left = 0;
    data.rc.bottom = User32.INSTANCE.GetSystemMetrics(User32.SM_CXFULLSCREEN) - RESIZE_DELTA;
    data.rc.right = User32.INSTANCE.GetSystemMetrics(User32.SM_CXFULLSCREEN);
    queryPos(data);
    UINT_PTR h = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_SETPOS), data);
    assertNotNull(h);
    assertTrue(h.intValue() >= 0);
    removeAppBar();
}
Also used : DWORD(com.sun.jna.platform.win32.WinDef.DWORD) UINT_PTR(com.sun.jna.platform.win32.WinDef.UINT_PTR) APPBARDATA(com.sun.jna.platform.win32.ShellAPI.APPBARDATA) PointerByReference(com.sun.jna.ptr.PointerByReference)

Aggregations

DWORD (com.sun.jna.platform.win32.WinDef.DWORD)5 UINT_PTR (com.sun.jna.platform.win32.WinDef.UINT_PTR)5 APPBARDATA (com.sun.jna.platform.win32.ShellAPI.APPBARDATA)4 PointerByReference (com.sun.jna.ptr.PointerByReference)4