Hi, I wanna know how to "skin" a program (in masm32...) like WinAMP.
I have seen code, but I wanna a tutorial...
So you have one, or know where I can get one, please relpy!
Best Regards
// Christopher Vigren
I have seen code, but I wanna a tutorial...
So you have one, or know where I can get one, please relpy!
Best Regards
// Christopher Vigren
I know of no tutorial. But i have many sources that might help.
Basically you have to take care of WM_PAINT and WM_NCPAINT messages.
It can get a little bit more complicated if apart from doing that, you have to code mouse logic. Which (afaik) is the case of winamp's and many others as well.
Latigo
Basically you have to take care of WM_PAINT and WM_NCPAINT messages.
It can get a little bit more complicated if apart from doing that, you have to code mouse logic. Which (afaik) is the case of winamp's and many others as well.
Latigo
I had this source sitting around and it makes a nice base to learn from when you want to deal skinned windows.
As for mouse logic, here again is some old (very old) code I had which you may want to study and adapt to your own program, it should work as is inside a message loop.
Which sadly means it won't work first time in the attached source as it uses a msg loop based on optimisations suggested by The Svin.
As for mouse logic, here again is some old (very old) code I had which you may want to study and adapt to your own program, it should work as is inside a message loop.
Which sadly means it won't work first time in the attached source as it uses a msg loop based on optimisations suggested by The Svin.
BrdStruct Struct
Left dd ?
Right dd ?
Bottom dd ?
Top dd ?
RightMod dd ?
BottomMod dd ?
BrdStruct Ends
WNDStruct Struct
CaptionBar dd ?
Border BrdStruct {?}
rect RECT {?}
WNDStruct ends
.data
WND WNDStruct {20, {5, 5, 5, 5, ?, ?}, {?}}
.code
.ELSEIF uMsg == WM_LBUTTONDOWN
mov eax, lParam
mov edx, eax
and eax, 0FFFFh
and edx, 0FFFF0000h
shr edx, 16
.If eax < WND.Border.Left
.If edx < WND.Border.Top
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTTOPLEFT,0
.ElseIf edx > WND.Border.BottomMod
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTBOTTOMLEFT,0
.Else
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTLEFT,0
.EndIf
.ElseIf eax > WND.Border.RightMod
.If edx < WND.Border.Top
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTTOPRIGHT,0
.ElseIf edx > WND.Border.BottomMod
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTBOTTOMRIGHT,0
.Else
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTRIGHT,0
.EndIf
.ElseIf edx < WND.Border.Top
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTTOP,0
.ElseIf edx > WND.Border.BottomMod
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTBOTTOM,0
.ElseIf edx < WND.CaptionBar
invoke PostMessageA,hWnd,WM_NCLBUTTONDOWN,HTCAPTION,0
.Else
; Client Area
.EndIf
.ELSEIF uMsg == WM_MOUSEMOVE
mov eax, lParam
mov edx, eax
and eax, 0FFFFh
and edx, 0FFFF0000h
shr edx, 16
.If eax < WND.Border.Left
.If edx < WND.Border.Top
invoke LoadCursor, NULL, IDC_SIZENWSE
invoke SetCursor, eax
.ElseIf edx > WND.Border.BottomMod
invoke LoadCursor, NULL, IDC_SIZENESW
invoke SetCursor, eax
.Else
invoke LoadCursor, NULL, IDC_SIZEWE
invoke SetCursor, eax
.EndIf
.ElseIf eax > WND.Border.RightMod
.If edx < WND.Border.Top
invoke LoadCursor, NULL, IDC_SIZENESW
invoke SetCursor, eax
.ElseIf edx > WND.Border.BottomMod
invoke LoadCursor, NULL, IDC_SIZENWSE
invoke SetCursor, eax
.Else
invoke LoadCursor, NULL, IDC_SIZEWE
invoke SetCursor, eax
.EndIf
.ElseIf edx < WND.Border.Top
invoke LoadCursor, NULL, IDC_SIZENS
invoke SetCursor, eax
.ElseIf edx > WND.Border.BottomMod
invoke LoadCursor, NULL, IDC_SIZENS
invoke SetCursor, eax
.Else
invoke LoadCursor, NULL, IDC_ARROW
invoke SetCursor, eax
.EndIf
If I got your program right, E?in, the BMP is in the EXE... Or?
I wanna make a program that loades a external BMP.
I wanna make a program that loades a external BMP.
Is't just to change the LoadBitmap API to the LoadImage API?
Will the "redraw" code work then?
Will the "redraw" code work then?
you can check my website (http://www.effervescence.com), there' s an example of a skinned window (keygen template =))
roy
roy
Also Test Department has got some good examples on his web site (http://www.crahkob.com/td/). Give them a look.
Roy,
I check out your skinned window example a while ago... i liked the coding structure alot. And i think its an exellent example to "break away" from the beginner coding model that Hutch and Iczelion offers (Ewayne has some neat tricks to be learned from as well). I dont know if your example is the best source for skinned windows but i do think its a go00ooood source to be studied in general.
Just thought i would give your work some backing :)
Nice work..
:alright:
NaN
I check out your skinned window example a while ago... i liked the coding structure alot. And i think its an exellent example to "break away" from the beginner coding model that Hutch and Iczelion offers (Ewayne has some neat tricks to be learned from as well). I dont know if your example is the best source for skinned windows but i do think its a go00ooood source to be studied in general.
Just thought i would give your work some backing :)
Nice work..
:alright:
NaN
hey ! thanks *alot* nan ! =)
i must say, i also respect your work,
i liked that object oriented project you' ve done, that' s also a really interesting way to program that *totally* breaks from the good old beginner way of coding =)
i must say, i also respect your work,
i liked that object oriented project you' ve done, that' s also a really interesting way to program that *totally* breaks from the good old beginner way of coding =)
Thanx :)
Im glad you like our OOP model.. your right tho, it is a bit of a twist. Heh, its what kept it fun to work on :)
While its about 98% finished in design, there is still more to come as soon as Thomas and myself are outa school long enough to collaborate some more on it.. but in the mean time, im just trying to meat Hutch's deadline to get it out in the next Masm package.
Thanx again!
NaN
Im glad you like our OOP model.. your right tho, it is a bit of a twist. Heh, its what kept it fun to work on :)
While its about 98% finished in design, there is still more to come as soon as Thomas and myself are outa school long enough to collaborate some more on it.. but in the mean time, im just trying to meat Hutch's deadline to get it out in the next Masm package.
Thanx again!
NaN