Link to home
Start Free TrialLog in
Avatar of softwareachiever
softwareachiever

asked on

what are the ascii values used for creating windows in c++ ?

A - ascii 65 -  1000001

if  i press the key 'A' it sends to monitor like above binary foramat.

bu i create window( 10,20, 30,40)

  how  does the process above window command ?
what are the ascii values used  for creating  windows   in c++ ?
Avatar of tdlewis
tdlewis
Flag of United States of America image

This link provides documentation on the CreateWindow function:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632679%28v=vs.85%29.aspx

...and here's a tutorial explaining how the function is used to create a simple window:
http://www.winprog.org/tutorial/simple_window.html
Avatar of softwareachiever
softwareachiever

ASKER

ok.  you have told  readymade window class to define windows.

but. I am expectation how to create a window as myself

in dos c++ (not vc++).  window() function is available in conio.h
this function is predefined function existing into conio.h.
but I want to create a window myself.

for example printf() function is predefined for printing.

but   char far *m= (char far*)0xb8000000 is used to print on screen on directly without using printf function.

what is the direct code to create window as directly ?

like that what is the way to create window as direct.
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can't draw a window by itself using ascii sequences. a window on a windows system will be drawn by calls to GDI (graphical device interface) such as DrawLine function. at the end of a lot code used by the operation system (windows) your video hardware (grapic card, grafic chip) will be used to display pixels on the screen such that you see a "window" rectangle. but the displayed window is only the minor part of a window. when using CreateWindow call, it actually doesn't display the window but only prepares a new window object associated with resources and could be addressed by windows messages. then you need a message handler which is running in an infinite loop to receive messages and perform messages in a four-step approach (peek, get, translate, distribute) and provide a handler function for each window involved which would be called if a message is directed to the window.

if you type 'A' and try to display the 'A' in a window you would send three messages to that window. first a WM_KEYDOWN message indicating that the key 'A' was pressed, then a WM_CHAR message, and finally a WM_KEYUP message, each of them with a number of varying parameters.

Sara
Sara, I'm pretty sure the asker is looking to do this on the console not in the GUI environment. That being the case, it is possible to draw a windows (well, a box).
i also thought that might be the case and actually i made such kind of "windows programming" in the eighties myself.

but drawing a frame at the monitor using escape sequences and special frame characters as parts of lines and corners normally wouldn't be called as "i create window( 10,20, 30,40)" what apparantly is a call to a graphic function.

i hope softwareachiever will tell us what is the case.

Sara
>> i hope softwareachiever will tell us what is the case.
Well, they have - hence my previous assertion :)

"in dos c++ (not vc++).  window() function is available in conio.h
this function is predefined function existing into conio.h.
but I want to create a window myself. "

http:#a38358578
>>>but   char far *m= (char far*)0xb8000000 is used to print on screen on directly without using printf function.

I'm surprised by you who still know the address 0xb8000000 where we can directly write/print whatever we want under Dos. I was thinking there is nobody know this address anymore because Dos already died.

Under windows, every hardware is protected by OS, user mode application does not have the right to access hardware anymore, only kernel mode driver can do.

But, windows does provide a bunch of APIs which you can use to print on your screen. Since this a multiprocess OS, and there are usually multiple windows on the same screen. So you need to put everything into the message handles function of a window, each window takes responsible for its own rendering. And each process has its own process space, you can't access the address from one application to another. This is totally different with Dos.

Here are some materials you can refer to.
http://www.winprog.org/tutorial/start.html
http://www.sunlightd.com/Archive/Windows/GUI/Windows.aspx

Hope it helps, good luck.
evilrix, you are right. i missed that part of the author's comment.

softwareachiever, what operation system should your program run on?

is it dos os or do you want to run it in a command window (dos box) of windows os?

if the latter what windows version are you using?

Sara
my os is win xp professional
my c++ editor is tc3.exe

I want to know fully graphical drawing programmig technology ?
how are graphical object are created.
how to create our own drawing without using predefined function into header files.

I want to create  window function myself without using predefined function. ?
how to create it ?
I want to know fully language programming technology. that is all
Are you saying you are using turboC? If so, this does not work for windows because it only create dos exe file, which is MZ format, xp needs PE format exe file. That means you have to use VC instead unless if you only want to create Dos exe to run under XP. For you other questions, refer to those links I posted.
@softwareachiever, it would help if you would describe precisely what you want to accomplish and the environment in which you want to accomplish it.

Let's start with the environment: Do you want a program that runs on Windows? Linux? the command prompt in Windows (a crude approximation of the old DOS operating system)? Macintosh? How you manipulate objects on the screen is different in all those environments.

As for what you're trying to accomplish: Are you trying to create a line? a curve? a circle? an image? Do you want to your graphical output to appear in a window that looks like the windows created by other programs in the operating system? or do you want to draw on the screen without any regard to what other programs might be doing?

If you can describe your goals in a concise manner, perhaps we can guide you to the right methods to accomplish your goal. Try something like:
I want to write a DOS program that can be launched from the Windows command prompt that can draw a circle on the screen.
I want to write a Linux program that plots a graph.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial