assembly - CreateWindowEx in masm x64 -
i'm coding in assembly under windows 10 using x64 masm, , enjoying it! haven't touched assembly in 25 years - uni days. learning , doing basic stuff, , getting speed rather quickly.
i have gui front-end, window, , down track have menu , child windows...
the 2 traditional ways (i guess) achieve are:
in assembly use createwindowex , related windows api functions, or
build front-end visual c++ code masm other areas program
now since i'm programming purely fun, , want stick assembly language only, first option 1 me.
but read on 1 assembly forums it's not recommended build/call windows via assembly. i'm not sure why? can imagine because it's painful when compared building front-end via high level language such vc++.
questions:
any reason not build gui windows front-end via assembly/createwindowex...?
would building windows via directx crazy idea?
any other techniques build front-end using assembly only?
i haven't done programming in windows 10 specifically, may bit outdated.
when build gui in windows end calling well known , standard set of apis1 in sequence, very basic control flow single branch ifs. this, of course, not true every application mostly.
long story short, in context, coding gui in c or in assembly doesn't make big difference, important 1 being different way call api functions2.
from os , cpu point of view there no difference between program written in assembly , program written in other language compiled native instructions.
also, if use coding style, or high level directives masm invoke
, there little no difference in efforts between c , assembly when creating gui.
answers
i can't think of reason not build gui in assembly. have done many times , have become fast doing in c.
i can't think of advantage either, fun.
can in assembly related gui creation3 can done in c too.this not crazy idea @ all, indeed wpf far know.
doing scratch, while being fun , interesting exercise, take quite long time however, because have write code draw every control/widget plus code control them.
using directx assembly, or language without natural support com, very nasty thing however. have once used directx in assembly , easy lost in pointers pointers interfaces pointers methods.
furthermore, need have thorough understanding of how com works , , forth idl files.as said in second point, can use wysiwyg ide visual c++ creating resource file dialog definition , use functions
dialogboxparam
make dialog out of resource.
there no c code involved, resource file4 can compile using resource compiler of visual studio , link executable. modern linker, including old tlink, can link resource files.
1 known registerclassex
, createwindowsex
, getmessage
, translatemessage
, dispatchmessage
, defwindowproc
apis.
2 x64 calling convention may little more tricky x86 one.
3 store/load values, times need pointer , other times can make things more elegant pointers functions. never need specific architecture instructions, main reason using assembly beside fun.
4 simple text file, easy format. can code self notepad if picturing coordinates in mind, used avoid using visual c++.
Comments
Post a Comment