GetClassInfoA always returns false
Verfasst: 22. November 2016, 22:02
Hier ein Beispiel wie GetClassNameA() immer false liefert.
Hat da noch jemand eine Idee dazu?
Code: Alles auswählen
WNDCLASSA is Structure
style is unsigned int //Type C : UINT
lpfnWndProc is int //Type C : WNDPROC
cbClsExtra is int //Type C : int
cbWndExtra is int //Type C : int
hInstance is system int //Type C : HINSTANCE
hIcon is system int //Type C : HICON
hCursor is system int //Type C : HCURSOR
hbrBackground is system int //Type C : HBRUSH
lpszMenuName is system int //Type C : LPCSTR
lpszClassName is system int //Type C : LPCSTR
END
strWndClass is WNDCLASSA
sErr is string
FunctionReturn is boolean // C type:BOOL
hInstance is system int // C type:HINSTANCE
lpClassName is system int // C type:LPCSTR, this is the address of a string, you also have the ability to specify a string directly
lpWndClass is int // Pointer on structure WNDCLASSA
sClassName is string on 255 // = "WinDevObject "
sClassName1 is string on 255
nMaxCount is int = 255 // C type:int
sTitle is string
lpClassName = &sClassName
lpWndClass = &strWndClass
IF LoadDLL("user32.dll") = 0 THEN
ErrorInfo(errCode)
ErrorInfo(errMessage)
END
hInstance=Handle() // Handle vom Main Fenster holen
MyTrace("Handle: ", hInstance)
sTitle=SysWinTitle(hInstance) // Mit Titel prüfen ob richtiges Handle
MyTrace("Fenstertitel: ", sTitle)
FunctionReturn=API("user32","GetClassNameA", hInstance, lpClassName, nMaxCount) // OK ClassName ("WinDevObject") wird ausgelesen
// Ab hier test
sClassName1 = StringRetrieve(lpClassName, srASCIIZAddress) // OK sClassName "WinDevObject"
sClassName = StringRetrieve(lpClassName, srASCIIZAddress)
// FunctionReturn ist ab hier immer false!
FunctionReturn=CallDLL32("user32","GetClassInfoA",hInstance, lpClassName, lpWndClass)
// FunctionReturn ist immer false!
sErr=ErrorInfo (errSystemCode)
sErr=ErrorInfo (errSystemMessage) // Class name not found