|
|
| multiple windows |
|
superstar4410
Member #926
January 2001
|
Ok, I am making a program that runs in 2 windows, When the main window is executed it calls(using the spawn function) the second program in another window. The 2 programs actings as one interact through sending data through a file, now the heres the problem. Think of how winamp or music match jukebox works, the have like 2 windows running at once, but both are active at the same time, with me I have to click between windows to activate each one. Is there a solution to that (so both windows can be active at the same time) thankss Don't take yourself too seriously, but do take your responsibilities very seriously. |
|
mEmO
Member #1,124
March 2001
|
Win32 or allegro? I don't think that there is a way to make two windows active in Win32 at the same time (If what you mean is that both of them should be "blue" at the same time). However, they will receive their messages nevertheless, so I don't really see the problem. --------------------------------------------- |
|
superstar4410
Member #926
January 2001
|
I mean allegro, with the whole message thing, I'm NOT using win32 api message system. I'm using my own method through allegro to send data to a file, and both windows read from that file and communicate. but heres the thing,i'm making my own video player to play special video files that I make(that are really datafiles with pictures in them). When I run the video window is calls the control window and they both are on showing, but when I click on the control window the movie stops because that window becomes inactive and resume only after I click on it again. you said that you didn't think it was possible? so how does winamp do it, like they have they playlist window, and the window that shows that file is playing (NO win32 api please). Thanks Don't take yourself too seriously, but do take your responsibilities very seriously. |
|
KaBlammyman
Member #455
June 2000
|
When any program has more than 1 window at once, only 1 is active in any given point in time. They are just all showing at the same time. They dont stop showing their contents. However, they arnt "active". If winamp used a normal a "windows" window, only one window will be blue at the top. If you look at winamp with its base skin, you can see this, the top of the player will change color when you anrnt using the player window. Since they are always up, they both seem to active. [edit] I was replying when you were, so I still thought you ment in windows...my fault.
|
|
Ciro Duran
Member #3,011
December 2002
|
I don't know much of GUI programming... But you could give the "impression" that when you click of the windows both show up. When you click one window, bring the other window on the top first and then the one you clicked on. --- In the beginning, God said "light_source { <0, 0, 0> color White }" and light was created. |
|
superstar4410
Member #926
January 2001
|
Ok, I understand that, but how about the programs that have 2 windows up and both are only represented by one window on the task bar. Its like the one program is separating itself into 2 windows. This example that i'm taking about is a program that isn't running in the default windows window, but its own custom window that usually dosent have the default (minimize, expand, and close) buttons at the top right corner Don't take yourself too seriously, but do take your responsibilities very seriously. |
|
Korval
Member #1,538
September 2001
|
Quote: NO win32 api please Then you don't get an answer. Allegro is, primarily, a game library. It's interface to the GUI is precisely enough to get a game up and running, and nothing more than that. If you want to do something like what you're wanting to do, you're going to have to talk to the GUI directly. That's simply the nature of the beast. |
|
superstar4410
Member #926
January 2001
|
can that be done with including winalleg windows handling, hwnd.blahh code thanks Don't take yourself too seriously, but do take your responsibilities very seriously. |
|
Thomas Fjellstrom
Member #476
June 2000
|
Well, you can still use allegro to create your main window etc.. but for changing window properties etc.. you'll still need to use some Win32 code. -- |
|
Dexter Tad-y
Member #2,930
November 2002
|
just a suggestion: Why not deal with only ONE(1) window instead of having to deal with multiple windows. Split your main window (in allegro) into several parts as you wish. Although you will lose the flexibility of multiple windows here (movable, etc). ___________________________________ |
|
superstar4410
Member #926
January 2001
|
are there any good tutorials out their for integrating Win32 with allegro. Like having the advantages of the win32 windows Thankss Don't take yourself too seriously, but do take your responsibilities very seriously. |
|
mEmO
Member #1,124
March 2001
|
Quote: Ok, I understand that, but how about the programs that have 2 windows up and both are only represented by one window on the task bar.
They make use of child windows and dialogs. You should really read up on Win32. The forgers win32 programming tutorial is really good, and should get you started. Eventually, I recommend you to buy Programming Windows fifth edition by Charlez Petzholds. The best Win32 programming book! (Well, I have only read that one, but everyone else says so --------------------------------------------- |
|
Catalin
Member #1,485
August 2001
|
your problem has to do with set_display_switch_mode. AFAIK when a windowed allegro program looses focus, it pauses. You cannot change the display switch mode for windowed programs (at least not on my computer). I think it's a directx issue, but i'm not sure. |
|
spellcaster
Member #1,493
September 2001
|
superstar, in order to get two windows, you need to manage two windows. That means you'll need to use the in32 API in one way, or the other. There's no "easy way" to avoid that. If you don't want to learn / use the win32 API, you're out of luck and can't use a 2nd window, then. -- |
|
A J
Member #3,025
December 2002
|
allrgro function set_display_switch_mode() ___________________________ |
|
Dark
Member #749
November 2000
|
why not just use something like the spacebar to pop the controls up over the video, then press space again to hide them?
__________________________________ |
|
A J
Member #3,025
December 2002
|
have one window. or launch another window that does nothing. or write a win32 app. or use one window, make it full screen ___________________________ |
|
spellcaster
Member #1,493
September 2001
|
Hm... blitting directly to the screen is a nice idea. But... it won't do the trick. Same with hijacking another windows hdc. Reason for this is mainly the fact that he won't be able to process anything that's happening that area. Using a single fullscreen window will work. But it's a fake. If he wanted to run fullscreen, he would use a fullscreen app and use internal windows for that stuff. Quote: use one window, make it full screen
The idea is good, but he needs to grab the dektop before he calls allegro_init and set_gfx_mode(). While that's not hard (check the lexEyes source for an example) it requires win32 API calls. Which he wants to avoid. I'd guess he wants to simulate a normal win app, without learning the win32 API. That will not work properly, sincy he'd have to simulate a lot of windows behavior by hand. It might be better to go his own way, so the user doesn't expect windows functionality in the frist place. But, in the long run, learning win32 wil be worth it.. so why not start today? -- |
|
A J
Member #3,025
December 2002
|
seriously win32 api is not that hard. gettings some data out of the system, or settings same stuff is often one function call. try this: int main(void) there you have it, a win32 call... how easy ! try this: int main(void) ___________________________ |
|
superstar4410
Member #926
January 2001
|
the problem with me and the winapi I tried to learn it and quit like 3 different times. Plus it just seems like it has soo much extra overhead. With allegro I can do things so much easier and with way less lines of code. With the winapi its like 70 lines just to get a window open, and the who resource bit, and having to declare menu items and all that, and all the classes. I'll just use one window like the win media player on xp. Plus I have heard that there are alternatives to the win 32api. Well i'm a computer science Minor at college, and next semester i'm taking this really good computer course and I'll see if they teach the win32 api and talk with my professor about all the little details. Thanks for all the suggestions. Don't take yourself too seriously, but do take your responsibilities very seriously. |
|
23yrold3yrold
Member #1,134
March 2001
|
Quote: seriously win32 api is not that hard. You, sir, are on crack I wrote a little example of getting Allegro and Win32 to work together. So now all you need to do is learn a little Win32 to run a second window. See mEmO's last post; Petzold rocks Though if one were very 1337, I would bet you could put the main game window into fullscreen using ChangeDisplaySettings() and then running a smaller window over that. But I've never tried that. Win32 is not too hard, though it can be cumbersome. Never tried any alternatives though. Isn't this that "console" thing everyone loves so much? You could create a simple GUI window using Allegro or something, no? Just rambling ... EDIT: Hey, I just noticed that ss4410 is using paragraphs! When did he start
-- |
|
Wer fu
Member #1,084
March 2001
|
Why not use 3 thread? One for each window (GUI operation and verification) and an other for the core of the program.
ICQ:71667703 or Email&MSN: werfu_dx@yahoo.fr |
|
A J
Member #3,025
December 2002
|
threads are not the issue... heres another idea... have 2 seperate programs... both use allegro for drawing etc... both are stand alone allegro programs. BUT, one launches the other. sorted ___________________________ |
|
Thomas Fjellstrom
Member #476
June 2000
|
Or you could use shared memory... Or a pipe.. Or a socket... etc... -- |
|
A J
Member #3,025
December 2002
|
i was trying to offer the simplest method, as someones afraid of win32, and needs to be shown the light i would bet that win32::SendMessage(WM_COPYDATA,...) is the simplest, and yes i know its not portable, but really what (useful warez) is these days anyway. ___________________________ |
|
|