Jump to content

Sign in to follow this  
Guest RasmusS

Window on top of FS

Recommended Posts

Guest RasmusS

HeyIm writing a fsmodule to FS2004. I have encountered some problems witha window on top of FS created by another process than FS's.Currently the program is loaded in to fs as an DLL placed in the modules folder.From the dll i create a window that is placed on top of FS (with ParentWindowset to FS's HWND). Now, here everythings works fine, except that every timei run one of my functions, the FS drawing routine is not called, which makesFS freze in a couple of mili seconds (FPS drop).Because of limitations in BCB6 i cannot run my window in a seperate thread,therfore i want my application to interact with FS as a seprate process.It also makes a lot of other things much easier.Every things works fine, i create my window from a stand alone exe, set theParentWindow to FS's HWND. But here a problem comes up, becuase my form iscreated by another process (i think) FS goes to pause (or the sound disappears)when i click in my window (FS minimizes if fullscreen). So, how doesFS recognize task shifts? And what can i do to let FS think that my windowis a part of FS, to prevent FS to go on pause?I know it is possible, i think that DF did it with their FMC in GA734, right?Thanks for your help...Regards,Rasmus

Share this post


Link to post
Share on other sites

This is a very interesting question. Sorry to say I don't have the answer, but I can tell you FS NAvigator does what you want to do: when the FS Nav window pops up, FS keeps running, the sound is still playing, and your aircraft keeps flying.Eric

Share this post


Link to post
Share on other sites
Guest zip

I don't have any idea, and hopefully someone already has the proper steps to create a window (Arne?), but off the top of my head:1) your child window's message loop is not releasing control fast enough or not forwarding message up the chain (that causes a delay)2) the style for the window (SetWindowLong) is incorrect for child window causing issues with paint messages on the parentHave you tried to create the window as a top level window (not owned), but then assign its ownership to the main FS window? Another thing I'd try is run FS through Spy++ which is part of the Windows SDK (and Visual Studio) and track the windows that you see and explore the handle linkage. Hopefully Borland will have the same tool.This may shed some light as to what the window creation sequence is and why your code is different. Any panel will do to see how it's setup. Just show and hide the panel. The panel window should not be any different from the one you're creating.If anyone has the solution, can you please e-mail me some barebone code to illustrate?Etienne

Share this post


Link to post
Share on other sites
Guest RasmusS

HeyThanks for the ideas, haven't tried all of them yet.But another thing that i discovered, if i createmy window with the style WS_CHILD instead of WS_POPUPthen FS doesn't pause or minimize when i click in thewindow area. But then it seems that the paiting of mywindow goes wrong. In FS, i cannot actually see the window,but if i know where it's placed, i can click on itemson the window, for example a button, it's showed as long as iclick, but then it disappears again. But thefunction is called and FS doesn't go to pause.If it was possbile to get my form painted right here,it could be a solution. Do you have any idea of what goeswrong with the painting? Or maybe another windowstyle combination which would fix the problem?Regards,Rasmus

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...