0

I try to write app for Windows with Kivy UI.
Is it possible to hide minimize button for Kivy window?

I read this topic, but explanation inside it not too clear for me.
As far as I understand there are two ways:

  1. First is create own titleBar using borderless and custom_titlebar configuration tokens.

  2. Second is maybe add some changes related to sdl2 as mentioned in topic.

As POC I tried also use winAPI, but without success:

from kivy.uix.relativelayout import RelativeLayout
from kivy.app import App

from win32gui import FindWindow, SetWindowLong, GetWindowLong

class MainWindow(RelativeLayout):
    pass

class Core(App):
    def on_start(self):

        WS_MINIMIZEBOX = 131072
        handler = FindWindow(None, self.title)
        old_style = GetWindowLong(handler, -16)
        new_style = int(old_style) &~ WS_MINIMIZEBOX
        SetWindowLong(handler, -16, new_style)
 
    def build(self):
        return MainWindow()
    
if __name__ == "__main__":
    Core().run()
JustAGuy
  • 26
  • 3

0 Answers0