Solved

background form

Posted on 2002-07-26
9
161 Views
Last Modified: 2010-04-04
I've using this code on my forms OnPaint:

SetWindowPos(Handle, HWND_BOTTOM, Left, Top, Width, Height, SWP_SHOWWINDOW);

this causes my form to be in the background, just infront of the desktop.

But, if i drop a TListView on the form, and makes it alClient, it won't worke more! Why?
0
Comment
Question by:easysoft_studios
  • 5
  • 4
9 Comments
 
LVL 7

Accepted Solution

by:
Cynna earned 100 total points
ID: 7181159
easysoft_studios,

> But, if i drop a TListView on the form, and makes it alClient, it won't worke more! Why?

Simple - forms OnPaint event is not getting fired. Form is completly covered by ListView, right? So there isn't anything to paint on the form - only ListView is painted.
You can easily check this by putting a breakpoint in forms OnPaint handler.
By the way, even if you didn't use client alignement, this method is quite flickery.

To overcome these problems, handle WM_WINDOWPOSCHANGING message for your form.
Like this:

type
  TForm1 = class(TForm)

  // .... your components ....

  private
    { Private declarations }
     procedure WMWinPosChange(var Msg: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
  public


implementation

{$R *.DFM}

// .... your implementation code ....


procedure TForm1.WMWinPosChange(var Msg: TWMWindowPosChanging);
begin
   with Msg.Windowpos^ do
       if (flags and SWP_NOZORDER) = 0 Then hwndInsertAfter := HWND_BOTTOM;
   inherited;
end;

0
 

Author Comment

by:easysoft_studios
ID: 7181180
Thanks! It was the code I was looking for!
0
 
LVL 7

Expert Comment

by:Cynna
ID: 7181212
Thanks, but I'm curious about your grading criteria.
I mean, what should the A-grade answer for this question
contain, that is not in my answer?
Don't get me wrong, I'd just like to know what did I left out, so next time you get better answer, and I get better grade... :)

0
 

Author Comment

by:easysoft_studios
ID: 7181340
well, i've have before get critizied for giving too high grades, so I'm not so sure about giving grades.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:Cynna
ID: 7181981
Too high grades? Well, your last 10 grades were B B C B B C C B C B
I wouldn't exactly call these too high-grades...

OK, let me give you my point of view on this subject.
There are several things you can do to iritate experts, thus reducing your
chances of getting a response. They all can be seen from your profile.

This is my top-4 list of no-no's:

1. Leave a trail of opened questions that have been answered. Abandoning
   your questions when you got a working solution is *the* way too have
   people ignoring you on your next one.

2. Slow response. If it takes you weeks to react to somebody's comment,
   chances are it will get treated as 1.

3. Unclear feedback. If you don't explain what exactly is the problem,
   experts are going to have a much harder time in trying to solve it.
   
4. Poor grades. You see, grade is irrelevant to you, but it is relevant
   to expert, because expert points = question points * grade.
   Here are, in my opinion, fair grading guides:

   - If answer fully provides you with solution, you should grade it A.

   - If it provides you with partial solution, but one that you can
     modify to suit you, it should get a B.

   - If it gives you only a clue, and you have to 'dig-in' on that clue
     to get to the solution, it's a C grade.
   
   Of course, grading issue is much too elaborate to fit in here, but,
   IMHO, these are the thumb-rules. If you try following them, I don't
   think you'll get critisied any more.

0
 

Author Comment

by:easysoft_studios
ID: 7182036
I get your point. But i think my problem have been, that i did'nt understod the system of EE. But ofcourse, i glad that someone tells me, so i'm (hopeful) get's better, of using EE and grading answers.
Thanks for explaining it to me, course I never knew all those things you wrote.
0
 
LVL 7

Expert Comment

by:Cynna
ID: 7182064
Oh, I see... well that explains it than.
You might surf a bit on different areas of EE. They
are on the right side of your main view, under "EE Community" title.
The quetion/answer subject is somewhat covered here:
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#14

BTW, if you have any questions of how the system works,
or are insure about something, just ask any expert that
you are currently coresponding with. If you have any more
questions on the subject right now, I'd be glad to try
answering them for you.
Also, at any time you might ask a 0-point question in Community support group, I think. That questions are
answered by the people who mantain this site, so you
can't get any more relevant answer that that.
You'll find all the basic rules in the online help of EE,
just click a bit... :)
0
 

Author Comment

by:easysoft_studios
ID: 7182282
i'll do that :)

thanks once again, it's allways nice to meet people who give time to help, guys like my self :)
0
 
LVL 7

Expert Comment

by:Cynna
ID: 7182392
No problem, glad to be of help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to draw animated progressbar in Tvirtualstringtree 5 117
find a node in VST 2 64
Delphi and Access based Enumeration 9 48
Multi-layered image in FireMonkey 9 19
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now