bjoerng85

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Start Application on Windows 95 without Skinning #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!

      in reply to: Dynamic creation of the SkinManager #40384
      bjoerng85
      Participant

        I have fixed this problem with the method SkinManager.Loaded

        Now it works.

        Thanks for help.

        in reply to: Problem with caption changing #40109
        bjoerng85
        Participant

          I have replaced the UpdateSkin with RepaintForms and now it works.

          Thanks for help.

          in reply to: Problem with caption changing #40079
          bjoerng85
          Participant

            Because I have changed and added some components, when the application is already running. And this components aren't skinned right, without an UpdateSkin or RepaintForms.

            In the demo I made an UpdateSkin, to show the problem with the change of the forms caption.

            in reply to: Menu paint on maximize #39669
            bjoerng85
            Participant

              Thanks for fixing this problem.

              in reply to: Access Violation on FormClose #39558
              bjoerng85
              Participant

                I stop the repaint, when I close a Form.

                Stop repaint: SendMessage( Application.MainForm.Handle, WM_SETREDRAW, 0, 0 );
                Start repaint: SendMessage( Application.MainForm.Handle, WM_SETREDRAW, 1, 0 );

                in reply to: Problem with WM_SETREDRAW #39504
                bjoerng85
                Participant

                  I have seen, there is a new version and this problem is fixed now.

                  Thanks for your help

                  in reply to: Access Violation on FormClose #39380
                  bjoerng85
                  Participant

                    I have now solved this problem.

                  Viewing 8 posts - 1 through 8 (of 8 total)