diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 079680c1..1412ce7b 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -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; diff --git a/src/drivers/win/window.h b/src/drivers/win/window.h index f5bebd7c..5db75113 100644 --- a/src/drivers/win/window.h +++ b/src/drivers/win/window.h @@ -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);