Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Const SPI_SETDESKWALLPAPER = 20
U KOMANDI
Dim ChangeWP
Dim source As String
source = "putanja i naziv slike"
ChangeWP = SystemParametersInfo(SPI_SETDESKWALLPAPER, 1, source, 1)
Ukoliko vam se dopada, rado cu podeliti jos neke sa vama, samo mi dajte vremena da ih sredim i ucinim citljivim
DOPUNA:
Kako pozvati office asistenta i kontrolisati ga?
UCITAVANJE:
Dim FormLeft As Integer
Dim FormTop As Integer
Dim LocalPath As String
Dim AgentName As String
Dim Agent
Private Sub Form_Load()
LocalPath = "C:WindowsMSAgentChars"
AgentName = "Merlin"
Set Agent = CreateObject("agent.control.1")
Agent.connected = True
Agent.Characters.Load AgentName, LocalPath & AgentName & ".acs"
Agent.Characters(AgentName).Show
End Sub
KONTROLA:
Private Sub Command1_Click()
Agent.Characters(AgentName).Play "evde uneti jednu od dole postavljenuh komandi"
End Sub
kako otvoriti i zatvoriti primarni cd uredjaj pomocu VB-a?
Private Declare Function mciSendString Lib "winmm.dll" Alias"mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long 'SVE TREBA BITI U JEDNOM REDU
Private Sub otvori_Click()
retvalue = mciSendString("set CDAudio door open", returnstring, 127, 0)
End Sub
Private Sub zatvori_Click()
retvalue = mciSendString("set CDAudio door closed", returnstring, 127, 0)
End Sub
DOPUNA:
kako iskljuciti kompjuter?
Private Const EWX_SHUTDOWN As Long = 1
Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Private Sub Command1_Click()
lngResult = ExitWindowsEx(EWX_SHUTDOWN, 0&)
End Sub
Kako se izlogovati iz Windowsa?
Private Const EWX_LogOff As Long = 0
Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Private Sub Command1_Click()
lngResult = ExitWindowsEx(EWX_LogOff, 0&)
End Sub
Kako restartovati kompjutrer?
Private Const EWX_REBOOT As Long = 2
Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Private Sub Command1_Click()
lngResult = ExitWindowsEx(EWX_REBOOT, 0&)
End Sub
kako sakriti kursor?
u modulu:
Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
u komandi:
Private Sub sakri_Click()
ShowCursor (False)
End Sub
Private Sub vrati_Click()
ShowCursor (True)
End Sub
Odlicna ideja.Svaka cast za temu!
Evo nekih kodova iz moje kolekcije:
-----------------------------------------------------------------------------
Dim x as Form1
set x=new Form1
x.show
-> Prikazuje jos jednu form1
----------------------------------------------
Kod za skidanje i vracanja procesa u Task Manager:
public declare function getcurrentprocessid lib "kernel32" () as long
public declare function getcurrentprocess lib "kernel32" () as long
public declare function registerserviceprocess lib "kernel32" (byval dwprocessID as long,byval dwType as long) as long
public const RSP_SIMPLE_SERVICE=1
public const RSP_UNREGISTER_SERVICE=0
public sub Rem() 'sakriva proces
dim processid as long
dim return as long
processid=getcurrentprocessid()
return=registerserviceprocess(pid,RSP_SIMPLE_SERVICE) 'pid je processid
end sub
za vracanje procesa u task manager sve je isto osim sto je
return=registerserviceprocess(pid,RSP_UNREGISTER_SERVICE)
------------------------------------------------------------------------------
Dodavanje u listu svih ekranskih fontova:
dim i
for i=0 to screen.fontcount -1
list1.additem screen.fonts(i)
next i
--------------------------------------------------------------------------------
Dim fso,f
set fso = createobject("scripting.filesystemobject")
set f=fso.getfile(text1.text)
msgbox f.shortname
->Uzima fajl sa adrese napisane u text1 i u msgbox-u prikazuje kratko ime fajla (za scandisk.log pokazace scan~.log)
---------------------------------------------------------------------------------
screen.activecontrol -> govori koja kontrola ima focus
---------------------------------------------------------------------------------
mystr=string(5,"B")
->mystring ce postati BBBBB
---------------------------------------------------------------------------------
_________________ Losa vest: bices obesen.
Dobra vest: samo 5 minuta.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum