
Originally Posted by
DatCoder
For starters what language do you use?
Most languages don't store the name of the methods, they reference them by using memory addresses, but you can use Dictionary use map each addresses to Strings but it's usually done with a simple switch. If you tell me more about it we could work something out. What do you want to make? There is usually a better way.
Problem 2: That's what class variables are for (static keyword):
Code:
class Game {
static int something;
}
int Game::something = 1;
main() {
Game one;
Game two;
Game three;
Game::something = 5;
}
The code above is C++, most languages have different syntax.
Code is c#
This is my project: A realm client/wrapper so to speak with many features

I'm using embedding flashplayerprojector using the WinAPI setparent, and sizing it/moving it with MoveWindow.
As you can see here, it has tabbing. Problem is when you resize the form, the flashplayers or games dont resize along with it to their containing tab size.

Right now i'm not handling each client as a class becuase I dont know how to access them to resize them all when the form is resized.
Opening a new tab calls this code, which is in a seperate class from the GUI class that contains all my WinAPI functions a few other things.
[one of the problems that I ran into was that flash projector's handle is destroyed and re-created as a new instance I believe when you open it with a file.
I could get away with just settingparent with just ex.Handle, but that no-longer works when you load a flash file into it, so I then have to getProcessByName to get its new handle]
Code:
public void Embed(IntPtr handle, string file, bool isNewTab) //handle is the handle of the new tab that was created by the user, file is the client location.
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.Arguments = file;
psi.FileName = exeLocation + @"\flashplayer.exe";
ex = Process.Start(psi);
if (isNewTab == false)
{
mainHandle = ex.Handle;
}
Thread.Sleep(1600);
IntPtr ehandle = FindWindowByCaption(IntPtr.Zero, "Adobe Flash Player 11");
SetParent(ehandle, handle);
handleArray.Add(ehandle); //The list mentioned below
SetWindowLong(ehandle, GWL_STYLE, (WS_VISIBLE));
Thread.Sleep(300);
RECT rect;
Rectangle myrect = new Rectangle();
GetWindowRect(new HandleRef(this, ehandle), out rect);
myrect.X = rect.Left;
myrect.Y = rect.Top;
myrect.Width = rect.Right - rect.Left;
myrect.Height = rect.Bottom - rect.Top;
MoveWindow(ehandle, 0, -20, myrect.Width, myrect.Height + 20, true);
}
I have an array(<list>) of all handles that are created so then, when the form is resized:
Code:
public void Resize(int width, int height) //new size of containing tabs (they are all the same size)
{
foreach (IntPtr I in handleArray)
{
MoveWindow(I, 0, -20, width + 2, height + 20, true);
}
}
I'm using a custom tab control that is behaving weird or somthing when the main tab isn't the selected one, so when I resize the from while in a tab other than the main one, the games aren't resized, even the the fricken Resize() function is called..
My god this is a mess, perhaps you could add me on skype?