Results 1 to 3 of 3

Thread: Full Screen & Encoding Files.

  1. #1

    Full Screen & Encoding Files.

    I was just wondering how to make programs full screen. I read somewhere that making the width and height of the form the same as the screen would do it, but the form's title bar and the windows task bar still show up on the screen. The task bar shows over the form.

    Also how do you save information from your program without the file showing up as easily editable words and numbers? If you get my meaning. So far all I can do is read and write words and numbers from a simple ascii file, I want to somehow encode the files to prevent cheating.
    Why are toasters created with a setting that burns the bread to a crisp no sane person could eat?
    <br />Who said Humpty Dumpty was an egg?
    <br />Why are there no 'B' sized batteries?
    <br />Why don't you ever see baby seagulls?

  2. #2

    Full Screen & Encoding Files.

    You have to set the border-style of your for to bsNone.

    Also, there are several ways to encode text. An efficient and easy method is to XOR each character in a string with a value. This is hard to reverse unless you have the proper key.
    Here's some code. It's not mine... found it somewhere but don't remember where

    const
    C1 = 52845;
    C2 = 22719;

    function Encrypt(const S: String; Key: Word): String;
    var
    I: byte;
    begin
    Result[0] := S[0];
    for I := 1 to Length(S) do begin
    Result[I] := char(byte(S[I]) xor (Key shr );
    Key := (byte(Result[I]) + Key) * C1 + C2;
    end;
    end;

    function Decrypt(const S: String; Key: Word): String;
    var
    I: byte;
    begin
    Result[0] := S[0];
    for I := 1 to Length(S) do begin
    Result[I] := char(byte(S[I]) xor (Key shr );
    Key := (byte(S[I]) + Key) * C1 + C2;
    end;
    end;
    Ask me about the xcess game development kit

  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Full Screen & Encoding Files.

    If you want your program to hide the task bar while it's running and return it once finished you can do this:
    [pascal]procedure TForm1.FormCreate(Sender: TObject);
    begin
    ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_HIDE);
    end;

    procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
    ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_SHOW);
    end;
    [/pascal]
    Make sure that you return the task bar after you've hidden it or you'll end up being screwed when it comes time to actually need it.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •