Thema: [VB6] A Few Modules&Functions! Mo Sep 15, 2008 7:40 pm
---------------- OPEN BROWSER:
Put this in Module or on Top!
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
Private Const SW_SHOW = 1
Public Sub Navigate(ByVal NavTo As String) Dim hBrowse As Long hBrowse = ShellExecute(0&, "open", NavTo, "", "", SW_SHOW) End Sub
---------------- Protect your Project with a Password:
Create...
A new Form 1 Textbox 1 Button 1 Label
Label:
Write in for example... "Enter here the Password!"
Button:
Code:
If Text1.text = "PASSWORD" then 'PASSWORD = Your Password! Form2.Show 'If you made a second form! End if
---------------- Set window on TOP:
Create...
A timer ( Set interval to 1 )
Code...
Module:
Code:
Private Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
General:
Code:
'this code makes the window stay on top: 'rtn = SetWindowPos(<form name>.hwnd, -1, 0, 0, 0, 0, 3)
'window will not stay on top with this code: 'rtn = SetWindowPos(<form name>.hwnd, -2, 0, 0, 0, 0, 3)