Start Application on Windows 95 without Skinning

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40398
    Support
    Keymaster

      Hello
      You have an error message in this situation?
      Are you sure that skins was found and application can load them?

      #40422
      alex000
      Participant

        I`m sorry, I think that i know what can be reason of this.

        AlphaControls uses kernel32.IsDebuggerPresent function in Acutils->IsIDERunning, which not present in Win95

        You can use this code to detect running IDE:

        CODE
        if (FindWindow('TApplication', nil) = 0) or (FindWindow('TAlignPalette', nil) = 0) or (FindWindow('TPropertyInspector', nil) = 0) or (FindWindow('TAppBuilder', nil) = 0) then begin


        I have no need to run some application on Win95, but i think it can be useful.

        Sorry for my English.

        #40425
        bjoerng85
        Participant

          Let me explain you the situation: My application ensures that skinnig is only available starting from Win XP. So in older Windows versions skinning is not activated and thus no skins have to be loaded. Under Win 98 and Win NT 4 this works but not under Win 95 which some users of my application still use.

          When I first tried I got an error message saying that DLL msimg32 is not found so I changed the use of this DLL to dynamic calls. This is the corresponding patch:
          — sGradient.pas.orig Wed Jun 03 09:12:08 2009
          +++ sGradient.pas Tue Sep 08 13:31:10 2009
          @@ -35,10 +35,6 @@

          uses acntUtils;

          -{$IFNDEF BCB6}
          -function GradientFillAC(DC : hDC; pVertex : Pointer; dwNumVertex : DWORD; pMesh : Pointer; dwNumMesh, dwMode: DWORD): DWORD; stdcall; external 'msimg32.dll' name 'GradientFill';
          -{$ENDIF}

          procedure PaintGrad(Bmp: TBitMap; const aRect : TRect; const Gradient : string);
          var
          ga : TsGradArray;
          @@ -60,6 +56,7 @@
          Count, Percent, CurrentX, MaxX, CurrentY, MaxY : integer;
          Y, X : integer;
          {$IFNDEF BCB6}
          + GradientFillAC: function(DC : hDC; pVertex : Pointer; dwNumVertex : DWORD; pMesh : Pointer; dwNumMesh, dwMode: DWORD): DWORD; stdcall;
          vert : array[0..4] of TRIVERTEX;
          gRect: array[0..3] of GRADIENT_TRIANGLE;
          c : TsColor;
          @@ -251,7 +248,11 @@
          gRect[3].Vertex2 := 1;
          gRect[3].Vertex3 := 3;

          – GradientFillAC(Bmp.Canvas.Handle, @vert, 5, @gRect, 4, GRADIENT_FILL_TRIANGLE);
          + @GradientFillAC := GetProcAddress(GetModuleHandle('msimg32'), 'GradientFill');
          + if (@GradientFillAC <> nil) then
          + begin
          + GradientFillAC(Bmp.Canvas.Handle, @vert, 5, @gRect, 4, GRADIENT_FILL_TRIANGLE);
          + end;
          end;
          {$ENDIF}
          end;

          As a result of this patch I don't get any missing DLL errors any more but the application still doesn't start. All I get is an hourglass for a very little time.

          Next I applied the following patch based on alex000's idea:
          — acntUtils.pas.orig Thu Jul 16 17:35:54 2009
          +++ acntUtils.pas Wed Sep 09 10:48:08 2009
          @@ -259,8 +259,6 @@
          mov al, 255
          end;

          -function IsDebuggerPresent(): Boolean; external 'kernel32.dll';

          function HexToInt(HexStr : string) : Int64;
          var
          i : byte;
          @@ -873,8 +871,16 @@
          end;

          function IsIDERunning: boolean;
          +var
          + IsDebuggerPresent: function: BOOL;
          begin
          – Result := IsDebuggerPresent;
          + @IsDebuggerPresent := GetProcAddress(GetModuleHandle('kernel32'), 'IsDebuggerPresent');
          + if (@IsDebuggerPresent <> nil) then
          + begin
          + Result := IsDebuggerPresent;
          + end else begin
          + Result := (FindWindow('TApplication', nil) <> 0) or (FindWindow('TAlignPalette', nil) <> 0) or (FindWindow('TPropertyInspector', nil) <> 0) or (FindWindow('TAppBuilder', nil) <> 0);
          + end;
          end;

          // Prop Info

          But the result is the same.

          Any idea what might cause the problems or any work around? As you could imagine, users who still use Win 95 today won't be happy about me telling them they have to change to a newer Windows version.

          Thank you for your help!

          #40470
          Support
          Keymaster

            I will test the package with Win95 soon (I must find a machine with this system firstly).

            #40671
            weind
            Participant

              Thanks for applying these patches in 6.45.
              And thanks for doing some other changes – now my application can also be run under Win95 again.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.