# Windows 11 moving wallpaper

**URL:** <https://discourse.processing.org/t/windows-11-moving-wallpaper/47235>\
**Category:** Gallery\
**Tags:** homework\
**Created:** [September 27, 2025, 8:33am UTC](https://discourse.processing.org/t/windows-11-moving-wallpaper/47235 "2025-09-27T08:33:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FortranGuy](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@FortranGuy](https://discourse.processing.org/u/FortranGuy)\
**Post date:** [September 27, 2025, 8:33am UTC](https://discourse.processing.org/t/windows-11-moving-wallpaper/47235/1 "2025-09-27T08:33:45Z")

</div>

Hello everyone!

As a hobby, I create static wallpapers by overlaying green rectangle with anime characters.

One day, I came across an illustration of a pocket watch, so instead of overlaying it with a green rectangle, I implemented a watch movement using Processing to create a moving wallpaper.

Surprisingly, the code for the moving wallpaper turned out to be shorter than I expected.

> import com.sun.jna.Native;  
> import com.sun.jna.Structure;  
> import com.sun.jna.WString;  
> import com.sun.jna.Pointer;  
> import com.sun.jna.platform.win32.WinDef.HWND;  
> import com.sun.jna.platform.win32.WinDef.DWORDByReference;  
> import com.sun.jna.platform.win32.WinDef.WPARAM;  
> import com.sun.jna.platform.win32.WinDef.LPARAM;  
> import com.sun.jna.platform.win32.WinDef.HDC;  
> import com.sun.jna.platform.win32.\* ;  
> import com.sun.jna.win32.StdCallLibrary;
> 
> HWND workerW ;  
> HWND childDC ;  
> HDC dc\_workerW ;  
> HDC dc\_childDC ;
> 
> […]
> 
> void setup() {
> 
> fullScreen(1);  
> frameRate(60);
> 
> ```auto
> [...]
> 
> ```
> 
> HWND progman = User32.INSTANCE.FindWindow ( “Progman”, null ) ;  
> DWORDByReference dbr = new DWORDByReference();  
> User32.INSTANCE.SendMessageTimeout ( progman, 0x052c, new WPARAM(0), new  
> LPARAM(0), 0x0, 1000, dbr ) ;
> 
> HWND workerW = User32.INSTANCE.FindWindowEx ( progman, null, “workerW”,  
> null) ;  
> HDC dc\_workerW = User32.INSTANCE.GetDC( workerW );
> 
> HWND childDC = User32.INSTANCE.FindWindow ( null, “[sketch\_name]” ) ;  
> HDC dc\_childDC = User32.INSTANCE.GetDC( childDC );
> 
> HWND rtn\_set = User32.INSTANCE.SetParent ( childDC, workerW ) ;
> 
> }

That’s all the code you need to add to sketch.

ex; Pocket watch

> <https://x.com/i/status/1956454646106743032>

ex; Video playback

> <https://x.com/i/status/1964187970162086007>

See you again sometime.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [September 27, 2025, 9:04pm UTC](https://discourse.processing.org/t/windows-11-moving-wallpaper/47235/2 "2025-09-27T21:04:11Z")

</div>

Hello @FortranGuy ,

I added the sketch name and added latest JAR files but all I get is a gray screen:

- jna-5.18.0.jar
- jna-platform-5.18.0.jar

Note:

- The 4.1.2 did not work here
- Using W10, Processing 4.4.7

> [@FortranGuy](#):
>
> […]

Is something missing in your code?

I am expecting a Windows background with icons on top but just seeing the background fullscreen.

`:)`

---

<div class="post-metadata">

**Author:** ![FortranGuy](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@FortranGuy](https://discourse.processing.org/u/FortranGuy)\
**Post date:** [September 29, 2025, 3:52am UTC](https://discourse.processing.org/t/windows-11-moving-wallpaper/47235/3 "2025-09-29T03:52:08Z")

</div>

Hello @glv .

Thanks for trying!

In conclusion, this code is currently only for Windows 11.

Of course, when I tested this code, I ran it on Windows 10 and Windows 11.  
Unfortunately, it didn’t run on Windows 10…

I followed the steps in the original source and used MS spy++ to check the behavior of Windows 10 and Windows 11.  
The point was that each ran in a different way.

Based on the article ( [Code Project](https://www.codeproject.com/articles/Draw-Behind-Desktop-Icons-in-Windows-plus) ) I referenced, I used spy to observe step-by-step execution on Windows 10 and Windows 11.  
The point is that they run differently.

Just to be sure, I used a MS spy++ to observe the OS’s standard slideshow, and as expected, it ran clearly differently on Windows 10 and Windows 11.

So I decided to say goodbye to Windows 10 and welcome Windows 11.

Sorry I couldn’t be of much help…

---

<div class="post-metadata">

**Author:** ![FortranGuy](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@FortranGuy](https://discourse.processing.org/u/FortranGuy)\
**Post date:** [October 1, 2025, 4:06am UTC](https://discourse.processing.org/t/windows-11-moving-wallpaper/47235/4 "2025-10-01T04:06:22Z")

</div>

Hello @glv and everyone!

Supplement…

- This code only runs on Windows 11. It will not run on Windows 10.

- Download the latest jar files from the following sites and copy and paste them into your sketch.

- The first time I ran jna I added a frame to the code. Maybe a frame is needed.  
But it probably won’t run on Windows 10.

The code with the frame added is shown below:

```auto
import processing.awt.PSurfaceAWT;

import java.awt.Component;
import java.awt.Frame;

import com.sun.jna.Native;
import com.sun.jna.Structure;
import com.sun.jna.WString;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.DWORDByReference;
import com.sun.jna.platform.win32.WinDef.WPARAM;
import com.sun.jna.platform.win32.WinDef.LPARAM;
import com.sun.jna.platform.win32.WinDef.HDC;
import com.sun.jna.platform.win32.* ;
import com.sun.jna.win32.StdCallLibrary;

HWND workerW ; 
HWND childDC ;
HDC dc_workerW ;
HDC dc_childDC ;

void setup() {

  fullScreen(SPAN);

  PSurfaceAWT awtSurface = (PSurfaceAWT)surface;
  PSurfaceAWT.SmoothCanvas smoothCanvas = (PSurfaceAWT.SmoothCanvas)awtSurface.getNative();
  Frame frame = smoothCanvas.getFrame();
 
  frame.removeNotify();
  frame.setSize(width, height);
  frame.setAlwaysOnTop(true);
  frame.setUndecorated(true);
  frame.setOpacity(0.995f);
  frame.addNotify();
  frame.setLocation ( 0, 0);

  colorMode(RGB);
  frameRate(20);
  smooth();
  noStroke();
  textureMode(NORMAL);

  hint(ENABLE_DEPTH_TEST);

  HWND progman = User32.INSTANCE.FindWindow ( "Progman", null ) ;
  DWORDByReference dbr = new DWORDByReference();
  User32.INSTANCE.SendMessageTimeout ( progman, 0x052c, new WPARAM(0), new LPARAM(0), 0x0, 1000, dbr ) ;

  HWND workerW = User32.INSTANCE.FindWindowEx ( progman, null, "workerW", null) ;
  HDC dc_workerW = User32.INSTANCE.GetDC( workerW );

  HWND childDC = User32.INSTANCE.FindWindow ( null, " sketch_name " ) ; 
  HDC dc_childDC = User32.INSTANCE.GetDC( childDC );

  HWND rtn_set = User32.INSTANCE.SetParent ( childDC, workerW ) ; 

}

```

😺

---

<div class="post-metadata">

**Author:** ![FortranGuy](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@FortranGuy](https://discourse.processing.org/u/FortranGuy)\
**Post date:** [October 14, 2025, 3:22am UTC](https://discourse.processing.org/t/windows-11-moving-wallpaper/47235/5 "2025-10-14T03:22:08Z")

</div>

I have a new incident:  
fillscreen (P3D) aborts, and it’s the same with size (width, height, P3D)…
