flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
OzzY
How to create custom designed windows like MSN ou Google Talk do?
Example: ![]() |
|||
![]() |
|
Vasilev Vjacheslav
trust me, it's not so hard
|
|||
![]() |
|
Vasilev Vjacheslav
i created this in fasm
![]()
_________________ [not enough memory] |
|||||||||||
![]() |
|
OzzY
Looks pretty good.
Could please provide me a simple commented source-code? (if it's not asking too much) |
|||
![]() |
|
Garthower
Vasilev Vjacheslav wrote: trust me, it's not so hard And I also didn't speak, that it's very hard. I have told, that it RATHER borrows time much ![]() |
|||
![]() |
|
Rayslava
So, share the source plz. We'll be very thankful
![]() |
|||
![]() |
|
cod3b453
1) Create a window with just WS_VISIBLE style
2) Remove the WS_CAPTION by Code: invoke GetWindowLong,[hWnd],GWL_STYLE mov ebx,eax and eax,WS_CAPTION xor eax,ebx invoke SetWindowLong,[hWnd],GWL_STYLE,eax 3) Use SetWindowRgn to set the shape of the window CreateRoundRectRgn should do the rounded corners for you, other fun shapes use Create[Rect/Elliptic/Poly]Rgn and CombineRgn. 4) In your window procedure: WM_PAINT for painting everything on the window including custom titlebar or whatever; WM_MOUSEMOVE can be useful to make close buttons or similar without making a button control which can be drawn directly into the window. HTH |
|||
![]() |
|
asmfan
Vasilev Slava, you have a little bug in your example - you spoil the EDI register containing the PAINTSTRUCT before call EndPaint with font handle.
|
|||
![]() |
|
Vasilev Vjacheslav
here is the source code for this form (don't forget to give proper credits when you will use this in your project, thanks)
ps. edi bug fixed
_________________ [not enough memory] |
|||||||||||
![]() |
|
LocoDelAssembly
Vasilev Vjacheslav, can you please edit your attachment to add the compiled resource? (fasm can't compile rc scripts
![]() |
|||
![]() |
|
Vasilev Vjacheslav
this rc-file can be compiled with microsoft resource compiler
ps. i will be very appreciated if Tomasz put my code to examples section on main page as custom interface creating, if possible |
|||
![]() |
|
LocoDelAssembly
But this will be the first example that doesn't work with a single tool (fasm). Maybe porting the RC script to fasm? I forgot to test Reverend's tool but now I'm on Linux again
![]() [edit]Now I tried porting it by myself but fails at dialogbox creation ![]() Code: section '.rsrc' resource data readable directory RT_DIALOG,dialogs,\ RT_BITMAP,bitmaps,\ RT_RCDATA, regions resource dialogs,\ ID_DLGMAIN,LANG_ENGLISH+SUBLANG_DEFAULT,main resource bitmaps,\ ID_BMP,LANG_ENGLISH+SUBLANG_DEFAULT,info resource regions,\ ID_RGN,LANG_ENGLISH+SUBLANG_DEFAULT,region dialog main, 0,70,70,332,176,DS_SETFONT+DS_CENTER+WS_POPUP+WS_VISIBLE, , ,'Tahoma', 8 dialogitem 'BUTTON','_',ID_BTN1,274,3,11,10,BS_OWNERDRAW+BS_CENTER+BS_FLAT+WS_TABSTOP dialogitem 'BUTTON','x',ID_BTN2,288,3,11,10,BS_OWNERDRAW+BS_CENTER+BS_FLAT+WS_TABSTOP enddialog bitmap info,'info.bmp' resdata region file 'main.rgn' endres ; eof |
|||
![]() |
|
LocoDelAssembly
Code: G:\Documents and Settings\Hernan\Desktop>rc -? Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823 Copyright (C) Microsoft Corp. 1985-1998. All rights reserved. Code: G:\Documents and Settings\Hernan\Desktop>rc main.rc main.rc(10) : fatal error RC1015: cannot open include file 'afxres.h'. After removing the include Code: G:\Documents and Settings\Hernan\Desktop>rc main.rc main.rc (20): error RC2144 : PRIMARY LANGUAGE ID not a number main.rc (58): error RC2135 : file not found: LANGUAGE main.rc (67): error RC2135 : file not found: 10 Pleeeaaassseee, post the compiled res ![]() |
|||
![]() |
|
MichaelH
LocoDelAssembly, I suspect you already have Microsoft Platform SDK. Anyone who hasn't and is into fasm windows programming should download the latest Platform SDK from MS (and back it up in case you lose it as it's a big download
![]() In your "User varibles for ?" Environment varibles, in "INCLUDE", place the path to afxres.h, e.g - C:\Program Files\Microsoft Platform SDK\Include\mfc (or where ever you have it installed). Open a new cmd window and rc should compile any rc file. Vasilev Vjacheslav, thanks for this example, it is very much appreciated! |
|||
![]() |
|
MichaelH
Vasilev Vjacheslav, I was looking at your code and noticed GradientFill is a import from msimg32.dll. On further research I found when looking at msimg32.dll imports and exports, GradientFill is just a redirect to gdi32.dll GdiGradientFill.
I replaced all the calls to msimg32.dll GradientFill with calls to gdi32.dll GdiGradientFill and sure enough it worked with no alterations. GdiGradientFill is not in the fasm include gdi32.inc and the existence of msimg32.dll suggest what? ..... gdi32.dll GdiGradientFill is not in all Windows versions?????, hence adding it to gdi32.inc is a bad idea????? |
|||
![]() |
|
Vasilev Vjacheslav
MichaelH, yes, i also noticed it, but it's useless (that is why i don't do it)
also i will port resource soon |
|||
![]() |
|
Vasilev Vjacheslav
LocoDelAssembly, it's seems there are bug in fasm 'dialogitem' macro, take a look on resource section after compiling
|
|||
![]() |
|
farrier
From the resource.inc file in the fasm/include/macro directory:
Code: macro dialogitem class,title,id,x,y,cx,cy,style,exstyle dialogitem takes 9 parameters. [Edit] This is wrong: from fasm.pdf Quote: The dialogitem has eight required parameters and one optional. farrier _________________ Some Assembly Required It's a good day to code! U.S.Constitution; Bill of Rights; Amendment 1: ... the right of the people peaceably to assemble, ... The code is dark, and full of errors! Last edited by farrier on 27 Nov 2006, 00:10; edited 2 times in total |
|||
![]() |
|
LocoDelAssembly
Win32 Headers>>1.6 Resources wrote: The dialog can take up to eleven parameters, first seven being required. Or I'm using the incorrect include file? MichaelH, no, I used the one that comes with MASM package so I'll download the SDK then. Vasilev Vjacheslav, OK, I'll take a look. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.