dont get this:

azzic7
09-06-2003, 09:31 AM
i read this code:


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
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
ShellExecute Me.hwnd, vbNullString, "mailto:KPDTeam@Allapi.net", vbNullString, "C:\", SW_SHOWNORMAL
End Sub



i understand all this code but wot bugs me is this part:


ShellExecute Me.hwnd


what does Me.hwnd mean?

masnick-CCCP
09-06-2003, 09:40 AM
Me.hwnd is window handle of the form where the code is.

passel
09-06-2003, 09:42 AM
All windows have a "handle" that windows uses to keep track of
the "windows". "Me" is shorthand for the current Form, and hwnd is a
property that allows you to reference the "handle" that windows is using
to keep track of your form, so that you can pass it to the API calls that
require the handle.

In this case, I don't know if there is any advantage of using the API call
ShellExecute, as opposed to using the Shell command built into
Visual Basic itself, since the Shell command probably ends up doing the
same thing, but takes care of the hwnd, etc... for you.

azzic7
09-06-2003, 01:18 PM
thanx Passel, but can i ask with the word Me can i change it to the form name or does it have to stay as Me??

passel
09-06-2003, 01:32 PM
You can use the form name. Me is just a convienence and comes in
handy sometimes with multiple forms.

azzic7
09-06-2003, 01:33 PM
thanx for clearing that up with me

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum