Repository: tauri
Issue: [bug] Any idea on how to fix taskbar z-order issue in windows 11? 
Labels: type: bug,platform: Windows,status: needs triage

### Describe the bug

I implemented my application using Tauri. However, whenever I switch to a new application by clicking on the taskbar, the application window disappears. After some research, I found that this is likely due to a Windows taskbar Z-order issue, as mentioned in this [Tauri GitHub issue](https://github.com/tauri-apps/tauri/issues/7328).

I tried the suggested approach from the GitHub issue using unsafe Win32 code (see the code snippet below), but the issue still persists.

### Reproduction

```
fn main() {
    tauri::Builder::default()
        // .setup(|app| {
        //     let window = app.get_window("main").unwrap();
        //     let handle = HANDLE(null_mut());
        //     let mut name: Vec<u16> = wchz!("NonRudeHWND").to_vec();
        //     unsafe {
        //         SetPropW(GetForegroundWindow(), PCWSTR(name.as_mut_ptr()), handle);
        //     }
        //     Ok(())
        // })
        // .setup(|app| {
            
        //     Ok(())
        // })
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
```
and set 
```    "windows": [
      {
        "decorations": false,
        "skipTaskbar": true,
        "alwaysOnTop": true,
        "resizable": false,
        "focus": true
      }
```
and in js 
```

  async function setupWin() {
    try {
      const monitor = await currentMonitor();
      if(monitor) {
        screenWidth = monitor.size.width;
        screenHeight = monitor.size.height;
        const windowWidth = 300;
        const windowHeight = 50;
        xoffset = 0;
        yoffset = 0;
        const windowX = (screenWidth - windowWidth*3.5 + xoffset);
        const windowY = (screenHeight - windowHeight*5 + yoffset);

        await appWindow.setSize(new LogicalSize(windowWidth, windowHeight));
        await appWindow.setPosition(new LogicalPosition(windowX, windowY));
      }
    } catch (error) {
      console.error("Error setting up window:", error);
    }
  }
``` 
so that i can use this as a widget for personal use on desktop taskbar 

### Expected behavior

The Tauri window gets hidden when switching to another application from the taskbar, likely due to a taskbar Z-order issue.

I attempted the code snippet provided in the GitHub issue but am not experienced with Win32 unsafe code. Despite implementing the code, the issue persists.


### Full `tauri info` output

```text


[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 129.0.2792.65
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.83.0-nightly (ed04567ba 2024-09-28)
    ✔ cargo: 1.83.0-nightly (80d82ca22 2024-09-27)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (default)
    - node: 20.16.0
    - npm: 10.8.3

[-] Packages
    - tauri [RUST]: 1.8.0
    - tauri-build [RUST]: 1.5.5
    - wry [RUST]: 0.24.11
    - tao [RUST]: 0.16.10
    - tauri-cli [RUST]: 1.6.2
    - @tauri-apps/api [NPM]: 1.6.0
    - @tauri-apps/cli [NPM]: 1.6.2

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../build
    - devPath: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite
```


### Stack trace

_No response_

### Additional context

If there’s any further guidance on how to handle the taskbar Z-order issue, or a correct implementation of Win32 calls in Tauri, it would be much appreciated!
Let me know if you need more details or if I can provide further context.