# vb tricks



## Manojap (Mar 13, 2005)

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=â€?*www.manojapnair.bravehost.comâ€?
End Sub
 :roll:  :roll:


----------



## rajkumar_personal (Mar 13, 2005)

Why don't u mention that u have copied the sources from VB progs written by others ?

All of this crap can be easily located on 
www.planetsourcecode.com

MENTION the place u have copied stuff.......ALWAYS !!!


----------



## sms_solver (Mar 14, 2005)

the above tut given by *Manojap* is useful. A new to VB must try it.


----------



## //siddhartha// (Mar 14, 2005)

Can anybody suggest me VB.NET tricks for making a simple calculator for calculating marks and percentage of exam results for 7 subjects...


----------



## h4xbox (Mar 14, 2005)

is tht a trick ?? I guess u are requesting a program


----------



## Manojap (Mar 19, 2005)

rajkumar_personal said:
			
		

> Why don't u mention that u have copied the sources from VB progs written by others ?
> 
> All of this **** can be easily located on
> www.planetsourcecode.com
> ...




The program is completely my own,who says it found on  palnet....manoj


----------



## Manojap (Mar 19, 2005)

I get one copy of this prgrm from   Developer IQ CD,last year


----------



## Tux (Mar 25, 2005)

I am developed a TIC TAC TOE game with AI.
Computers responds to our steps wisley.
But its a 250 + pg code. 
Any body wants it.


----------



## tuxfan (Mar 26, 2005)

Yes mr Tux aka Ash  I want it. How can you send it to me?


----------



## rajkumar_personal (Mar 27, 2005)

Yeah.............................
I'm Interested in ur program Tux !
Plz mail it to me since I guess it would be difficult to post the bulky document here !
Plz include all the forms and other files in a  zip archieve !


----------



## Tux (Mar 27, 2005)

rajkumar_personal said:
			
		

> Yeah.............................
> I'm Interested in ur program Tux !
> Plz mail it to me since I guess it would be difficult to post the bulky document here !
> Plz include all the forms and other files in a  zip archieve !



I've sent it. There is still a bug.
And I just can't correct it.
Though the bug don't create problem.


----------



## Tux (Mar 27, 2005)

tuxfan said:
			
		

> Yes mr Tux *aka Ash * I want it. How can you send it to me?




why don't u give your email id.
and thank that u r my fan.
U R TUXFAN
and i am TUX.
And also delete aka ash


----------



## technovice (Mar 31, 2005)

Hi!! Tux
Can i get the game too!
It would be great if you can provide the source code with it!
i'll pm my email id if its ok with you!


----------



## Tux (Apr 1, 2005)

Send it buddy. I'll give you the whole
source code and forms along.
Its OK . Send your email-id.


----------



## Tux (Apr 1, 2005)

DAMN TIRED of sending it to people.
But that doesn't means u won't get it.

Log on to
tictactoetux@rediffmail.com
with the password "thanku" and download
the massage from "SNEHASIS GHOSH"
with no subject. Download the attacment and check it out


----------



## Tux (Apr 10, 2005)

hOW WAS TH PROG. sOMEONE REPLY PLZ


----------



## igeek (Apr 11, 2005)

Tux said:
			
		

> hOW WAS TH PROG. sOMEONE REPLY PLZ


I just downloaded it & tried it. It looks ok but its just sort of basic, no? I was able to beat it in 4 straight moves 5 times before getting a draw the 6th time. When you mentioned AI, I thought something hi-fi, you know.....   

Still, its not bad!!!


----------



## Tux (Apr 13, 2005)

igeek said:
			
		

> Tux said:
> 
> 
> 
> ...



I know I know.
Its damn basic.
But Read the README. U'll know why.


----------



## igeek (Apr 13, 2005)

Tux said:
			
		

> I know I know.
> Its damn basic.
> But Read the README. U'll know why.


----------



## Tux (Apr 14, 2005)

igeek said:
			
		

> Tux said:
> 
> 
> 
> ...



tnks for repling


----------



## casanova (Aug 1, 2006)

Tux, I aslos need ur proggy. instead of sending it individually , u can upload it to rapidshare and post the link.


----------



## Venom (Aug 1, 2006)

Cant you notice Tux isnt a member here anymore? Why dig up useless threads...


----------

