ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
متغیرهایی تعریف شده که زمان ارجاع به آن راحت باشید و مقادیری را به آن تخصیص بدهید با Private Type و مشخص کردن نام و دیتا تایپ آن.
Private Type CUSTOM_MSGBOX lTimeout As Long
lExitButton As Long
lInterval As Long
strPrompt As String
End Type
ClassName = Space(256)
' Make sure we spotted a messagebox (dialog)
Private hHook As Long
Public hwndMsgBox As Long
Public lTimerHandle As Long
Public hAppInstance As Long
این یک نمونه کار است هر زمان که توابع API را مطالعه کردید می توانید با چیدمان درست کدها به مقاصد خود دست یابید البته هوک کردن مشکل است اگر خطایی اتفاق بیافتد سیستم هنگ خواهد کرد به WSCRIP.SHELL و POPUT هم می توان مراجعه کرد .
CREATEOBJECT("WSCRIPT.SHELL")
OBJECT.POPUP
Wscript Popup Method vbsedit
Echo Method vbsedit
Wscript.Shell + Shell.Application Objects shell.html
فرضا ساختن مرجع آبجکت یا شئ به یک فولدر با متد NAMESPACE از آبجکت SHELL.APPLICATION
FolderItems.Count property :
Contains the number of items in the collection.
ssfWINDOWS = 36
Dim objShell,objFolder As Object
Set objShell =CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(ssfWINDOWS)
Set objFolderItems = objFolder.Items
nCount = objFolderItems.Count
Set oFolder = CreateObject("Shell.Application").Namespace(Path)
For I = 1 To 100
Debug.Print I & ": " & oFolder.GetDetailsOf(oFolder.Items.Item(File), I)
Next I
Set the registry flag to display Hidden and System files in Windows Explorer
WScript.Shell
_"myKey="HKCU\Software\Microsoft\Windows
"\CurrentVersion\Explorer\Advanced\Hidden\"
"WshShell.RegWrite myKey,1,"REG_DWORD
Methods .AppActivate 'Activate running command. .Run 'Run an application .TileVertically 'Tile app windows .RegRead 'Read from registry .RegDelete 'Delete from registry .RegWrite 'Write to the registry
"Shell.Application" Methods .CanStartStopService("ServiceName") 'Can the current user start/stop the named service? .CascadeWindows 'Arrange app windows .EjectPC 'Eject PC from a docking station .Explore(FolderPath) 'Open a folder .FileRun 'Open the File-run dialogue .GetSystemInformation("PhysicalMemoryInstalled") 'Physical memory installed, in bytes. .IsServiceRunning("ServiceName") 'Check if a Windows service is running .MinimizeAll 'Minimize everything .NameSpace("C:\\") 'Create an object reference to a folder .ServiceStart("ServiceName", true) 'Start a windows service .ServiceStop("ServiceName", true) 'Stop a windows service .SetTime 'Open the set time GUI .ShellExecute 'Run a script or application .ShutdownWindows .TileHorizontally 'Tile app windows .TileVertically 'Tile app windows .ToggleDesktop 'Show/Hide Desktop .TrayProperties 'Display the Taskbar/Start Menu Properties .UndoMinimizeAll 'Un-Minimize everything