View Full Version : [Q] Giup toi voi ve cai wallpaper
baotrung
25-09-2002, 20:50
Lam sao viet ct set set wallpaper cho screen theo kieu "tile" or "stretch" ?
cam on nhieu.
Tui chỉ có thể làm thay đổi Wallpaper trên desktop thôi chứ làm thay đổi theo kiểu Title or Stretch thì chưa thử.
Để thay đổi Wallpaper dùng hàm SystemParametersInfo.
Nếu cần tui sẽ gửi source lên.
baotrung
26-09-2002, 12:35
Cảm ơn bạn đã trả lời, tôi đã dùng hàm SystemParametersInfo
để set wallpaper nhưng default của nó là 'center' không cách nào set kiểu tile hay stretch như windows được. nếu bạn tìm ra xin chỉ mình với.
Thanks
Vấn đề của bạn hay nhỉ ? Bạn thử sửa trong Registry xem, mình không nhớ rõ là chỗ nào nhưng mà bạn cứ vào regedit search từ Wallpaper sau đó tìm thử !
Chúc may mắn !!!
Bài viết được gửi bởi baotrung
Cảm ơn bạn đã trả lời, tôi đã dùng hàm SystemParametersInfo
để set wallpaper nhưng default của nó là 'center' không cách nào set kiểu tile hay stretch như windows được. nếu bạn tìm ra xin chỉ mình với.
Thanks
Vậy hả, bạn thử đoạn code này xem sao:
----------------------------------------------------------------
Thay đổi Windows wallpaper dùng hàm API: SystemParametersInfo.
Private Sub Command1_Click()
Dim temp As Long
Dim Wallpaper As String
Dim filename As String
CommonDialog1.Action = 1
filename = CommonDialog1.filename
Wallpaper = filename
If Wallpaper = "" Then Exit Sub
temp = SystemParametersInfo(ByVal 20, vbnostring, ByVal Wallpaper, &H1)
If temp = 0 Then
MousePointer = 0
MsgBox "Lỗi khi thay đổi wallpaper"
Exit Sub
End If
End Sub
----------------------------------------------------------------
Xong bạn ra desktop thử ấn F5 xem
Chúc vui :-)
temp = SystemParametersInfo(ByVal 20, vbnostring, ByVal Wallpaper, &H1)
TRong dong tren thi cho nao de set Center hay Stretch ? A bac co biet lam sao de set 1 trang web thanh wallpaper khong ?
Vẫn khong được anh VTHung ui !
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.