Current News
Archived News
Search News
Discussion Forum


Old Forum
Install Programs More Downloads...
Troubleshooting
Source Code
Format Specs.
Misc. Information
Non-SF Stuff
Links




index d9c3660..7ad253c 100644 (file)
@@ -1,42 +1,42 @@
-Attribute VB_Name = "FixWindowIcon"
-Option Explicit
-
-Private Const WM_SETICON = &H80
-Private Const ICON_SMALL = 0
-Private Const IMAGE_ICON = 1
-Private Const LR_DEFAULTSIZE = &H40
-
-Private Declare Function GetModuleHandle Lib "Kernel32.dll" _
-    Alias "GetModuleHandleA" _
-    (ByRef lpModuleName As Any) As Long
-Private Declare Function LoadImage Lib "User32.dll" _
-    Alias "LoadImageA" ( _
-    ByVal hinst As Long, _
-    ByRef lpszName As Any, _
-    ByVal uType As Long, _
-    ByVal cxDesired As Long, _
-    ByVal cyDesired As Long, _
-    ByVal fuLoad As Long) As Long
-Private Declare Function SendMessageA Lib _
-    "User32.dll" _
-    (ByVal hWnd As Long, _
-    ByVal Msg As Long, _
-    ByVal Wp As Long, _
-    Lp As Any) As Long
-
-Sub FixIcon(hWnd As Long, lpszName)
-Dim hModule As Long, hIcon As Long, szName As String, nName As Long, Width As Long, Height As Long
-hModule = GetModuleHandle(ByVal 0&)
-If hModule = 0 Then Exit Sub
-Width = Abs(GetReg("HKEY_USERS\.Default\Control Panel\Desktop\WindowMetrics\CaptionWidth", -270)) / Screen.TwipsPerPixelX - 2
-Height = Abs(GetReg("HKEY_USERS\.Default\Control Panel\Desktop\WindowMetrics\CaptionHeight", -270)) / Screen.TwipsPerPixelY - 2
-If VarType(lpszName) = vbString Then
-    szName = lpszName
-    hIcon = LoadImage(hModule, szName, IMAGE_ICON, Width, Height, LR_DEFAULTSIZE)
-ElseIf VarType(lpszName) = vbByte Or VarType(lpszName) = vbInteger Or VarType(lpszName) = vbLong Then
-    nName = lpszName
-    hIcon = LoadImage(hModule, ByVal nName, IMAGE_ICON, Width, Height, LR_DEFAULTSIZE)
-End If
-If hIcon = 0 Then Exit Sub
-SendMessageA hWnd, WM_SETICON, ICON_SMALL, ByVal hIcon
-End Sub
+Attribute VB_Name = "FixWindowIcon"\r
+Option Explicit\r
+\r
+Private Const WM_SETICON = &H80\r
+Private Const ICON_SMALL = 0\r
+Private Const IMAGE_ICON = 1\r
+Private Const LR_DEFAULTSIZE = &H40\r
+\r
+Private Declare Function GetModuleHandle Lib "Kernel32.dll" _\r
+    Alias "GetModuleHandleA" _\r
+    (ByRef lpModuleName As Any) As Long\r
+Private Declare Function LoadImage Lib "User32.dll" _\r
+    Alias "LoadImageA" ( _\r
+    ByVal hinst As Long, _\r
+    ByRef lpszName As Any, _\r
+    ByVal uType As Long, _\r
+    ByVal cxDesired As Long, _\r
+    ByVal cyDesired As Long, _\r
+    ByVal fuLoad As Long) As Long\r
+Private Declare Function SendMessageA Lib _\r
+    "User32.dll" _\r
+    (ByVal hWnd As Long, _\r
+    ByVal Msg As Long, _\r
+    ByVal Wp As Long, _\r
+    Lp As Any) As Long\r
+\r
+Sub FixIcon(hWnd As Long, lpszName)\r
+Dim hModule As Long, hIcon As Long, szName As String, nName As Long, Width As Long, Height As Long\r
+hModule = GetModuleHandle(ByVal 0&)\r
+If hModule = 0 Then Exit Sub\r
+Width = Abs(GetReg("HKEY_USERS\.Default\Control Panel\Desktop\WindowMetrics\CaptionWidth", -270)) / Screen.TwipsPerPixelX - 2\r
+Height = Abs(GetReg("HKEY_USERS\.Default\Control Panel\Desktop\WindowMetrics\CaptionHeight", -270)) / Screen.TwipsPerPixelY - 2\r
+If VarType(lpszName) = vbString Then\r
+    szName = lpszName\r
+    hIcon = LoadImage(hModule, szName, IMAGE_ICON, Width, Height, LR_DEFAULTSIZE)\r
+ElseIf VarType(lpszName) = vbByte Or VarType(lpszName) = vbInteger Or VarType(lpszName) = vbLong Then\r
+    nName = lpszName\r
+    hIcon = LoadImage(hModule, ByVal nName, IMAGE_ICON, Width, Height, LR_DEFAULTSIZE)\r
+End If\r
+If hIcon = 0 Then Exit Sub\r
+SendMessageA hWnd, WM_SETICON, ICON_SMALL, ByVal hIcon\r
+End Sub\r