OPENFILENAME ofn;
void loadSaveGame(){  OPENFILENAME ofn;  char * p = strrchr(filename,'\\');  if(p)    p++;  else    p = filename;  char * saveDir = regQueryStringValue("saveDir", NULL);  if(!saveDir)    saveDir = getDirFromFile(filename);    if(isDriveRoot(saveDir))    sprintf(szFile, "%s%s.sgm", saveDir, p);  else    sprintf(szFile, "%s\\%s.sgm", saveDir, p);    ZeroMemory(&ofn, sizeof(OPENFILENAME));  ofn.lStructSize = sizeof(OPENFILENAME);  ofn.hwndOwner = hWindow;  ofn.lpstrFile = szFile;  ofn.nMaxFile = sizeof(szFile);  ofn.lpstrFilter = winLoadFilter(IDS_FILTER_SGM);  ofn.nFilterIndex = 0;  ofn.lpstrFileTitle = NULL;  ofn.nMaxFileTitle = 0;  ofn.lpstrInitialDir = (const char *)saveDir;  ofn.lpstrTitle = winResLoadString(IDS_SELECT_SAVE_GAME_NAME);  ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;  if(videoOption == VIDEO_320x240) {    ofn.lpTemplateName = MAKEINTRESOURCE(IDD_OPENDLG);    ofn.Flags |= OFN_ENABLETEMPLATE;  }    if(GetOpenFileName(&ofn) == FALSE) {    DWORD res = CommDlgExtendedError();    return;  }  emuReadState(ofn.lpstrFile);    systemScreenMessage((char *)winResLoadString(IDS_LOADED_STATE));  }