Robert Inventor


Home Music 3D Animations Utilities Code Search Forums About Contact Accessibility
Mem Leak Check
Play Midi Lib
Com Ports Monitor
Win Ming
Pop Pal Fast
Gle with time out
Time64

Source code in C and dlls
You can get back to this page at any time with a click on Source Code

This section is for programmers who may want to do some similar things to the things I've needed to do for the programs. Most of these are libraries that as a programmer you can just call to achieve particular tasks. One of them (Com Ports Monitor) is a small but functional demo program to show how the coding is done.

I have another section in the Wiki for smaller c-code snippets.

Please note: this code is all in low level C - like the example programs in the classic Programming Windows by Charles Petzold. If any of you have ported any of this code to C++ and want to share your port let me know.

Most of the code is for windows only, all apart from Gle with time out, and Mem Leak Check, which are multi-platform.

What do you want to do?

  • Find memory leaks in your programs - see Mem Leak Check
  • Add some basic midi and microtonal retuning capabilities to your program - see Play Midi Lib
  • Send or receive data via a Com Port - see Com Ports Monitor
  • Save some types of flash animations - see Win Ming
  • Reduce the number of colours in an image to 256 colours or less suitable for a gif or similar save - see Pop Pal Fast
  • Make tubes in 3D in Open GL and vary the colour or material along the length of the tube, or let the animation time out if it takes too long to do the drawing - see Gle with time out
  • Reference times after the year 2038 as time_t in a Windows program with a native 64 bit integer type, but no native 64 bit time format (e.g. made using MSVC 6.0). Also reference times before time_t==0 in the year 1970 - right back to the 17th century as negative time_t (signed time_t values are not supported even in MSVC 7.0). see Time64

These are all libraries, apart from Com Ports Monitor which is an example program.

Note particularly, my port of the Win Ming library is out of date, and only a limited port, and I have no plans to update it in the near future. The code for Ming has moved on since I did the port, and has better support for Windows, so WinMing is also less needed too.

Hopefully I will add other example code to this section in the future as time permits. It takes work since just uploading a fragment of one of my programs wouldn't be that helpful. One needs to simplify it and either make it into a library - or into a small demo program to show the main ideas and how the technique is done, without the complications of the context of a large program - this is particularly true when the programmer works in low level C.

If you are a programmer and wish to know how I did some particular thing in one of my programs - there are no secrets here - I am delighted to answer your questions as best I can. Just contact Robert Walker - robertwalker@robertinventor.com

One FAQ is - how do I do the textured backgrounds for a dialog in a normal type dialog with the full range of standard windows controls in it like these.

At first sight it seems quite simple.

The messages you need to handle are:
case WM_CTLCOLOREDIT :
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORSCROLLBAR:
case WM_CTLCOLORBTN:
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
and you paint the background texture during the call, and return a null brush.

However, since each control in the window gets its background texture drawn separately, you then need to align all those fragmentary images so that they join seamlessly at joins with each other and the background for the dialog itself. There are also a few other tricky points. So, the principles are simple, but the coding itself is intricate.

So - it is surprisingly hard to do it correctly in ordinary C, which is probably why few people do it. I don't know about C++, but haven't seen much in the way of programs that do this, so seems it must be hard in C++ too. The proxomitron works like this. Can't think of any other program apart from my own - plenty with custom backgrounds but not ones that are obviously based on the standard Windows dialogs.

I may try and do a dll for it some day - if so it may well be one that you have to pay a small sum to use.

BTW if you wonder how I did the floating tips for this web site, I used the Overlib library:

Popups by overLIB!

 

 

Disclaimer
Acceptable Use Policy
Special Offers
Contact
Copyright
Privacy
 
Site Designed with advice from Sojo Media (Thanks!)
© Robert Walker 2008
tool tips by overlib
Robert the Inventor's programs
By Robert Walker
support@robertinventor.com

NEW metronome software - Download Bounce Metronome Pro with bounces and conducting patterns to help you stay in time.