Create a textbox from code

All questions regarding Windows programming, post here. API,COM, ActiveX, DirectX, OpenGL, MFC and so on...

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Create a textbox from code

Postby JerryWoodstock » Thu Oct 16, 2003 4:32 pm

This may sound stupid but just fooling around at my computer with MFC,VB or c# i started wondering how windows textboxxes are made is there a way to create one from code with out using any of the windows controls?or calling the windows api? how was a textbox first created ?I Guess what im trying to ask is for example if a textbox was somthing that had never been created how whould i go about doing it?
JerryWoodstock
 

Postby Flannery » Thu Oct 16, 2003 4:52 pm

Should be in the Windows Forum, buy anyway. In VB you just drop and drag a text box to create it (the last time I used VB was some years ago when it all fitted onto a single floppy disk - oh, those were the days). With Win32 API or MFC you need to use the, well, the API. The MS guys most likley wrote most windows controls in ASM with MASM.

I have not tried, but it is my guess that making any custom windows control is hard work.
Flannery
 

Postby gooch » Thu Oct 16, 2003 6:47 pm

Flannery wrote: The MS guys most likley wrote most windows controls in ASM with MASM.


i most severely doubt that. there is no reason for doing so. windows 'controls', are simply specialized windows - the window procedure, which _you_ write, defines how the window looks, and acts. even the most 'basic' function - CreateWindow, surely would have been written in C.

Flannery wrote:I have not tried, but it is my guess that making any custom windows control is hard work.


it can be. depends on what you wish the control to do.

JerryWoodstock wrote:I Guess what im trying to ask is for example if a textbox was somthing that had never been created how whould i go about doing it?


you would do as described above, create a window via the win32 api function CreateWindow, and write your window procedure to behave like a 'text box'.

if you couldn't, for example, use the win32 api, you'd have to create the necessary infrastructure - mostly an event system, and some basic graphics operations. then just build from there.
gooch
 
Posts: 74
Joined: Thu Sep 25, 2003 4:12 am

Postby Invictus » Tue Oct 21, 2003 2:19 pm

actually the windows operating system is actually written in c... well xp might be c++....

what you wanna know is how would you make a text box if you couldnt just include windows.h and use the edit or static text box classes right?
User avatar
Invictus
 
Posts: 3054
Joined: Tue Oct 21, 2003 12:59 pm


Return to Windows Programming

Who is online

Users browsing this forum: No registered users and 1 guest