Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.35 KB | None | 0 0
  1. unsigned ThreadedFileBrowse( void *params )
  2. {
  3.     C_ArcadeResources* pClientArcadeResources = C_ArcadeResources::GetSelf();
  4.  
  5.     HWND myHWnd = FindWindow(null, "Anarchy Arcade");
  6.  
  7.     ThreadedFileBrowseParams_t* vars = (ThreadedFileBrowseParams_t*) params; // always use a struct!
  8.  
  9.     OPENFILENAME ofn ;
  10.     char szFile[MAX_PATH] ;
  11.     ZeroMemory( &ofn , sizeof( ofn));
  12.     ofn.lStructSize = sizeof ( ofn );
  13.     ofn.hwndOwner = myHWnd;
  14.     ofn.lpstrFile = szFile ;
  15.     ofn.lpstrFile[0] = '\0';
  16.     ofn.nMaxFile = sizeof( szFile );
  17.     ofn.lpstrFilter = "All\0*.*\0Images\0*.BMP;*.ICO;*.GIF;*.JPG;*.JPEG;*.JPE;*.JP2;*.PCX;*.PIC;*.PNG;*.PIX;*.RAW;*.TGA;*.TIF;*.VTF;*.TBN\0Videos\0*.MPG;*.MPEG;*.AVI;*.MKV;*.MP4;*.MPG;*.MPEG;*.FLV;*.BIN;*.ISO;*.VOB\0Executables\0*.EXE\0Steam Shortcuts\0*.URL\0";
  18.     ofn.nFilterIndex = 1;
  19.     ofn.lpstrFileTitle = NULL ;
  20.     ofn.nMaxFileTitle = 0 ;
  21.     ofn.lpstrInitialDir=NULL ;
  22.     ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ;
  23. //  ofn.Flags = 0;
  24. //  ofn.Flags = NULL;
  25.     GetOpenFileName( &ofn );
  26.  
  27.     std::string buf = ofn.lpstrFile;
  28.  
  29.     vars->response = VarArgs("%s", buf.c_str());
  30.     vars->ready = true;
  31. //  if( vars->listener )
  32. //      vars->listener->BrowseCallback(buf.c_str(), vars->keyFieldName.c_str(), vars->itemKV);
  33. //  else if( vars->browser )
  34. //      vars->browser->BrowseCallback(buf.c_str(), vars->keyFieldName.c_str(), vars->itemKV);
  35.  
  36. //  delete vars;
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement