Get a apps window (non rev) to stick to rev stack

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Get a apps window (non rev) to stick to rev stack

Post by keyless » Tue Feb 03, 2009 12:06 am

I have a small application (C++). I don't need to interact with the app, but I would like the applications window to stick to a rect on my Rev stack. Is there anyway to do this?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Tue Feb 03, 2009 4:52 am

How about getting the windowhandle of the menubar and then using the rect of that? I see it with a windowtitle of "Revolution" and a windowclass of "MCWinClassW".

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Tue Feb 03, 2009 6:18 am

mwieder wrote:How about getting the windowhandle of the menubar and then using the rect of that? I see it with a windowtitle of "Revolution" and a windowclass of "MCWinClassW".
Hey Mark, I want to clearify, I'm trying to get the C++ apps window to stick to rect in the Rev window.

I can definitly get the WindowHandle and class of the C++ app, but what I'm wondering is then how in Rev to set that window to the loc rec I've placed on the card. Are you able to use WindowHandles in rev?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Tue Feb 03, 2009 7:02 am

You can either poll at regular intervals from your C++ app, or use some form of inter-application communication (sockets, stdin/stdout) to keep the other application current of your stack's location.
Or perhaps you can write an external command that seeks out the C++ application window and moves it along, and call that from your script.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Tue Feb 03, 2009 7:17 am

Sorry - I read your post as "I want my c++ app to stick to the rev menubar", which you could do from your c++ app by finding the menubar window and setting the rect of your app to one of its sides.

If you want your c++ app to live in a rect within a rev app then you'll have to deal with stack resizing and moving, so I'd go with the sockets approach for ipc, as Jan suggested.

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Tue Feb 03, 2009 7:01 pm

thanks for the info. I was thinking this from what Jan said, I could have the C++ program check an environmental variable that I set from Rev with the Rect location and move window accordingly. Though I actually like Mark's semi-docking idea now that I see what you meant.

Though I suppose an external would be ideal. I've mulled over what info is around for building externals and am not completly sure I'm up to that challange yet.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Feb 04, 2009 7:07 am

The environment variable isn't going to change or your C++ application: changes to the environment variables are only passed to the child process once, on startup from within Revolution. So you'll probably want sockets or pipes to transfer the locations.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Thu Feb 05, 2009 4:51 am

Janschenkel wrote:The environment variable isn't going to change or your C++ application: changes to the environment variables are only passed to the child process once, on startup from within Revolution. So you'll probably want sockets or pipes to transfer the locations.

Jan Schenkel.
actually I was thinking more along the lines of using setx in the shell (and something like it for mac) but someone has told me that won't work well either.

I think it shouldn't be to hard actualyl to do a little math off the window location of the rev app in the C++ app, For the programmer that is, haven't touched C++ myself yet.

@ Mark - The size of the window is locked so I can get away with this, this time.

.....Actually an idea just popped into my head, if there exists a small web server that can do ASP....hmmm

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Post by WaltBrown » Tue Jun 23, 2009 8:29 am

Loosely related to this, I can get the stack windowID and an image pixmapID, are there any examples of how to get their HWND for an external's use? I thought I had seen one in here but now cannot find it.

Thanks,
Walt
Walt Brown
Omnis traductor traditor

Post Reply