Solved

Window Refresh API Question

Posted on 2001-07-31
9
358 Views
Last Modified: 2012-05-04
I need to have windows completely redraw a window, including the titlebar, system menu, and all controls.

This is due to displaying a popup window over a windowed DirectX area.  Windows does not seem to understand that the DirectX window was updated and thus, the popup window needs to be redrawn.

I have tried Me.Refresh and UpdateWindow Me.hWnd.  Neither of these works properly.  

Is there some message I can send to the window or API call that will tell Windows to just redraw the whole thing???

-- Brian
0
Comment
Question by:bpoff
9 Comments
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6338567
Set AutoRedraw = True
and change the forms zorder

Me.Zorder 0  'Bring it to the top and repaint
0
 
LVL 5

Expert Comment

by:KDivad
ID: 6338701
InvalidateRect. I don't remember for sure how it works, but it basically tells windows that the area's display has become invalid and needs to be repainted.
0
 
LVL 1

Author Comment

by:bpoff
ID: 6341407
Autoredraw=True does nothing in this case.  InvalidateRect also does not help as you can only invalidate the client area of the window.  I need to redraw the entire form, including the system menu, close button, and caption.

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:bpoff
ID: 6341469
Ah yes, the answer is to use a DirectDraw Clipper object.

The documentation on what these things do is so amazingly obscure that I just figured it out.

0
 
LVL 5

Expert Comment

by:KDivad
ID: 6342827
<<... only invalidate the client area of the window ...>>

You sure? I'm not doubting you, but I could swear I've seen it used on custom caption bars before!
0
 
LVL 1

Author Comment

by:bpoff
ID: 6344447
KDivad,

The reason I say it's only the client area of the window is that you have to specify a rectangle and an upper-left coordinate of 0,0 is the upper left of the client area of the window, not including the title bar.  

A better way to look at it is what do you get if you do a "GetWindowRect" on a form?  You get the coordinates of the window, not including the titlebar and its various gizmos.
0
 
LVL 5

Expert Comment

by:KDivad
ID: 6345718
Ah, ok. Maybe I am just remembering wrong then.

Anyway, I'm glad you found your answer!
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7198300
bpoff, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7213309
Per recommendation, points refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 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