User Tools

Site Tools


Sidebar

vb6_recipes

Hand Cursor (For Windows <= XP)

API:

Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long

Add to `MouseMove`:

If Button = 0 Then SetCursor 65581

Move Window By Object

API:

Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_SYSCOMMAND = &HA1
Const SC_MOVE = 2

Add to `MouseDown`:

If Button = vbLeftButton Then
    ReleaseCapture
    SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MOVE, 0
End If

Open URL With Default Browser

API:

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

Add to anywhere:

Result = ShellExecute(0, vbNullString, "http://felixc.at", vbNullString, vbNullString, SW_SHOWNORMAL)

References:

vb6_recipes.txt · Last modified: 2017/01/05 06:52 by felixonmars