Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

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++ ?
0
softwareachiever
Asked:
softwareachiever
  • 4
  • 3
  • 2
  • +2
2 Solutions
 
tdlewisCommented:
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
0
 
softwareachieverAuthor Commented:
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.
0
 
evilrixSenior Software Engineer (Avast)Commented:
>> what are the ascii values used  for creating  windows   in c++ ?
If you want to use standard 7 bit ascii you choices are pretty limited. You could use 8 bit ascii but the characters about 127 will differ depending upon your code page. Your best bet, assuming you do want to use standard ascii characters, is to use -| and +

eg.

+-----+
|     |
|     |
+-----+

Open in new window


This site shows the standard (7 bit) ascii values and an example of the extended (8 bit) ascii values. You'll note there are some characters for drawing horizontal and vertical lines as well as corners.

http://www.asciitable.com/

Again, those above 127 are not standard and depend upon your code page.

More about ascii: http://en.wikipedia.org/wiki/ASCII
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sarabandeCommented:
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
0
 
evilrixSenior Software Engineer (Avast)Commented:
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).
0
 
sarabandeCommented:
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
0
 
evilrixSenior Software Engineer (Avast)Commented:
>> 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
0
 
BeyondWuCommented:
>>>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.
0
 
sarabandeCommented:
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
0
 
softwareachieverAuthor Commented:
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
0
 
BeyondWuCommented:
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.
0
 
tdlewisCommented:
@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.
0
 
sarabandeCommented:
softwareachiever,

for graphics on a windows system you may use

- windows gdi
- opengl
- direct-x

the windows gdi is the graphical interface the windows os (in your case xp pro) provides.

opengl and direct-x are graphic libraries which need to be supported by your graphic card.

all those libraries come with header files where the functions to call have a prototype declaration.

in windows there is no way to write directly to the graphic card. windows has a "hardware abstraction layer" short HAL which prevents that. the only other way to force a graphic card or graphic chip of your computer to create a picture on your monitor is to write a driver that would need to be installed in windows and would replace the currently installed driver (default video driver of the os or custom driver for your video card). such a task is beyond the possibilities of a single programmer. such kind of software was made in the laboratories of nvidia, amd (ati) or others and was based on a huge knowledge gathered by many many programmers in decades.

in a command window of win xp (dosbox) you can do only pseudo graphics like you see above in the first comment evilrix has posted. there are special fonts available which would allow to "draw" smooth rectangles by sending a stream of characters and control characters (escape sequences) to the monitor. but even for that you need a library function declared in a header file which allows you to send to monitor.

Sara
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now