set up a GetMainHWND function so child windows can get the parent handle easily

This commit is contained in:
adelikat 2009-06-25 02:39:38 +00:00
parent ae60f641c2
commit c4236dd151
2 changed files with 9 additions and 0 deletions

View File

@ -86,6 +86,7 @@ static HMENU recentluamenu; //Recent Lua Files Menu
static HMENU recentmoviemenu; //Recent Movie Files Menu
HMENU hfceuxcontext; //Handle to context menu
HMENU hfceuxcontextsub; //Handle to context sub menu
HWND MainhWnd; //Main FCEUX(Parent) window Handle. Dialogs should use GetMainHWND() to get this
//Extern variables-------------------------------------
extern bool movieSubtitles;
@ -157,6 +158,11 @@ string gettingstartedhelp = "{C76AEBD9-1E27-4045-8A37-69E5A52D0F9A}";//Getting S
//********************************************************************************
HWND GetMainHWND()
{
return MainhWnd;
}
int GetCheckedAutoFirePattern()
{
//adelikat: sorry, I'm sure there is an easier way to accomplish this.
@ -1093,6 +1099,7 @@ void GetMouseData(uint32 (&md)[3])
//Message loop of the main window
LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
MainhWnd = hWnd;
int whichContext = 0;
POINT pt;
RECT file_rect;

View File

@ -21,6 +21,8 @@ extern char *recent_lua[];
extern char *recent_movie[];
extern HWND pwindow;
HWND GetMainHWND();
void HideFWindow(int h);
void SetMainWindowStuff();
int GetClientAbsRect(LPRECT lpRect);