X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fwin32%2FGenaDrive%2FMain.cpp;h=f5f41cc3c66c7750a04459050148f1a7122ddab1;hb=03a265e5ebabff7adbb4f97387f81e9b0428dbee;hp=acc8fcdc997a6e3c971f565e45e0697415cea6ba;hpb=7c9e6899a2c3fd0dfeafa1c6cda1593741d635d4;p=picodrive.git diff --git a/platform/win32/GenaDrive/Main.cpp b/platform/win32/GenaDrive/Main.cpp index acc8fcd..f5f41cc 100644 --- a/platform/win32/GenaDrive/Main.cpp +++ b/platform/win32/GenaDrive/Main.cpp @@ -5,14 +5,21 @@ char *romname; HWND FrameWnd=NULL; +RECT FrameRectMy; int MainWidth=720,MainHeight=480; // Window proc for the frame window: static LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam) { - if (msg==WM_CLOSE) { PostQuitMessage(0); return 0; } - if (msg==WM_DESTROY) FrameWnd=NULL; // Blank handle + switch (msg) + { + case WM_CLOSE: PostQuitMessage(0); return 0; + case WM_DESTROY: FrameWnd=NULL; break; // Blank handle + case WM_SIZE: + case WM_MOVE: + case WM_SIZING: GetWindowRect(hwnd, &FrameRectMy); break; + } return DefWindowProc(hwnd,msg,wparam,lparam); } @@ -55,6 +62,10 @@ static int FrameInit() FrameWnd=CreateWindow(wc.lpszClassName,"PicoDrive " VERSION,style|WS_VISIBLE, left,top,width,height,NULL,NULL,NULL,NULL); + ShowWindow(FrameWnd, SW_NORMAL); + UpdateWindow(FrameWnd); + GetWindowRect(FrameWnd, &FrameRectMy); + return 0; } @@ -75,15 +86,16 @@ int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR cmdline,int) unsigned char *rom_data = 0; unsigned int rom_size = 0; + static char rompath[MAX_PATH] = { 0, }; + pm_file *rom = NULL; + FrameInit(); ret=LoopInit(); if (ret) goto end0; // notaz: load rom - static char rompath[MAX_PATH]; rompath[0] = 0; strcpy(rompath, cmdline + (cmdline[0] == '\"' ? 1 : 0)); if(rompath[strlen(rompath)-1] == '\"') rompath[strlen(rompath)-1] = 0; - pm_file *rom = 0; if(strlen(rompath) > 4) rom = pm_open(rompath); if(!rom) { OPENFILENAME of; ZeroMemory(&of, sizeof(OPENFILENAME));