Marook-Online
* 09.Sep.2010, 15:02 UTC+1
Welcome, Guest. Please login or register.
Username:
Password:

News: Back again Wink
Main Menu
  Navigation
   Downloads
     Tools
     Music Discs
     SMF Mods
     Trainer & Patches
     EgoShare Uploader
   Guestbook
   NoPaste
   User Map
   Gallery
  
   Malware Scan
   Hacker Blacklist
   Find Abusemail
Top Downloads
Support Me !
Help me by donating a small amount!



Advanced search

Google


Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read
03-May-2008 19:53
Marook
Administrator
*****
Offline Offline

Joined: 01-Jan-2005
Posts: 224


Hi,

know one of this special cases where you want a user can choose a file to open? All you need is a Open File Dialog and these few lines of code Wink

Code
GeSHi (vb):
  1. Private Function ShowOpen(hWndOwner As Long, sFilter As String, sTitle As String, Optional sDir As String = "", Optional nFlags As Long = OFN_EXPLORER) As String
  2.  'Fill the struct with some data ;)
  3.  OFName.lStructSize = Len(OFName)
  4.  OFName.hWndOwner = hWndOwner
  5.  OFName.hInstance = App.hInstance
  6.  'The filter should be something like this :
  7.  'filter-name|*.filter-extension|filter-name2|*.filter-extension2
  8.  'Example: All Files (*.*)|*.*|VB-Projects (*.VBP)|*.vbp ... and so on
  9.  OFName.lpstrFilter = Replace$(sFilter, "|", vbNullChar)
  10.  OFName.lpstrFile = String(255, vbNullChar)
  11.  'Maximum number of selectable files
  12.  OFName.nMaxFile = 255
  13.  OFName.lpstrFileTitle = String(255, vbNullChar)
  14.  OFName.nMaxFileTitle = 255
  15.  OFName.lpstrTitle = sTitle
  16.  OFName.flags = nFlags
  17.  OFName.lpstrInitialDir = sDir
  18.  
  19.  If GetOpenFileName(OFName) Then
  20.    ShowOpen = Replace$(OFName.lpstrFile, vbNullChar, "")
  21.  Else
  22.    ShowOpen = ""
  23.  End If
  24. End Function
  25.  
Created by GeSHI 1.0.7.20

This is the main function, you need some declarations as well...

 

I've attached a sample application... so have fun Wink
Members Only - This post contains information only for members!
« Last Edit: 03-May-2008 19:56 by Marook » Logged
 

Pages: [1]   Go Up
Jump to:  

Theme by webtechnica.net

MHD v2.1 © 2oo8 by Marook
26008 hacking attempts defended!