Hi, I'm writing big project in dev c++ (winapi and opengl). By default in
project settings I had win32 GUI, so only one window with opengl was showed. I
decided to add background common window, so I can write into it some
instructions how to control opengl app - just quick manual. In project
settings I changed option to win32 console and everything is working fine.
Only small problem is that, I want to make this background console window
(with manual, not the main window) move and resize to demand location, so both
windows can be on by one, not one partially hidden behind main window. I
searched info, and found some helpful functions like MoveWindow and so on - it
works, but for my main window with opengl. The first parameter for e.g
MoveWindow(hwnd, 50, 50, 350, 350, true); should be hwnd, and in this case it
means my main window ( if I tried against GetConsoleWindow - it says out of
scope). The background console window is created only by selecting this option
in project options. Is there any way to choose between main console window,
which is selected by default and the common, background console?How to choose
for a while the other window, use function move and make it background as it
is for default right now?
I appreciate your help. Thank you from mountain.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's where the problem is. I don't even create the bakground window. I just
made app that use opengl, so in my program should be only one console window.
But when I choose in project options - win32 console application, the
background one appears. The main console window can be controlled, and the
background one is just created I don't know when - it is just but selecting
this option. When I put some commnd like cout, the text is shown in the
background one. I don't know how to get the hwnd pointer to the background
one, that is created by compiler?I guess
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are creating a windows program, not a console program.
Instead of win32 console application, select the option for a windows program.
The console window should disappear.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, that's correct information. The point is, that I want the background,
second console window to be showed. I already putted some info in it, about
how to control opengl app. I need to have two consoles. All I want is to
control size and position of background console window.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm thank you for reply. If so, the background console window cannot be
controlled, I'll try to move the main one, so they can be both one by one.
It's not good solution I think, because that background console window, is
controlled (position) by operating system, but every time I see it's in left-
top corner of screen ( 50px, 50px as I good remember). Maybe it will work
good, I'll see.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can set the size and position of the console window manually. Right click
on the top bar and select Properties. The Layout tab has size and position.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, but I doubt. that common user of my app will make it manually. But never
mind, if I cannot control it from my program lines, I'll figure out something
else. Good to know about what You say, thank you for help. In meantime I will
post some new problem about closing application - x button on opengl console
window doesn't kill the program process, but I'll try to search the internet
and forum first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm writing big project in dev c++ (winapi and opengl). By default in
project settings I had win32 GUI, so only one window with opengl was showed. I
decided to add background common window, so I can write into it some
instructions how to control opengl app - just quick manual. In project
settings I changed option to win32 console and everything is working fine.
Only small problem is that, I want to make this background console window
(with manual, not the main window) move and resize to demand location, so both
windows can be on by one, not one partially hidden behind main window. I
searched info, and found some helpful functions like MoveWindow and so on - it
works, but for my main window with opengl. The first parameter for e.g
MoveWindow(hwnd, 50, 50, 350, 350, true); should be hwnd, and in this case it
means my main window ( if I tried against GetConsoleWindow - it says out of
scope). The background console window is created only by selecting this option
in project options. Is there any way to choose between main console window,
which is selected by default and the common, background console?How to choose
for a while the other window, use function move and make it background as it
is for default right now?
I appreciate your help. Thank you from mountain.
You should have two hwnd identifiers, one for the main window and one for the
background.
How did you open the background window?
That's where the problem is. I don't even create the bakground window. I just
made app that use opengl, so in my program should be only one console window.
But when I choose in project options - win32 console application, the
background one appears. The main console window can be controlled, and the
background one is just created I don't know when - it is just but selecting
this option. When I put some commnd like cout, the text is shown in the
background one. I don't know how to get the hwnd pointer to the background
one, that is created by compiler?I guess
You are creating a windows program, not a console program.
Instead of win32 console application, select the option for a windows program.
The console window should disappear.
Yes, that's correct information. The point is, that I want the background,
second console window to be showed. I already putted some info in it, about
how to control opengl app. I need to have two consoles. All I want is to
control size and position of background console window.
You cannot control the size and position of a window that is not created by
your program.
You can create a sub window to display the info in an edit control. As you can
probably guess, this will be fairly time consuming.
An easier option would be to create a HTML file and open it in the default
browser with ShellExecuteEx().
If you want to use the console window you will have to be satisfied with not
being able to control it with the program.
Hmm thank you for reply. If so, the background console window cannot be
controlled, I'll try to move the main one, so they can be both one by one.
It's not good solution I think, because that background console window, is
controlled (position) by operating system, but every time I see it's in left-
top corner of screen ( 50px, 50px as I good remember). Maybe it will work
good, I'll see.
You can set the size and position of the console window manually. Right click
on the top bar and select Properties. The Layout tab has size and position.
Yes, but I doubt. that common user of my app will make it manually. But never
mind, if I cannot control it from my program lines, I'll figure out something
else. Good to know about what You say, thank you for help. In meantime I will
post some new problem about closing application - x button on opengl console
window doesn't kill the program process, but I'll try to search the internet
and forum first.