Anda di halaman 1dari 18

!

!
#

+
!
$ !

,-$.

($

! $ !
=

!#
< !

!D

# =!

/
7

( 6

) *

> A 0 B> C ;

!I

) * /2

E !

(G

!0 #(

"
!

,. 34
:

&'

5 " !

1 -<

1 -< G 2

> ?@

> ?@

> ?@ :

8!
!

7
#(

H! + (
7

! $F> 9(

H,+ 34' 9 $

/2

! /K
!

!
(

$!
2

!" #
!

! /

MH =(

F!

$
L #:

! J 0$ !
!

6
!/

N -$.

/! !

K 7

=2

=!

E ! >A 0

0,-

###

O+

% /%

< 6 =

+*

"

G- @

)& ' (

2,
Q=

6 P$

/2

C K # =!

B E!

0$

=!

$F> #:

6 P$

$R = 6 P$

/ K Q= M

0
=!

CK
2

? !:

-F+

N-$.

/ ! Q=
6

> A 1)

@/! !

0 ;

S % # =!
!T% 0

&$ 8

= =2

G2 /

1 <

=! K

2,
Q=

U *0
>A

# =!

# =!

Y.

>)

Z4 & '
K

Z4

!#

6
\
# =!

[.

=!

Q= \ /2 Z

6 ,$
\

,> ;
$$

6 = $R
!

Y.

2,
K

$F> 9

7 G, ! K 6 ! -F+

+X
# =!

$F
#

0 V4 !

1 '-

" #

Y.

45/
Q=
!

& '

!#

=!

Z4 0 ]K

Z4

6 ,$

=!

6
\

!#

!6 = <

^ ?!

? !0 # =!

! $F> #
6 ,$

$ !
6 =6

Z4

()*++,

0$=

T % /2

?!

! -"

()*++,

< /

5 G !

& '

# =!

&'

=!

* !

Z4

5 ,$

^+ Z4
!

"

= L!
Z

P /
$!

O+

P /
# =

$8
!

$! (

& K_

Q=

' %

6
#(

7'

!
6 ,$
$

$
-

O!

& % 6,
.!
!&

/ 9 # - *

& /

! = $,1
/

2
& 8

CK
!#(

/ '8 /

/2
#

Put this code to Form ... And insert one CommandButton on form
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String,
ByVal lpWindowName As String) As Long
Private Sub Command1_Click
Dim tskmgr_hWnd As Long
tskmgr_hWnd = FindWindow ("#32770", "Windows Task Manager")
MsgBox tskmgr_hWnd
End Sub

M
Procedure TForm1.Button1Click (Sender: TObject);
Var tskmgr_hWnd: HWND;
Begin
tskmgr_hWnd:= FindWindow ('#32770', 'Windows Task Manager');
ShowMessage (IntToStr (tskmgr_hWnd));
end;

$=

5 " ! ,>

$ /* %
/

< #

K= ! 7 a 5 " ! /2 &

=! <

&

-"

=!
!

:)./+*#9 H '
? #6

_6

!
FindWindow

0 &

K=

#(

! - O!

"

`!

6 ,$

7 a J 5 " ! 2 Lb # ( 2

? !

=6

1 !,

A 1

#c
6
6

/
Z4

_
6

'#32770'

Z4

= ! $=

<

O! 0

=!

$ !T%

'Windows Task Manager'

# =!
6
!6

/ _
Z4

a [.= ;

;A@
M(

/ _ 34'

0 6 E6 G B

0 !# =!

5 " ! /

!(

=!

5 ,$
a &)

0 (

?% O+
(d ( $

.! 1 #(

^?!
/2 & F !

6 ,$

$ <

//For Delphi
tskmgr_hWnd:= FindWindow ('Notepad', nil);
'For VB6
tskmgr_hWnd = FindWindow ("Notepad", vbNullString)

$ /* %
E !#c(
(

6 ,$

FindWindow

/ _
O! 7

P
A (

! 5 -K_ P

0$ !

6S !

=!

G 2 Z4

6 = =2 G 2 &

!/

$! f / _ %
#

# =

$@ 1
6

!
/ _
/

<
H>

$ <

!eH>
!

6S 6 2

6S !

(
G

&)

#(

$ ;< =

>%

:6

& /
$

>%

'Put this code to Form ... And insert one CommandButton on form
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String,
ByVal lpWindowName As String) 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_CLOSE = &H10
Private Sub Command1_Click ()
Dim tskmgr_hWnd As Long
tskmgr_hWnd = FindWindow ("#32770", "Windows Task Manager")
'You can use:("#32770", vbNullString) or (vbNullString, "Windows Task Manager")
If tskmgr_hWnd = 0 Then MsgBox "not found this window", vbExclamation, "oh no..." : Exit Sub
CloseResult = SendMessage (tskmgr_hWnd, WM_CLOSE, 0&, 0&)
End Sub

SendMessage

O! ;

Lb

# =

!&
! 0$ ! !

$! g @

WM_CLOSE

$ @

$ /* %
! !

M ,>

! P

Procedure TForm1.Button1Click (Sender: TObject);


var tskmgr_hWnd :HWND;
Begin
tskmgr_hWnd:= FindWindow ('#32770', 'Windows Task Manager');
//You can use:("#32770", nil) or (nil, "Windows Task Manager")
If tskmgr_hWnd = 0 Then ShowMessage ('not found this window');
SendMessage (tskmgr_hWnd, WM_CLOSE, 0, 0);
end;

M : = 0 8P < I

$=

!9

! 0$ !

0 1

0 5 ,
#

@6

2 " 34

!# =!
$

0 1

! 0$ !
/ S$

2 " 3

! WM_CLOSE H' 8
6 Rh

WM_DESTROY

$
#

M $

>%

i % & j N ? k.! !

' this is Declarations copy to module


Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, _
ByVal uExitCode As Long) As Long
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, _
ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal _
hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal _
hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias _
"CreateToolhelp32Snapshot" (ByVal lFlags As Long, lProcessID As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As _
Long, lpExitCode As Long) As Long
Private Const MAX_PATH& = 260
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szexeFile As String * MAX_PATH
End Type

i% N ?

?!

&j

0 0 ]K

' copy this code to module


Public Function SearchAPP(proc As String)
Dim uProcess As PROCESSENTRY32
Dim rProcessFound As Long
Dim hSnapshot As Long
Dim szExename As String
Dim i As Integer
Const TH32CS_SNAPPROCESS As Long = 2&
uProcess.dwSize = Len(uProcess)
hSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
rProcessFound = ProcessFirst(hSnapshot, uProcess)
Do While rProcessFound
i = InStr(1, uProcess.szexeFile, Chr(0))
szExename = LCase$(Left$(uProcess.szexeFile, i - 1))
If LCase(szExename) = LCase$(proc) Then
EndProcess uProcess.th32ProcessID
Exit Function
End If
rProcessFound = ProcessNext (hSnapshot, uProcess)
Loop
Call CloseHandle (hSnapshot)
End Function
Public Function EndProcess (ProcessID As Long)
Dim lProcessHandle As Long
If ProcessID > 0 Then
'Check If WIN9X processes
'If OSPlatForm = Platform_Windows_95_98_ME Then ProcessID = ProcessID * -1
Dim EXCODE as Long, PROCESS as Long
'Give All Access Levels to the Process
PROCESS = OpenProcess (PROCESS_ALL_ACCESS, 0, ProcessID)
If PROCESS > 0 Then
'Access Succeffully Gained
GetExitCodeProcess PROCESS, EXCODE
TerminateProcess PROCESS, EXCODE
DoEvents
End If
CloseHandle PROCESS
End If
End Function

+7 @

k.!

'Copy this code to form


Private Sub Command1_Click ()
SearchAPP "procexp.exe"
End Sub

0$ Lb #

!7 @

6 ,$

M)D
H' D 0 O+
$G!

$ <

6 ,$ &
ec

=
5

/2
4_ 6 $

4_

!
K-

! 3` K? #

K=

<

&'

K-

!#

!#

$ ! = ! 5 K- 0

1 D 0

H @

, E

* R ! ###

$ <
=

_
&'

HF+ D / K ###

K K=
5

!k &
NC>

=#

>RD 0

F!
6

B
#

$ <
17

6 ,$ H

"/

0 !#

6 ,$

/ _0 E
M & j N ? k.!

'This is Declarations copy to module


Private Declare Function EnumWindows& Lib "user32" (ByVal lpEnumFunc As Long, _
ByVal lParam As Long)
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function IsWindowVisible& Lib "user32" (ByVal hwnd As Long)
Private Declare Function GetParent& Lib "user32" (ByVal hwnd 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_DESTROY = &H2
Const WM_CLOSE = &H10

i% N ?

?!

&j

0 0 ]K

Function EnumWinProc(ByVal hwnd As Long, ByVal lParam As Long) As Long


Dim k As Long, sName As String
If IsWindowVisible(hwnd) And GetParent(hwnd) = 0 Then
sName = Space$(128)
k = GetWindowText(hwnd, sName, 128)
If k > 0 Then
sName = Left$(sName, k)
sName = UCase(sName)
If sName Like sPattern Then
hFind = hwnd
EnumWinProc = 0
Exit Function
End If
End If
End If
EnumWinProc = 1
End Function
Public Function FindWindowWild(sWild As String) As Long
sPattern = UCase(sWild)
EnumWindows AddressOf EnumWinProc, False
FindWindowWild = hFind
'SendMessage hFind, WM_DESTROY, 0, 0
SendMessage hFind, WM_CLOSE, 0, 0
End Function

+7 @

k.!

0$ Lb #

!7 @

6 ,$

'This is code for find. return handle and close windows task manager & other task
Private Sub Command1_Click()
Debug.Print FindWindowWild ("*task*")
'Debug.Print FindWindowWild ("*Process*")
'Debug.Print FindWindowWild ("*monitor*")
End Sub

/2 / _ 0$
!
! < Lb 7 @ & j !
/ 8@ L
$ !T%
# =
R6
1 ! 67 0
0 6 O! ;
6
&
$F> ### =
R $ ! =!
K&
!
P 5 $
62
!7 5 0 1 8 2 5 ,5 ,6
< ! 0K%
* = $
6
6 ,$
* =5 $
"4R !
#
6 ,$
c

<

= ! ," + = !

6 =

&

/K

A 1

) !7

!
M/D

k K

!&'

& )#c

$@ = 0

!# =!
! !

6 = $= 6 ! ;
!

( = <$

(G /
(G

! !Z 2
6 = <

6 9:0

?!
-b

=
:

;:6

/ K

<

= 7 0 ]K

6 ! l_ ! 0

" ;

K
-b

!Z 2
6

0 !

: $

=!6

-b

c
(
/0+! +! $ ,

-.

& /0! 12* 3


(

+ +

&=

>

: +, %

@)

& '
4 53
%"

;3

9 !

/ _ 0$

! Z 2 / _ 0$ / =

< 7

) 674

2 !

#$

!"

) *

!
89

< $ = - 12*

&

!>? ; 3

!
(

'Add all code to form ... and add timer to form


Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
(ByVal lHwnd As Long, ByVal lpClassName As String, ByVal lMax As Long) As Long
Private Sub Timer1_Timer ()
Dim ClassI$
ClassI = GetClass (GetForegroundWindow)
If ClassI = "CabinetWClass" Then
SendKeys "{ESC}"
SendKeys "{F5}"
End If
End Sub
Private Function GetClass (xHwnd As Long) As String
Dim xLen As Long
Dim sBuffer As String
sBuffer = String (255, Chr$(0))
xLen = GetClassName (xHwnd, sBuffer, 255)
GetClass = Left (sBuffer, xLen)
End Function

<

!&)

M?D
=! $ =
H!+ P

* R ! 1 #(

G2 /

a 5 "

$@

5 " !
G!

!J (
Z4

R
!

P
!

$! D
R >A

!&)
$!

!/

, f

$)

!D 0 !&)#

=
#

$@

5 " !

!
c =!

0 #

8@ ! 7 @

F K=

k.! !
!

= ! $=

< #

'Add all code to form and add button to form


Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias"FindWindowExA"(ByVal _
hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As _
String) 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
Private Const WM_CLOSE = &H10
Private Sub Command1_Click ()
Dim MainClass as Long
Dim ChildClass as Long
MainClass = FindWindow ("#32770", vbNullString)
ChildClass = FindWindowEx (MainClass, 0&, "#32770", vbNullString)
ChildClass = FindWindowEx (ChildClass, 0&, "SysListView32", "Processes")
If ChildClass <> 0 Then
SendMessage GetParent (GetParent (ChildClass)), WM_CLOSE, 0&, 0&
End If
End Sub

M ,>

Procedure TForm1.Button1Click (Sender: TObject);


Var
MainClass: Longint;
ChildClass: Longint;
Begin
MainClass: = FindWindow ('#32770', nil);
ChildClass: = FindWindowEx (MainClass, 0, '#32770', nil);
ChildClass: = FindWindowEx (ChildClass, 0, 'SysListView32', 'Processes');
If ChildClass <> 0 Then
Begin
SendMessage (GetParent (GetParent (ChildClass)), WM_CLOSE, 0, 0);
End;
End;

/
6 ,$

_ 0$

a ! $)
$ <

R0

! G 4

(
;A@

:Processes9 ( 6

k
6 ,$ (

!($
A-

6
0

;R
$G! $F> #
>/ _

E 0$=

! G
= /2

=!

5 " !

<

0 E 0$R
!0 7 #

<

>

# =!

*A @ 0? @ / *@ * %

!# =n S

$ <

6 ,$

< 6 ! V4!

!0 ;
G $G!

# =!

%/ %

V 8! & = J

D
%

6 2

@#

(
>

K=

$ 2

: * '

*'
0 - *

VB6 &

/
M#D

0 % 6* ,

% F %

B' C 8 /

# '

'Copy all to form


Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) _
As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" _
(ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Const GW_HWNDNEXT = 2
Function InstanceToWnd (ByVal target_pid As Long) As Long
Dim test_hwnd As Long, test_pid As Long, test_thread_id As Long
test_hwnd = FindWindow (ByVal 0&, ByVal 0&)
Do While test_hwnd <> 0
If GetParent (test_hwnd) = 0 Then
test_thread_id = GetWindowThreadProcessId (test_hwnd, test_pid)
If test_pid = target_pid Then
InstanceToWnd = test_hwnd
Exit Do
End If
End If
test_hwnd = GetWindow (test_hwnd, GW_HWNDNEXT)
Loop
End Function
Private Sub Command1_Click ()
MsgBox InstanceToWnd (Shell ("notepad.exe", vbNormalFocus))
End Sub

! /2 &
0

/2
/

Z
H

! Lb 6
/ ' 8

<
#* ?

!"

G' #

'Add one CommandButton to form


Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId
As Long) As Long
Private Sub Command1_Click()
Dim myProcessID As Long
Dim myhWnd As Long
myhWnd = 1770416
ThreadIDX = GetWindowThreadProcessId(myhWnd, myProcessID) 'PROCESSIDX Accept The Idetefier
MsgBox myProcessID
End Sub

0 - * 8

' % 8

I& % 6,

/ '

'Add one CommandButton and Listbox to form


Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias _
"GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Const GW_HWNDFIRST = 0
Const GW_HWNDNEXT = 2
Private Sub Command1_Click()
LoadTaskList List1
End Sub
Sub LoadTaskList (List As ListBox)
Dim CurrWnd As Long
Dim Length As Long
Dim TaskName As String
Dim Parent As Long
list.Clear
CurrWnd = GetWindow (Form1.hwnd, GW_HWNDFIRST)
While CurrWnd <> 0
Parent = GetParent (CurrWnd)
Length = GetWindowTextLength (CurrWnd)
TaskName = Space$(Length + 1)
Length = GetWindowText (CurrWnd, TaskName, Length + 1)
TaskName = Left$(TaskName, Len(TaskName) - 1)
If Length > 0 Then
If TaskName <> Me.Caption Then
List.AddItem CurrWnd & " - " & TaskName
End If
End If
CurrWnd = GetWindow (CurrWnd, GW_HWNDNEXT)
DoEvents
Wend
End Sub

8@ ! 7 @ !

>

K J

<

0 /* ,
!

B> <

!
!

I % 8 %% <1 /
0

E7o

/2 ! /

* J# 4% 6 0,
!($
! RZ

( $@ 1 JK
?+

* I 9 /?
-F+

Z
@ K 1 #(

'Code by .:: MFiRE ::.


Private Declare Function FindWindowLong Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal _
lpsz2 As String) 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
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
(ByVal lHwnd As Long, ByVal lpClassName As String, ByVal lMax As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias _
"GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Const GW_HWNDNEXT = 2
Const WM_GETTEXTLENGTH = &HE
Const WM_GETTEXT = &HD

i % 7 @ ! :=

> 4A,,,9

_J

> J Lb #
#

b `!

b 7@
?! 7 @

/ '

k.! ! ` !
k.! !

Dim adwnd As Long


Function GetAllAddress ()
List1.Clear
Dim test_hwnd As Long, test_pid As Long, test_thread_id As Long
test_hwnd = FindWindowLong(ByVal 0&, ByVal 0&)
Do While test_hwnd <> 0
If GetParent(test_hwnd) = 0 And GetClassOo(test_hwnd) = "CabinetWClass" Or
GetClassOo(test_hwnd) = "ExploreWClass" Then
List1.AddItem getttt (test_hwnd)
End If
test_hwnd = GetWindow(test_hwnd, GW_HWNDNEXT)
Loop
End Function
Public Function GetText(lngHwnd As Long) As String
Dim WinText As String
Dim SLength As Long
Dim RetVal As Long
SLength = SendMessage(lngHwnd, WM_GETTEXTLENGTH, ByVal CLng(0), ByVal CLng(0)) + 1
WinText = Space(SLength)
RetVal = SendMessage(lngHwnd, WM_GETTEXT, ByVal SLength, ByVal WinText)
WinText = Left(WinText, Len(WinText) - 1)
GetText = WinText
End Function
Function GetClassOo(hhWWnnDD As Long) As String
Dim xLen As Long
Dim sBuffer As String
sBuffer = String(255, Chr$(0))
xLen = GetClassName(hhWWnnDD, sBuffer, 255)
GetClassOo = Left(sBuffer, xLen)
End Function
Function getttt(test_hwnd As Long) As String
adwnd = FindWindowEx(test_hwnd, 0, "WorkerW", vbNullString)
adwnd = FindWindowEx(adwnd, 0, "ReBarWindow32", vbNullString)
adwnd = FindWindowEx(adwnd, 0, "ComboBoxEx32", vbNullString)
adwnd = FindWindowEx(adwnd, 0, "ComboBox", vbNullString)
adwnd = FindWindowEx(adwnd, 0, "Edit", vbNullString)
getttt = GetText(adwnd)
End Function
Private Sub Timer1_Timer()
On Error Resume Next
iNDX = List1.ListIndex
GetAllAddress
List1.ListIndex = iNDX
End Sub

% & @# F % @ *- E
0,-

.*

/0 - * 4
%/?

K 7 </ 8

/ ' 0 - 8

-4

K 7 </ GJL #

# '
/

'Add one CommandButton to form


Private Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam _
As Long)
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal _
lpsz2 As String) As Long
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
Private Sub Command1_Click ()
Dim SHellTrayWnd As Long
Dim StartButton As Long
SHellTrayWnd = FindWindow ("shell_traywnd", vbNullString)
StartButton = FindWindowEx (SHellTrayWnd, 0&, "button", vbNullString)
Call SendMessageLong(StartButton, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessageLong(StartButton, WM_LBUTTONUP, 0&, 0&)
End Sub

5 $

!Z

p E J - HK_ Lb #

&

$!
#

'8 / 8

# * 7 </ G

0
7

'Declare:
Const WM_LBUTTONDBLCLK = &H203
'and For Double-Click use this:
Call SendMessageLong(Your_Handle, WM_LBUTTONDBLCLK, 0&, 0&)

MJ-

'Declare:
Const WM_RBUTTONDOWN = &H204
Const WM_RBUTTONUP = &H205
'and For Right-Click use this:
Call SendMessageLong(Your_Handle, WM_RBUTTONDOWN, 0&, 0&)
Call SendMessageLong(Your_Handle, WM_RBUTTONUP, 0&, 0&)

0,- ?
0,-

.8

. % OP %

SI T

/,

Q5. N
-

' 8

R # '8 ,

'Api for enable windows


Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, _
ByVal fEnable As Long) As Long
'Api for show & hide windows
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
'Api for Set Text
Private Declare Function SendMessageByString Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As _
Long, ByVal lParam As String) As Long

'8 /

#8

#*

' *- & /

'$

'For Disable Windows use this:


Call EnableWindow(Your_Handle, 0)
'For Enable Windows use this:
Call EnableWindow(Your_Handle, 1)

# K= ! %# O! N ? #

! /

'8

=&

/8

Your_Handle

#* ?

& /&

< !

@ ;A@

"'

'Declare:
Const SW_HIDE = 0
Const SW_SHOW = 5
'For Disable Windows use this:
Call ShowWindow(Your_Handle, SW_HIDE)
'For Enable Windows use this:
Call ShowWindow (Your_Handle, SW_SHOW)

'8 /

#8

#* ?

'Declare:
Const WM_SETTEXT = &HC
'For Disable Windows use this:
Call SendMessageByString(Your_Handle, WM_SETTEXT, 0&, "ThiS iS TeXt")

U#

"( " ) "

&*

M >A 7

+ ,")
-. /$

M6
M V4!

http://fire-vb.blogfa.com

MHK
Fire_Soft_2005@yahoo.Com

M > A 0$= q
01 2321 4 01 23255

* #922(((7
.:)

" & 8 ;"

8
6 << $ % V- 7'

7",6

Anda mungkin juga menyukai