Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Delphi/Python

Delphi/Python Forum for discussing Borland Delphi and Python coding techniques, tips and tricks. Ask your python questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-2008, 10:49 AM
Gaski Gaski is offline
Newbie
 
Join Date: Feb 2008
Posts: 1
Rep Power: 0
Gaski is on a distinguished road
Default Problem with drawing functions

Hi,
I have an application, that is drawing a simple text on my desktop.
I have two button created on desktop, and when i click one of them the text is displayed. It should be displayed all the time, but when I put something on it (for example if I move an icon into the text area), , the text dissapears.

I'm using global hook to see if the button is pressed.
My painting code :
Delphi Code:
  1. //if hook catch an WM_PAINT message it sends a message to application // application code when the WM_PAINT message is found:
  2.  
  3.   DC := BeginPaint(GetDesktopListViewHandle, PS);
  4.       SetBkMode(DC, TRANSPARENT);
  5.       SetTextColor(DC, RGB(0, 0, 0));
  6.       TextOut(DC, 1024 - 200, i, Pchar(s), Length(s));
  7.       EndPaint(GetDesktopListViewHandle, PS);

and the GetDesktopListViewHandle function looks :

Delphi Code:
  1. function GetDesktopListViewHandle: THandle;
  2. var
  3.   S: String;
  4. begin
  5.       Result := FindWindow('ProgMan', nil);
  6.       Result := GetWindow(Result, GW_CHILD);
  7.       Result := GetWindow(Result, GW_CHILD);
  8.       SetLength(S, 40);
  9.       GetClassName(Result, PChar(S), 39);
  10.       if PChar(S) <> 'SysListView32' then
  11.       Result := 0;
  12. end;

I must redraw the text, when something is put on it, but i don't know after what message should I redraw it, and how ?

Please help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-13-2008, 05:12 PM
Tiago2 Tiago2 is offline
Newbie
 
Join Date: May 2008
Posts: 2
Rep Power: 0
Tiago2 is on a distinguished road
Default Re: Problem with drawing functions

This may not be a best solution but u could always create a procedure for Application.OnIdle to redraw the test... its messy i know
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Peculiar UI Problem Needs Tackling adriyel C# Programming 2 04-06-2008 07:46 AM
How to tackle a programming problem? TcM General Programming 10 01-07-2008 11:29 AM
[C] Comparison problem Alhazred C and C++ 1 08-29-2007 04:58 AM
! Need urgent help ! Drawing program using cygwin siren C and C++ 0 05-26-2007 10:51 PM
Weird problem with code, functions when not suppose to Murph-s C and C++ 0 05-14-2007 07:11 PM


All times are GMT -5. The time now is 10:36 AM.

Contest Stats

dargueta ........ 93.00000
John ........ 87.50000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads