flat assembler
Message board for the users of flat assembler.
Index
> Windows > How to create custom desined windows? Goto page 1, 2 Next |
Author |
|
OzzY 20 Nov 2006, 15:33
How to create custom designed windows like MSN ou Google Talk do?
Example: |
|||
20 Nov 2006, 15:33 |
|
Vasilev Vjacheslav 20 Nov 2006, 19:17
trust me, it's not so hard
|
|||
20 Nov 2006, 19:17 |
|
Vasilev Vjacheslav 20 Nov 2006, 22:14
i created this in fasm
_________________ [not enough memory] |
|||||||||||
20 Nov 2006, 22:14 |
|
OzzY 21 Nov 2006, 00:52
Looks pretty good.
Could please provide me a simple commented source-code? (if it's not asking too much) |
|||
21 Nov 2006, 00:52 |
|
Garthower 21 Nov 2006, 12:05
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 |
|||
21 Nov 2006, 12:05 |
|
Rayslava 21 Nov 2006, 21:21
So, share the source plz. We'll be very thankful
|
|||
21 Nov 2006, 21:21 |
|
cod3b453 22 Nov 2006, 23:32
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 |
|||
22 Nov 2006, 23:32 |
|
asmfan 23 Nov 2006, 12:39
Vasilev Slava, you have a little bug in your example - you spoil the EDI register containing the PAINTSTRUCT before call EndPaint with font handle.
|
|||
23 Nov 2006, 12:39 |
|
Vasilev Vjacheslav 24 Nov 2006, 10:47
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] |
|||||||||||
24 Nov 2006, 10:47 |
|
LocoDelAssembly 24 Nov 2006, 16:16
Vasilev Vjacheslav, can you please edit your attachment to add the compiled resource? (fasm can't compile rc scripts )
|
|||
24 Nov 2006, 16:16 |
|
Vasilev Vjacheslav 24 Nov 2006, 19:00
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 |
|||
24 Nov 2006, 19:00 |
|
LocoDelAssembly 24 Nov 2006, 20:11
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 |
|||
24 Nov 2006, 20:11 |
|
LocoDelAssembly 24 Nov 2006, 22:09
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 |
|||
24 Nov 2006, 22:09 |
|
MichaelH 25 Nov 2006, 00:07
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! |
|||
25 Nov 2006, 00:07 |
|
MichaelH 25 Nov 2006, 01:57
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????? |
|||
25 Nov 2006, 01:57 |
|
Vasilev Vjacheslav 25 Nov 2006, 13:12
MichaelH, yes, i also noticed it, but it's useless (that is why i don't do it)
also i will port resource soon |
|||
25 Nov 2006, 13:12 |
|
Vasilev Vjacheslav 25 Nov 2006, 13:26
LocoDelAssembly, it's seems there are bug in fasm 'dialogitem' macro, take a look on resource section after compiling
|
|||
25 Nov 2006, 13:26 |
|
farrier 25 Nov 2006, 13:50
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 |
|||
25 Nov 2006, 13:50 |
|
LocoDelAssembly 25 Nov 2006, 14:01
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. |
|||
25 Nov 2006, 14:01 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.