Skip to content

Commit 7be43f5

Browse files
committed
[GDI] getTextAlign
1 parent 5f362d3 commit 7be43f5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

dlls/user32/extras.hexa

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3802,11 +3802,21 @@ fun getRgnBox(stub SizeOfPointer) SizeOfPointer {
38023802
return 0
38033803
}
38043804

3805+
// Win32 Spec: https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-gettextalign
38053806
@dllExport('GetTextAlign')
3806-
fun getTextAlign(stub SizeOfPointer) SizeOfPointer {
3807-
// TODO
3808-
tofitaDebugLog("GetTextAlign called".utf16())
3809-
return 0
3807+
fun getTextAlign(hdc HDc) UInt32 {
3808+
tofitaDebugLog("GetTextAlign called with hdc %8".utf16(), hdc as! UInt64)
3809+
3810+
let dc = hdc as! DC
3811+
if dc == null {
3812+
tofitaDebugLog("> Invalid DC".utf16())
3813+
return 0 // GDI_ERROR
3814+
}
3815+
3816+
// Assume default alignment: TA_LEFT | TA_TOP | TA_NOUPDATECP
3817+
let alignment = 0u32 // TA_LEFT = 0, TA_TOP = 0, TA_NOUPDATECP = 0
3818+
tofitaDebugLog("> Returning alignment %u".utf16(), alignment as! UInt64)
3819+
return alignment
38103820
}
38113821

38123822
@dllExport('GetTextColor')

0 commit comments

Comments
 (0)