Samples

In this section I would like to put some little samples, based on Win32 API generally. By default you must put all the code to a Standard Module.

 

Using WinAPI

The material of the first 17 samples appeared here by courtesy of Nick Egorov. All the code was formatted using my freeware VB code formatting tool.

 
  1. Find your monitor resolution and the colors number
  2. How to change your current monitor settings?
  3. Download sample How to put an icon into the system tray (near the clock)? Updated
  4. Find out where is the Windows OS directory
  5. What is your Windows OS version (Win95/Win98/NT)?
  6. Read and write to the system registry
  7. How to find out when the running process will finish?
  8. A minimal window size
  9. Restart/LogOff/Shutdown a computer
  10. Get a value of N-line at Multiline Textbox or RichTextBox
  11. How to change wallpapers in Windows?
  12. How to make a toolbar like in Office'97?
  13. Pause a running program
  14. Always On Top window
  15. How to open a website from your program?
  16. How to draw a transparent picture?
  17. Does a file exist or not on your drive?
  18. Call standard Windows Properties dialog for specified file/folder/drive.
  19. Download this sample How to detect when a CD-ROM is inserted?
  20. Disabling CTRL-ALT-DEL, CTRL-ESC and ALT-TAB
  21. Download this sample How to get the titles of all running windows?
  22. How to play a WAV file?
  23. How to retrieve the name of the current user?
  24. Download this sample How to generate left-clicks, when you right-click?
  25. How to get the dates of any file's creation, last access and last modification? How to change them?

Tips and Tricks

 
  1. How to get ellipsis () when you press Alt+Ctrl+(.) in a textbox (like in Word97)
  2. Download this sample How to choose Min and Max elements in Excel from one column and to show corresponding dates to them, which are in another column, with the help of Visual Basic, but not with the help of Excel?
Home Last update: 04/27/08