Showing posts with label Pascal. Show all posts
Showing posts with label Pascal. Show all posts

Friday, 23 August 2013

New web site is up

I have completely failed to keep you all up to date with the latest development news from me.
A few days ago, my new games development web site went live. Even if I do say so myself, I think it's pretty cool. The entire site is coded by hand (apart from the Lightbox scripts). I prefer to create my own sites this way, so that I have total control over the content, without relying on, or being limited by, a third party content management system.
Anyway, if you want to have a look (and I know you do), then hop on over to: http://www.krazypengwin.com.
Second bit of news, probably not as impressive, but I think it is equally important, I have made some changes to the Colour Code Generator I mentioned before. It is now possible to drag and drop colours from the custom colours to the main colour button, and vice versa. It is also possible to use drag and drop to reorder the colours in the custom section. A little more important, I have added the possibility to drag and drop a colour from the application directly to the source code, and it will insert the colour, in the format selected, into your code. Not a massive change, but it could be useful and save a few seconds, rather than having to click Copy and then Paste. Some more formats have also been added, so the colours can now be formatted for the following languages: Monkey, BlitzMax, Xojo, Cocoa for OS X, Cocoa for iOS, Lazarus (and Delphi), Python, HTML, CSS and as either a list of decimal or hexadecimal values.
This little tool, along with some of the others I have written, will be available from my web site once I have written the help documentation.

Thursday, 15 March 2012

ACDS Continued...

I have been cracking on with the development environment (Horace seems to have taken a slight back seat while I do this).
So far, I have a character set editor built, the project manager and half the source editor.
I have decided to concentrate on on assemblers for now (sorry C coders), but version 2 may include C compiler facilities.
I am also not limiting it to any particular assemblers, although it will ship with default settings for ATASM, MADS and XASM. Other assemblers can easily be added to it.
One thing I didn’t mention in the original post about this project is that it will be available for both Windows and OS X. I’ve using Real Studio to develop it, which is a great cross platform development system.
Anyway, here is a pic of the startup screen for you:
ACDS startup screen

Wednesday, 24 August 2011

Some old, but useful code

Digging through some archives, I found some useful code, so I thought I would share these.

These snippets are from my Delphi programming days, so the code is in Pascal, but it can easily be converted to whichever language is being used.

Hide an application from the taskbar - Delphi

This is a really simple technique that can hide your application from the taskbar.In your main forms On Create event, type the following code:

SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE ) or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);

That's all there is to it.

Making a program run at Windows startup - Delphi

On your programs Settings or Preferences form, place a TCheckBox with the caption Run at Windows Startup.

In the forms uses clause, include the unit Registry.

In the TCheckBox On Click event, include the following code:

procedure TForm1.TCheckBox1Click(Sender: TObject); 

     var Registry: TRegistry; 

 begin

      Registry := TRegistry.Create; 

      Registry.RootKey := HKEY_LOCAL_MACHINE;

      Registry.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', false);

      If TCheckBox1.Checked then 

          Registry.WriteString(Application.Title, Application.ExeName) 

      else Registry.DeleteValue(Application.Title); 

      Registry.CloseKey; 

      Registry.free; 

end; 

To ensure that the TCheckBox displays the current status of the function when the form is displayed, we need to insert the following code into the forms On Show event: 

procedure TForm1.FormShow(Sender: TObject); 

    var Registry : TRegistry; 

begin 

    Registry := TRegistry.Create;

    Registry.RootKey := HKEY_LOCAL_MACHINE;

    Registry.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', false); 

    CheckBox1.Checked := Registry.ValueExists(Application.Title); 

    Registry.CloseKey; 

    Registry.free; 

end;

This code simply checks to see if the run command for the appllication has been inserted into the registry. If it has, the the TCheckBox is checked, otherwise it is not.