- This topic has 5 replies, 4 voices, and was last updated 15 years, 1 month ago by weind.
-
AuthorPosts
-
September 4, 2009 at 6:51 am #33228bjoerng85Participant
In my application all the standard components have been replaced with the AlphaControls components.
But now this application doesn't start on a system with Windows 95. The Skinmanager, Skinprovider aren't initialized. So the Skinning is completely disabled.
Is there a way to start a application with the AlphaControls components on Windows 95?
September 8, 2009 at 8:41 am #40398SupportKeymasterHello
You have an error message in this situation?
Are you sure that skins was found and application can load them?September 8, 2009 at 6:28 pm #40422alex000ParticipantI`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:
CODEif (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.
September 9, 2009 at 8:57 am #40425bjoerng85ParticipantLet 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!
September 14, 2009 at 2:25 pm #40470SupportKeymasterI will test the package with Win95 soon (I must find a machine with this system firstly).
October 5, 2009 at 2:48 pm #40671weindParticipantThanks for applying these patches in 6.45.
And thanks for doing some other changes – now my application can also be run under Win95 again. -
AuthorPosts
- You must be logged in to reply to this topic.