Hello Everyone

I have a program with two other seprate windows. My intention was to have one program being the brains of the outfit. The other two programs would have to call on the main program to get it funtions preformed. I know I can fake a mouse click to the button of the main window but I don't like that any more because I am hoping that Windows and a computer for that matter to at lease let my program do things my way if possible without a dll ... unless I have to -:)

How can I call on a funtion all packed up in my main window by useing a buffer, edit box or button in my main window and let my other seprate programs get its funtions prefored. ( not trying to be Windows its just impotant that I can do so ).

Also I do relize that I can put all windows in the main program. That would be another question. Is it possible to have two child windows in your main program that will allow the main program to be of Top Most Window at all times and the two child windows never to be of top most, they would only work as standard windows z-orders.

Imagin the Delphi IDE with its object inspector and tool bars but I think it use dll's and even if you open up Wordperfect or another program all of Delphi windows will go z-order... I must keep my main window at top most.

It been two years now and I still got much to learn...Will it ever end...

Dream City

I don't know c, I like Delphi and I love Masm32

Got to see NaN and Blake stuff... Just saw their new post...WoW
Posted on 2001-09-27 10:59:05 by cmax
I dunno if i fully understood your problem..

But i would go with Child windows (such that you can keep their handles in your address space ~ avoid Filemapping info between processes).

And then have each window call needed functions between them with " WM_USER + (a number >100) " messages. Ie)

WM_DOMYFUNCTION equ WM_USER +101
WM_DOSOMETHINGELSE equ WM_USER + 102
...
.elseif uMsg == WM_DOMYFUNCTION
invoke The_FUnction, Params
.elseif uMsg == WM_DOSOMETHINGELSE
invoke The_SOmethingElse_function, Params
.endif


Also.. if the Child window needs to send msg's back to the main window. Use the SetWindowLong and GetWindowLong API's to store the handle of the main window when the child is created. (Ie pass the handle when the main creates the child window, the child window stores this in a special mem location that wont forget).

I suppose you could use GetParent() as an alternative actually... (read that in a post earlier today :) ), since the Child window will have the main window as a parent.

Then the main window can have its own custion messages to recieve as well (from child windows..)


I've never fully done this.. but i believe this will work.

NaN
Posted on 2001-09-27 14:35:32 by NaN
Each program can have more than one window with WS_OVERLAPPED or WS_POPUP styles. (Please don't equate programs to windows.) If you need to do different things with each window, then you will need to create more than one window proc, and new classes to go with them.

The hwndOwnerParent argument of CreateWindowEx is used to name the owner of these two types of windows. When two windows overlap, the owner is always behind the window it owns.

You can put any overlapped or popup window on equal footing with any other "main" window by using NULL for the owner (just like your main window). This actually makes the desktop the owner.

I hate topmost windows. I have one application (no source code) that uses that style for some of its subsidiary windows. It gets in the way when I switch to another program.

You can create a topmost window with the WS_EX_TOPMOST extended style. This style option goes in the first argument of CreateWindowEx.

As Nan points out, you can create your own messages. Then you can use them to trigger actions with something like

invoke SendMessage, hwndMainWindow, WM_DOMYFUNCTION, arg1, arg2
Posted on 2001-09-27 17:25:11 by tank
Now I'm really just beginning to see some day lite. Give me a week or two to see what I can come up with from this info. I will post my results with-in two weeks. I think I can do it now. I done learned alot in less than 2 months because of this board, .... But if someone got an example I would over joyed,,, I also now am worry about OOP's and OPT's and the web... Will it ever end....I been very slow but I will get up to (some) speed. I Will Try, but I may never match some off you guys.... HEAVY...HEAVY...HEAVY
Posted on 2001-09-30 03:33:44 by cmax