• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

background form

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?
  • 5
  • 4
1 Solution

> 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:

  TForm1 = class(TForm)

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

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


{$R *.DFM}

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

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

easysoft_studiosAuthor Commented:
Thanks! It was the code I was looking for!
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... :)

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

easysoft_studiosAuthor Commented:
well, i've have before get critizied for giving too high grades, so I'm not so sure about giving grades.
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.

easysoft_studiosAuthor Commented:
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.
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:

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... :)
easysoft_studiosAuthor Commented:
i'll do that :)

thanks once again, it's allways nice to meet people who give time to help, guys like my self :)
No problem, glad to be of help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now