Question Popup Window Control

Mandella

Space Cultist
Donator
Joined
Apr 5, 2008
Messages
368
Reaction score
0
Points
0
There may be a way of setting this from within Orbiter, but I can't find it.

Is there a way to change the default location of, for instance, the change vessel selection box? Right now it comes up right in the middle of the screen, and I don't like that. I would much prefer it to be stuck up in a corner, like the scenario editor.

Anybody else have use for an addon that would do this?

Feature creep bonus -- it would be great if the box itself was skinnable to something other than "windows standard." It's a touch immersion breaking as is.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
What do you mean by "windows standard" style. My Orbiter uses the window style/theme selected in Control Panel and not the Windows standard (Win95/98) style, but it's Windows XP, so it may be different on the newer ones.

There is no setting in Orbiter that would change the position of that dialog window. The default position is defined by the resource used for it, that is inside of Orbiter.exe:
Code:
189 DIALOGEX 0, 0, 160, 111
STYLE DS_CENTER | WS_POPUP | WS_CAPTION
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Orbiter: Select spacecraft"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
FONT 8, "MS Sans Serif"
{
   CONTROL "", 1154, COMBOBOX, CBS_SIMPLE | CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 0, 3, 159, 95 
   CONTROL "OK", 1, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 97, 50, 14 
}
DS_CENTER defines that this dialog box will be displayed at the center of the screen upon creation. If you have a resource editor that can edit resources directly in executable files, you can change style and even set default position for the window. If you simply remove DS_CENTER flag from the style, dialog box should be drawn at the dialog coordinates defined in the first line from above code (0,0). You only need to edit the DIALOG resource with ID 189 (decimal), and then save it to the Orbiter.exe file.

An add-on, on the other hand, that would change either position or appearance of that window should hook CreateDialogParamA function and inject its own DialogProc that would do moving on dialog initialization and intercept drawing messages of the window for skinning it, before it will call the previous dialog procedure for that window, and this can be done from a plug-in module. I'm not really interested in changing appearance of that window (at least not more than to hide some vessels from it).
 

Mandella

Space Cultist
Donator
Joined
Apr 5, 2008
Messages
368
Reaction score
0
Points
0
My Orbiter uses the window style/theme selected in Control Panel and not the Windows standard (Win95/98) style, but it's Windows XP, so it may be different on the newer ones.

I'm sure mine does too, so I suppose I could experiment with different themes to try to find something a bit more "spacey" when it pops up inside Orbiter.

Can you recommend a good (and preferably free) resource editor? It's been a few years since I've messed with anything like that, but I'm sure I could handle a simple copy and paste.

I wouldn't be breaking Martin's EULA by hacking the executable would I?
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Can you recommend a good (and preferably free) resource editor? It's been a few years since I've messed with anything like that, but I'm sure I could handle a simple copy and paste.
There is very old free executable images' resource editor I use to replace icons in files, which can also compile dialogs, menus, accelerators, etc. It isn't the best one (it isn't Unicode either), but it's sufficient for what I need. I got it with XPize a few years ago, but probably it can be downloaded somewhere separately. It's named reshacker.


I wouldn't be breaking Martin's EULA by hacking the executable would I?
Editing resources isn't really hacking the executable, and you're doing it only for yourself. You won't be redistributing it, will you?
 

Mandella

Space Cultist
Donator
Joined
Apr 5, 2008
Messages
368
Reaction score
0
Points
0
Worked like a charm!

:thumbup:

And of course I will not be redistributing this.

I still can see the use of a separate plugin for those nervous about resource hacking, though.

One of these days I'm going to have to learn C++, or whatever language is in vogue by the time I get around to it..

Thanks again!
 

Izack

Non sequitur
Addon Developer
Joined
Feb 4, 2010
Messages
6,665
Reaction score
13
Points
113
Location
The Wilderness, N.B.
I have a feeling that Orbiter will be written in C++ long after it's out of vogue. :lol:
 
Top