Examples(n) "Tcl Windows API extension examples"

NAME

Examples - Tcl Windows API usage examples

DESCRIPTION

The examples in this section are broken out by area. Note that many of these will require administrative privileges to run. For clarity, the examples do minimal validation and error checking.

The examples may be run by passing to a Tcl interpreter. For example,

 
tclsh checkservicepack.example 3

will print whether service pack 3 is installed.

System Information

printsysteminfo.example
Print operating system version and configuration

verifyTS.example
Verify if Terminal Services are present

verifyservicepack.example
Verify that the specified service pack is installed

printcomputername.example
Prints the NETBIOS name of the computer.

Window management

minimizeapp.example
Minimize all windows for a given application

hidewindows.example
Hide all windows for a given application

showwindows.example
Show all windows for a given application

movewindowtoorigin.example
Move a window to the top left corner of the screen

removetitlebar.example
Remove the title bar from a window

bringtoforeground.example
Bring a specified window to the foreground

keepontop.example
Keep a window on top of all other windows

changewindowcaption.example
Change the caption of a window

Simulating user input

sendtext.example
Send text string to a specified window

sendmenuexit.example
Send Alt-f x sequence to a specified window (generally corresponds to the File menu eXit option).

opensysmenuwithmouse.example
Open the system menu of the specified window with the mouse

Playing sounds

beep.example
Generate a continuous tone on the system speaker

playsystemsound.example
Play a system sound

continuoussystemsound.example
Play a system sound continuously for 10 seconds

playwavfile.example
Play a WAV sound file

Disk configuration

listdrives.example
List all the drives on the system

listremotedrives.example
List all remote drives on the system

listfulldrives.example
List all fixed drives that have less than 10% free space

changedrivelabel.example
Modify the volume label for a drive

checkunicodefilenames.example
Check if the given drive supports Unicode file names

checkavailablespace.example
Check if the given drive has sufficient free space

Network Shares

exportfileshare.example
Export a file share that can be connected to from remote clients

mapdrive.example
Map a drive to a file share exported from a server

listexportedshares.example
List all network shares exported on the system

listconnectedshares.example
List all network shares to which the system is connected

showmappeddrive.example
Show information related to a mapped drive

Processes and Threads

exitprograms.example
Ask all invocations of a given program to gracefully exit

killprograms.example
Forcibly terminate all invocations of a given program

showprocessowners.example
Show the user account under which each process is running

showprocessmodules.example
Show the DLL's loaded in a process

Windows Services

showrunningservices.example
Show all Windows services that are currently running

showautostartservices.example
Show all Windows services that start automatically at boot time

restartservice.example
Stop and restart a Windows service

changeserviceaccount.example
Change a service configuration to start under a specific user account

showservicedependents.example
Show the services that depend on the specified service

showservicedependencies.example
Show the services that the specified service depends on

installservice.example
Install a service

uninstallservice.example
Remove a service

Users and Groups

listusers.example
List the users on a system

listgroupsforuser.example
List the groups that a user belongs to.

listusersingroup.example
List the users in a group

showuser.example
Show properties of a user account.

adduser.example
Create a new user account

deleteuser.example
Delete a user account

setuserhomedir.example
Set a user's home directory

addusertolocalgroup.example
Add a user to a local group

removeuserfromlocalgroup.example
Remove a user from a local group

addlocalgroup.example
Add a local group account

deletelocalgroup.example
Delete a local group account

impersonateuser.example
Impersonate a user account

Access Control

protectfilefromuser.example
Protects a file from access by a specific user.

unprotectfile.example
Unprotect a file, allowing access by all users.

showacls.example
Show the access control entries on the specified file.

Performance Monitoring

showcpuutilization.example
Chart CPU utilization

COPYRIGHT

Copyright © 2003, Ashok P. Nadkarni