Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Set ctrl font colour winapi(Solved)

$
0
0
Looking for a way to change text colour of a label for instance via winapi.

This does not seem to work.
[ autoit ]      
#include <WinAPI.au3> #include <WindowsConstants.au3> _Main() Func _Main()     Local $hwnd, $hDC     $hwnd = GUICreate("test")     $hlabel = GUICtrlCreateLabel("label", 10,10,50,25)     $hlabel2 = GUICtrlGetHandle($hlabel)     $hDC = _WinAPI_GetDC($hlabel2)     If @error Then Exit MsgBox(0,"_WinAPI_GetDC", @error); no error     _WinAPI_SetTextColor($hDC, 0x0000FF)     If @error Then Exit MsgBox(0,"_WinAPI_SetTextColor", @error); no error     GUISetState()     While 1         If GUIGetMsg() = -3 Then ExitLoop     WEnd     _WinAPI_ReleaseDC($hlabel2, $hDC) EndFunc   ;==>_Main
Not sure why.

Appreciate any suggestions, bearing in mind I know I can do it with native functions but that is not what I'm after.

I cannot even make it work c++, and ideas about that would be just as sufficient.

Thanks for reading.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>