flat assembler
Message board for the users of flat assembler.

Index > Windows > how do you create a button?

Author
Thread Post new topic Reply to topic
Redragon



Joined: 27 Nov 2004
Posts: 101
Location: U.S.
Redragon 25 Aug 2005, 22:54
This may sound really stupid, but how do you create a button? in all of the examples i have seen, it creates the buttons as if it was for a dialog box.. thanks!
Post 25 Aug 2005, 22:54
View user's profile Send private message Reply with quote
bazik



Joined: 28 Jul 2003
Posts: 34
Location: .de
bazik 25 Aug 2005, 23:30
Redragon wrote:
This may sound really stupid, but how do you create a button? in all of the examples i have seen, it creates the buttons as if it was for a dialog box.. thanks!


Code:
_button db 'button', 0
       invoke  CreateWindowEx, 0, _button, _text, WS_VISIBLE + WS_CHILD, WND_W-15, 0, 15, 15, [hwnd], BTN_EXT, 0, 0
    



For an explanation of the parameters look here: http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindowex.asp
Post 25 Aug 2005, 23:30
View user's profile Send private message Reply with quote
Redragon



Joined: 27 Nov 2004
Posts: 101
Location: U.S.
Redragon 25 Aug 2005, 23:33
what is "BTN_EXT" caus i get an error that it isnt defined.. so im not sure what i should include for it

EDIT: i see what it is now, just dont know how to fix it..

i thought i fixed it with

Code:
invoke  CreateWindowEx, 0,_button,NULL,WS_VISIBLE+WS_CHILD,15,0,15,15,NULL,NULL,0,0    


compiles fine, does what the window is suposed to, just doesnt show the button
Post 25 Aug 2005, 23:33
View user's profile Send private message Reply with quote
bazik



Joined: 28 Jul 2003
Posts: 34
Location: .de
bazik 26 Aug 2005, 12:21
Redragon wrote:
what is "BTN_EXT" caus i get an error that it isnt defined.. so im not sure what i should include for it

EDIT: i see what it is now, just dont know how to fix it..

i thought i fixed it with

Code:
invoke  CreateWindowEx, 0,_button,NULL,WS_VISIBLE+WS_CHILD,15,0,15,15,NULL,NULL,0,0    


compiles fine, does what the window is suposed to, just doesnt show the button


You forgot to set [hwnd] which is the handle of the parent window. BTN_EXT was a constant for the button ID which you can process in WM_COMMAND when a button is clicked.
Post 26 Aug 2005, 12:21
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.