remember more window positions

This commit is contained in:
zeromus 2008-05-18 21:32:55 +00:00
parent 8a9f4e493b
commit 6fa78df786
3 changed files with 24 additions and 6 deletions

View File

@ -46,6 +46,9 @@ extern int ChtPosX,ChtPosY;
extern int DbgPosX,DbgPosY; extern int DbgPosX,DbgPosY;
extern int MemView_wndx, MemView_wndy; extern int MemView_wndx, MemView_wndy;
extern int MemFind_wndx, MemFind_wndy; extern int MemFind_wndx, MemFind_wndy;
extern int NTViewPosX,NTViewPosY;
extern int PPUViewPosX,PPUViewPosY;
extern int MainWindow_wndx, MainWindow_wndy;
/** /**
* Structure that contains configuration information * Structure that contains configuration information
@ -159,6 +162,12 @@ static CFGSTRUCT fceuconfig[] = {
AC(MemView_wndy), AC(MemView_wndy),
AC(MemFind_wndx), AC(MemFind_wndx),
AC(MemFind_wndy), AC(MemFind_wndy),
AC(NTViewPosX),
AC(NTViewPosY),
AC(PPUViewPosX),
AC(PPUViewPosY),
AC(MainWindow_wndx),
AC(MainWindow_wndy),
//ACS(memwLastfile[2048]), //ACS(memwLastfile[2048]),
ENDCFGSTRUCT ENDCFGSTRUCT

View File

@ -32,6 +32,7 @@
HWND hNTView; HWND hNTView;
int NTViewPosX,NTViewPosY; int NTViewPosX,NTViewPosY;
static uint8 palcache[32]; //palette cache //mbg merge 7/19/06 needed to be static static uint8 palcache[32]; //palette cache //mbg merge 7/19/06 needed to be static
//uint8 ntcache0[0x400],ntcache1[0x400],ntcache2[0x400],ntcache3[0x400]; //cache CHR, fixes a refresh problem when right-clicking //uint8 ntcache0[0x400],ntcache1[0x400],ntcache2[0x400],ntcache3[0x400]; //cache CHR, fixes a refresh problem when right-clicking
uint8 *ntable0, *ntable1, *ntable2, *ntable3; //name table bitmap array uint8 *ntable0, *ntable1, *ntable2, *ntable3; //name table bitmap array
@ -410,7 +411,7 @@ BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch(uMsg) { switch(uMsg) {
case WM_INITDIALOG: case WM_INITDIALOG:
//SetWindowPos(hwndDlg,0,PPUViewPosX,PPUViewPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER); SetWindowPos(hwndDlg,0,NTViewPosX,NTViewPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER);
//prepare the bitmap attributes //prepare the bitmap attributes
//pattern tables //pattern tables
@ -472,8 +473,8 @@ BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
case WM_MOVE: case WM_MOVE:
GetWindowRect(hwndDlg,&wrect); GetWindowRect(hwndDlg,&wrect);
//NTViewPosX = wrect.left; //todo: is this needed? NTViewPosX = wrect.left;
//NTViewPosY = wrect.top; NTViewPosY = wrect.top;
break; break;
case WM_RBUTTONDBLCLK: case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:

View File

@ -98,6 +98,7 @@ static int CheckedAutoFireOffset = MENU_AUTOFIRE_OFFSET_1;
static HMENU recentmenu, recentdmenu; static HMENU recentmenu, recentdmenu;
static LONG WindowXC=1<<30,WindowYC; static LONG WindowXC=1<<30,WindowYC;
int MainWindow_wndx, MainWindow_wndy;
static uint32 mousex,mousey,mouseb; static uint32 mousex,mousey,mouseb;
@ -602,6 +603,13 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
mouseb=wParam; mouseb=wParam;
goto proco; goto proco;
case WM_MOVE: {
RECT wrect;
GetWindowRect(hWnd,&wrect);
MainWindow_wndx = wrect.left;
MainWindow_wndy = wrect.top;
}
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
{ {
mousex=LOWORD(lParam); mousex=LOWORD(lParam);
@ -1329,8 +1337,8 @@ int CreateMainWindow()
"FCEULTRA", "FCEULTRA",
"FCE Ultra", "FCE Ultra",
WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS, /* Style */ WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS, /* Style */
CW_USEDEFAULT, MainWindow_wndx,
CW_USEDEFAULT, MainWindow_wndy,
256, 256,
240, /* X,Y ; Width, Height */ 240, /* X,Y ; Width, Height */
NULL, NULL,
@ -1338,7 +1346,7 @@ int CreateMainWindow()
fceu_hInstance, fceu_hInstance,
NULL ); NULL );
CenterWindowOnScreen(hAppWnd); //CenterWindowOnScreen(hAppWnd);
DragAcceptFiles(hAppWnd, 1); DragAcceptFiles(hAppWnd, 1);