I’m a little rusty in developing for Windows (like pre 2006). Anyhow, I’m running into a few issues that I’d like to see if there is a better way of doing it.
#1 System colors: GetSysColor doesn’t seem to be returning the actual colors, COLOR_BTNFACE returns white, where as it should return the button face color?? I’ve looked to see if there is a modern replacement, and everything I find online is for .NET if some XML kind of thing. I’ve also tracked down WFS, but was disappointed to see that it’s also using GetSysColor.
#2 I’m trying to create a custom window, and I’m using some example code I’ve found online. However it’s very slow. Does anyone know of any faster code?
[code] #If TargetWin32 then
Declare Function CreateRectRgn Lib “gdi32” (Left As Integer, top As Integer, Right As Integer, bottom As Integer) As Integer
Declare Function CombineRgn Lib “gdi32” (rgnDest As Integer, rgnSrc1 As Integer, rgnSrc2 As Integer, combineMode As Integer) As Integer
Declare Function DeleteObject Lib “gdi32” (hObject As Integer) As Integer
Declare Function SetWindowRgn Lib “user32” (hWnd As Integer, hRgn As Integer, bRedraw As Boolean) As Integer
Dim x, x2, y, w, h, r1, r2 As Integer
r1 = CreateRectRgn( 0, 0, 0, 0 )
h = pic.height -1
w = pic.width -1
For y = 0 To h
x = 0
While x < pic.Width
If pic.Graphics.Pixel(x, y) <> transparentColor Then
For x2 = x To w
If pic.Graphics.Pixel(x2, y) = transparentColor Then Exit
r2 = CreateRectRgn(x, y, x2+1, y+1)
call CombineRgn(r1, r1, r2, 2)
call deleteObject(r2)
x = x2
Next
End If
x = x + 1
Wend
Next
call SetWindowRgn( Handle, r1, True )
#EndIf[/code]
#3 I’m having trouble tracking some code Windows API for visual things, any pointers? Especially to get the more modern styles?