Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 19-02-2005, 11:06 AM   #1 (permalink)
Right Off the Assembly Line
 
Manojap's Avatar
 
Join Date: Oct 2004
Location: India,kerala
Posts: 28
Default Some vb tricks for begginers


Pls copy paste these code to ur visual basic form’s code section.

1.Invoke folder selection dialog box to ur Visual Basic application / use of windows handles

Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Const BIF_RETURNONLYFSDIRS = &H1
Private Declare Function SHGetPathFromIDList Lib "SHELL32.DLL" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "SHELL32.DLL" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long 'ITEMIDLIST

Public Function BrowseFolder(hWnd As Long, szDialogTitle As String) As String
' Syntax: StrVar = BrowseFolder(hWnd, StrVar)
On Local Error Resume Next
Dim X As Long, BI As BROWSEINFO, dwIList As Long, szPath As String, wPos As Integer
BI.hOwner = hWnd
BI.lpszTitle = szDialogTitle
BI.ulFlags = BIF_RETURNONLYFSDIRS
dwIList = SHBrowseForFolder(BI)
szPath = Space$(512)
X = SHGetPathFromIDList(ByVal dwIList, ByVal szPath)
If X Then
wPos = InStr(szPath, Chr(0))
BrowseFolder = Trim(Left$(szPath, wPos - 1))
Else
BrowseFolder = vbNullString
End If
End Function

Private Sub Form_Click()
Dim sFileName As String
sFileName = BrowseFolder(Me.hWnd, "Select the folder to Protect")

End Sub


2.Function to Check whether a folder exist or not , this function will return true if the folder exist.Pls modify above code..

Public Function IsFolderExists(FolderName As String) As Boolean
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
IsFolderExists = fs.FolderExists(FolderName)
End Function

Private Sub Form_Click()
Dim sFileName As String
sFileName = BrowseFolder(Me.hWnd, "Select the folder to Protect")
MsgBox (IsFolderExists(sFileName))
End Sub

3.Run a weblink or mailto link using shell command from Visual Basic application/set hypperlink.

General Declaration section
Private Declare Function ShellExecute Lib "SHELL32.DLL" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As
Long
Private Const AppName = "Dictionary"


Private Sub mail_Click()
ShellExecute 0, "Open", "mailto:" & mail.Caption, vbNullString, vbNullString, vbNormal
End Sub

Private Sub web_Click()
ShellExecute 0, "Open", web.Caption, vbNullString, vbNullString, vbNormal
End Sub
Private Sub Form_Load()
mail.caption=�maojap.nair@gmail.com�
web.caption=�http://www.manojapnair.bravehost.com�
End Sub


:roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll:
__________________
manojap
Manojap is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 19-02-2005, 11:38 AM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Feb 2005
Posts: 21
Default

I recently submitted a VB APP to www.pscode.com. Converts your Exe Files into Trial Versions. Uses rock solid Public Key Encryption technology

take a look: http://b.domaindlx.com/discbreaker/votepage.asp
__________________
Portus
Portus is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Tenida
- by Charan
- by abhidev

Advertisement




All times are GMT +5.5. The time now is 10:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2