Also das Arbeitsplatz Icon soll nach unten rücken und für meinen Frame platz machen
Code: Alles auswählen
import wx
import ctypes
import ctypes.wintypes
import win32ui
ABM_NEW = 0x0
ABM_REMOVE = 0x1
ABM_QUERYPOS = 0x2
ABM_SETPOS = 0x3
ABM_GETSTATE = 0x4
ABM_GETTASKBARPOS = 0x5
ABM_ACTIVATE = 0x6
ABM_GETAUTOHIDEBAR = 0x7
ABM_SETAUTOHIDEBAR = 0x8
ABM_WINDOWPOSCHANGED = 0x9
class APPBARDATA(ctypes.Structure):
_fields_ = [
("cbSize",ctypes.wintypes.DWORD),
("hWnd",ctypes.wintypes.HWND),
("uCallbackMessage", ctypes.c_ulong),
("uEdge", ctypes.c_ulong),
("rc", ctypes.wintypes.RECT),
("lParam",ctypes.wintypes.LPARAM),
]
def __repr__(self):
return """%s { %s }"""%(
self.__class__.__name__,
", ".join(
[ "%s=%r"%(field[0],getattr(self,field[0]))
for field in self._fields_
]
),
)
__str__ = __repr__
class myApp(wx.App):
def OnInit(self):
screen = wx.GetDisplaySize()
frame = wx.Frame(None, -1, 'Test', (0,0), (screen[0],25), wx.RAISED_BORDER)
panel = wx.Choice(frame)
frame.Show()
return True
app = myApp(0)
hwnd = win32ui.FindWindow(None, 'Test').GetSafeHwnd()
PAPPBARDATA = ctypes.POINTER(APPBARDATA)
pointer = PAPPBARDATA()
pointer.hWnd = hwnd
ctypes.windll.shell32.SHAppBarMessage(ABM_NEW, pointer)
app.MainLoop()
=============== Running Profile: Python ===============
---------------------------------------------------------------------------
Commandline: C:\dev\Python25\pythonw.exe E:\Projekte\Python\LAUNCH~1\app.py
Workingdirectory: E:\Projekte\Python\LAUNCH~1
Timeout: 0 sec, Delay: 0 sec, Started: 04.02.07 21:02:13
---------------------------------------------------------------------------
Traceback (most recent call last):
File "E:\Projekte\Python\LAUNCH~1\app.py", line 54, in <module>
ctypes.windll.shell32.SHAppBarMessage(ABM_NEW, pointer)
WindowsError: exception: access violation reading 0x00000000
Process "Python25" completed with Exit Code 1, at 04.02.07 21:02:14.