Solved

background form

Posted on 2002-07-26
9
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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