BOOL WINAPI FillConsoleOutputAttribute( __in HANDLE hConsoleOutput, __in WORD wAttribute, __in DWORD nLength, __in COORD dwWriteCoord, __out LPDWORD lpNumberOfAttrsWritten );
The parameter that I am having an issue with is "COORD dwWriteCoord".
Here is the type definition I am using for COORD:
Coord struct {
X, Y int16 }
What I believe is that I need to convert that structure to a DWORD, and that to uintptr, but I am obviously missing something.
Current function where I am using this:
func FillConsoleOutputAttribute(Handle uintptr, wAttrib word, nLength DWord, dwWriteCoord Coord) (result DWord, err error) {
var lpNumberofAttrsWritten DWord
var dwCoord DWord = uintptr(dwWriteCoord) // This doesn't compileret, _, callErr := fillConsoleOutputAttribute.Call(Handle, uintptr(wAttrib), uintptr(nLength), uintptr(dwCoord), uintptr(unsafe.Pointer(&lpNumberofAttrsWritten)))
if ret == 0 {
abort2("FillConsoleOutputAttribute()", callErr)
}
result = lpNumberofAttrsWritten
err = nil
return
}
I could post all the code, but it's not usable on Play, so figured I would wait until someone requests the whole thing.
Any ideas or suggestions would be appreciated.
Thanks
Terry
BOOL WINAPI FillConsoleOutputAttribute( __in HANDLE hConsoleOutput, __in WORD wAttribute, __in DWORD nLength, __in COORD dwWriteCoord, __out LPDWORD lpNumberOfAttrsWritten );The parameter that I am having an issue with is "COORD dwWriteCoord".Here is the type definition I am using for COORD:Coord struct {X, Y int16 }What I believe is that I need to convert that structure to a DWORD, and that to uintptr, but I am obviously missing something.Current function where I am using this:func FillConsoleOutputAttribute(Handle uintptr, wAttrib word, nLength DWord, dwWriteCoord Coord) (result DWord, err error) { var lpNumberofAttrsWritten DWord var dwCoord DWord = uintptr(dwWriteCoord) // This doesn't compile
why not just use ... = uintptr(dwWriteCoord.X) + uintptr(dwWriteCoord.Y) << 16 ?