Board index » delphi » Problems Porting from TPW

Problems Porting from TPW

Hi all,

First off, this is not Delphi bashing. I come from the land of hard
coding *everything* so maybe I'm just missing something by having it
all done for me :-) ...

While porting software from TPW to Delphi I found that certain things
just don't work the same anymore. I'd appreciate comments as to what the
heck Borland (and/or I) is doing :-)

  1) In TPW, I could override the ClassName call to assign a ClassName of
my own. That way, using a FindWindow("MyUniqueClassName",nil) was
guaranteed to find *my* Window. It just is not possible anymore?! The
application now has the generic "TApplication" ClassName...

  2) The whole concept of "forms" is great but it really mucks things up.
Here are a few things that are quite STRANGE:

    a) Delphi no longer MINIMIZES your app but rather causes the "main
form" to "hide"!!! Using a "spy" program I checked the handle of my
"open" app vs. the icon and they were different! This program also showed
them as being different classes - i.e. the open window/form is a TMyForm
and the Icon is a TApplication. Further, the WM_SIZE call is NOT passed
when you "minimize" a MAIN form! What gives?

    b) The above causes lots of problems when you try to make a
Window/form be "AlwaysOnTop". In the good old days (TPW), calling a
dialog from a form with this property put the dialog ON TOP of that
Window. Now you need to call NormalizeTopMosts which just "unsets" the
topmost property temporarily! I tried going back to the good old API
calls but then you have the problem mentioned in "a)" above. Your Icon is
NOT topmost while your "open" window is! Ugh.

    c) And now the clincher! I tried finding info on any advances Delphi
has made to Drag and Drop (meaning File Manager SHELL.DLL based - NOT
just within an app). I found zilch. So I used the good old API calls
(DragAcceptFiles. DragQueryPoint, etc) and this works GREAT if I pass it
the Handle to my MAIN FORM but as mentioned in "a)" this is NOT the
handle to the ICON!!! The result is that you get the "not" bar if you try
to drag a file from FM to your icon.

I guess the big question, is why! Why is the minimized app DIFFERENT from
the "open" app window? Having an action performed when a window gets
minimized is quite popular. The OnResize call is useless because it has
the bsSingle BorderStyle (i.e. it is NOT resizable other than being able
to minimize it - which Delphi doesn't consider resizing!?).

Please CC: a copy of all and any replies to:

si...@snappy.globalone.net AND comp.lang.pascal.delphi.misc

Thanks in advance,
G.---

 

Re:Problems Porting from TPW


Hi all,

First off, this is not Delphi bashing. I come from the land of hard
coding *everything* so maybe I'm just missing something by having it
all done for me :-) ...

While porting software from TPW to Delphi I found that certain things
just don't work the same anymore. I'd appreciate comments as to what the
heck Borland (and/or I) is doing :-)

  1) In TPW, I could override the ClassName call to assign a ClassName of
my own. That way, using a FindWindow("MyUniqueClassName",nil) was
guaranteed to find *my* Window. It just is not possible anymore?! The
application now has the generic "TApplication" ClassName...

  2) The whole concept of "forms" is great but it really mucks things up.
Here are a few things that are quite STRANGE:

    a) Delphi no longer MINIMIZES your app but rather causes the "main
form" to "hide"!!! Using a "spy" program I checked the handle of my
"open" app vs. the icon and they were different! This program also showed
them as being different classes - i.e. the open window/form is a TMyForm
and the Icon is a TApplication. Further, the WM_SIZE call is NOT passed
when you "minimize" a MAIN form! What gives?

    b) The above causes lots of problems when you try to make a
Window/form be "AlwaysOnTop". In the good old days (TPW), calling a
dialog from a form with this property put the dialog ON TOP of that
Window. Now you need to call NormalizeTopMosts which just "unsets" the
topmost property temporarily! I tried going back to the good old API
calls but then you have the problem mentioned in "a)" above. Your Icon is
NOT topmost while your "open" window is! Ugh.

    c) And now the clincher! I tried finding info on any advances Delphi
has made to Drag and Drop (meaning File Manager SHELL.DLL based - NOT
just within an app). I found zilch. So I used the good old API calls
(DragAcceptFiles. DragQueryPoint, etc) and this works GREAT if I pass it
the Handle to my MAIN FORM but as mentioned in "a)" this is NOT the
handle to the ICON!!! The result is that you get the "not" bar if you try
to drag a file from FM to your icon.

I guess the big question, is why! Why is the minimized app DIFFERENT from
the "open" app window? Having an action performed when a window gets
minimized is quite popular. The OnResize call is useless because it has
the bsSingle BorderStyle (i.e. it is NOT resizable other than being able
to minimize it - which Delphi doesn't consider resizing!?).

Please CC: a copy of all and any replies to:

si...@snappy.globalone.net AND comp.lang.pascal.delphi.misc

Thanks in advance,
G.---

Other Threads