Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 185443
Alex Hales
  • 0
Alex HalesTeacher
Asked: June 9, 20222022-06-09T22:38:01+00:00 2022-06-09T22:38:01+00:00

python – Make Pygame app window show underneath all other application windows

  • 0

[ad_1]

So I was trying to make a ‘desktop’ based game, a bit like desktop goose where the game is ‘on’ the desktop.

To do this, I made a transparent Pygame window but at the moment, it shows up whenever you focus the window regardless of layer (which makes sense). However, I am trying to find a way to make it ALWAYS stay on the bottom layer in terms of the window’s that a user has open, to give the impression its ‘stuck’ on the desktop. I’ve done a lot of googling and only found Tkinter solutions, but nothing in terms of locking the window down when it comes to using Pygame.

Does anyone else have a clue or idea about how I could do this? I assume there would be some kind of need to use the win32 modules for Windows, just not sure how.

UPDATE: I did find this, but ran the raw code and it didn’t work as expected (no errors, just not as the title says)
Always keep window on bottom in Python for Windows and pygame

I believe this would be the main line I need to focus on:

win32gui.SetWindowPos(hwnd,win32con.HWND_BOTTOM, 0, 0, 0, 0,win32con.SWP_NOMOVE + win32con.SWP_NOSIZE)

I have tried using some of the parameter options from these docs in the above line of code, but as I’m not proficient in pywin32 I’m not sure how to do so and have it work
SetWindowPos function

[ad_2]

  • 0 0 Answers
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 318 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 291 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 285 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.