User Tools

Site Tools


vb6_recipes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

vb6_recipes [2017/01/05 06:52] (current)
felixonmars created
Line 1: Line 1:
 +==== Hand Cursor (For Windows <= XP) ====
 +API:
 +<​code>​
 +Private Declare Function SetCursor Lib "​user32"​ (ByVal hCursor As Long) As Long
 +</​code>​
 +
 +Add to `MouseMove`:​
 +<​code>​
 +If Button = 0 Then SetCursor 65581
 +</​code>​
 +
 +==== Move Window By Object ====
 +API:
 +<​code>​
 +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
 +</​code>​
 +
 +Add to `MouseDown`:​
 +<​code>​
 +If Button = vbLeftButton Then
 +    ReleaseCapture
 +    SendMessage Me.hwnd, WM_SYSCOMMAND,​ SC_MOVE, 0
 +End If
 +</​code>​
 +
 +==== Open URL With Default Browser ====
 +API:
 +<​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
 +</​code>​
 +
 +Add to anywhere:
 +<​code>​
 +Result = ShellExecute(0,​ vbNullString,​ "​http://​felixc.at",​ vbNullString,​ vbNullString,​ SW_SHOWNORMAL)
 +</​code>​
 +
 +References:
 +
 +  * http://​zhidao.baidu.com/​question/​35015200
  
vb6_recipes.txt ยท Last modified: 2017/01/05 06:52 by felixonmars