Explorer Forum Forum Index -> Visual Basic -> Korisni kodovi iz moje kolekcije
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic 
Korisni kodovi iz moje kolekcije
PostPosted: Mon Sep 25, 2006 7:14 pm Reply with quote
nox
Vodnik
 
Joined: 14 Sep 2006
Posts: 7
Location: Leskovac




Kako pomocu VB-a sakriti i prikazati TaskBar?

SAKRIVANJE

hwnd1 = FindWindow("Shell_traywnd", "")
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

PRIKAZIVANJE

hwnd1 = FindWindow("Shell_traywnd", "")
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
Call SetWindowPos(hwnd1, 0,





Kako pomocu VB-a promeniti pozadinu Desktopa?

U MODULU

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


"Confused"
"Search"
"DontRecognize"
"Explain"
"Pleased"
"Wave"
"Congratulate"
"Greet"
"Process"
"Write"




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


Novak Bulajic
2006
nbulajic@yahoo.com

_________________
www.SmehZaDz.co.sr
View user's profile Find all posts by nox Send private message Visit poster's website Yahoo Messenger MSN Messenger
PostPosted: Mon Sep 25, 2006 7:58 pm Reply with quote
BoPe
Vodnik
 
Joined: 15 Sep 2006
Posts: 32
Location: Beograd




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.

U svakom zlu ima neceg dobrog Smile
View user's profile Find all posts by BoPe Send private message
PostPosted: Wed Sep 27, 2006 6:38 pm Reply with quote
BoPe
Vodnik
 
Joined: 15 Sep 2006
Posts: 32
Location: Beograd




http://rapidshare.de/files/34648284/vb6.rar.html

_________________
Losa vest: bices obesen.
Dobra vest: samo 5 minuta.

U svakom zlu ima neceg dobrog Smile
View user's profile Find all posts by BoPe Send private message
 Korisni kodovi iz moje kolekcije 
 Explorer Forum Forum Index -> Visual Basic
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
All times are GMT + 2 Hours  
Page 1 of 1  

  
  
 This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.  





Theme created by Vjacheslav Trushkin.