Code: Select all
SetBatchlines,-1
#Persistent
;~ OnMessage(0x200, "OnMOUSEMOVE")
;~ OnMessage(0x201, "OnLBUTTONDOWN")
;~ OnMessage(0x202, "OnLBUTTONUP")
;~ OnMessage(0x2A2, "OnLeave")
;~ OnMessage(0x2A3, "OnLeave")
;~ OnMessage(0x8, "OnLeave")
Class GDIGUI {
static Init:=0
__new(x=0,y=0,w="",h="",Style=0x80CA0000,ExStyle=0)
{
If !GDIGUI.Init
{
Gdip_Startup()
hInstance := DllCall("GetModuleHandle", "Ptr", 0, "Ptr")
VarSetCapacity(wndclassex, 16+8*A_PtrSize, 0)
NumPut(16+8*A_PtrSize, wndclassex, 0, "UInt") ;cbSize
NumPut(0x23, wndclassex, 4, "UInt") ;style HERE
NumPut(RegisterCallback("WindowProc"), wndclassex, 8, "Ptr") ;lpfnWndProc
NumPut(hInstance, wndclassex, 16+A_PtrSize, "Ptr") ;hInstance
NumPut(DllCall("LoadCursor", "Ptr", 0, "Ptr", 32512, "Ptr"), wndclassex, 16+3*A_PtrSize, "Ptr") ;hCursor
NumPut(6, wndclassex, 16+4*A_PtrSize, "Ptr") ;hbrBackground
lpClassname:="GDI-Window"
NumPut(&lpClassName, wndclassex, 16+6*A_PtrSize, "Ptr") ;lpszClassName
atom := DllCall("RegisterClassEx", "Ptr", &wndclassex, "UShort")
GDIGUI.Init:=1
}
this.Width:=w?w:A_ScreenWidth
this.Height:=h?h:A_ScreenHeight
this.DrawBitmap:=Gdip_CreateBitmap(this.Width, this.Height)
this.BkgndBitmap:=Gdip_CreateBitmap(this.Width, this.Height)
this.DrawGraphics:=Gdip_GraphicsFromImage(this.DrawBitmap)
this.GUIhwnd:=DllCall("User32.dll\CreateWindowEx", "Uint", ExStyle, "Str", "GDI-Window", "Str", "GDI-App", "UInt", Style, "Int", x , "Int", y , "Int", this.Width, "Int", this.Height, "Ptr", 0, "Ptr", 0, "Ptr", hInstance, "Ptr", 0, "Ptr")
WindowProc(this.GUIHWND, 0, this, 0)
}
Show()
{
DllCall("ShowWindow", "ptr", this.GUIhwnd, "uint", 5)
this.GUIHDC:=GetDC(this.GUIhwnd)
this.GUIGraphics:=gdip_GraphicsfromHDC(this.GUIHDC)
this.Redraw()
this.MSG_15()
}
MSG_15()
{
static call:=0
If !call
{
gdip_DrawImage(this.GUIGraphics,this.DrawBitmap)
tooltip % ((a:=GetDC(this.GUIhwnd))=this.GUIHDC) "`n" this.GUIHDC "`n" a
return call:=0
}
return 0
}
Redraw()
{
Gdip_GraphicsClear(this.DrawGraphics,0xFF000000)
gdip_DrawImage(this.DrawGraphics,this.BkgndBitmap)
For each, GDIControl in this
If (IsObject(GDIControl)&&IsFunc(GDIControl.Redraw))
{
Control.Redraw()
gdip_DrawImage(this.DrawGraphics,GDIControl.DrawBitmap,GDIControl.X,GDIControl.Y)
}
}
}
Frontier2400GUI:=new GDIGUI()
Brush:=Gdip_CreateLineBrushFromRect(0, 0, A_ScreenWidth, A_ScreenHeight, 0xFF35281B, 0xFF261C13, 1, 1)
Bkgnd:=Gdip_GraphicsFromImage(Frontier2400GUI.BkgndBitmap)
Gdip_FillRectangle(Bkgnd, Brush, 0, 0, A_ScreenWidth, A_ScreenHeight)
Frontier2400GUI.Show()
WindowProc(hWnd, msg, wParam, lParam)
{
static callbacks:={}
Critical ;Sollte zeitliche Probleme beseitigen
If !msg
callbacks[hwnd]:=wparam
If (callbacks.haskey(hwnd)&&IsFunc(callbacks[hwnd,"MSG_" . msg]))
callbacks[hwnd,"MSG_" . msg].(wparam,lparam)
return DllCall("DefWindowProc", "Ptr", hWnd, "UInt", msg, "Ptr", wParam, "Ptr", lParam, "Ptr")
}
I want to find out if its a Problem of the script or of this PC.
Simply run th Code and move the window around a bit.
Tell me if the tooltip changes.