Tell an external program to redraw?

Windows specific forum
Seymour Clufley
Addict
Addict
Posts: 1266
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Tell an external program to redraw?

Post by Seymour Clufley »

Is there an API command for this?

I'm making a CDECL DLL that attaches child windows to a parent app, and it needs to tell the child windows to redraw whenever the parent app is restored.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

RedrawWindow_(hwnd, #Null, #Null, #RDW_UPDATENOW)

RDW_UPDATENOW Causes the affected windows (as specified by the RDW_ALLCHILDREN and RDW_NOCHILDREN flags) to receive WM_NCPAINT, WM_ERASEBKGND, and WM_PAINT messages, if necessary, before the function returns.

The two Nulls are for RECT and RGN, both of which I assume you want to ignore, resulting in the entire childwindow being redrawn.

However, if they're truly proper child windows, this should be happening automatically.
BERESHEIT
Seymour Clufley
Addict
Addict
Posts: 1266
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

Sorry, I forgot to state that none of the windows are created by PB. All PB does is attach the child windows to the parent window and, if necessary, handle messages going between the windows.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

If a window doesn't belong to your thread you can't read its message queue. You can send a message to it and it will in all likelihood respond, but there's no communication back to your program.
BERESHEIT
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

I'm not sure, but isn't it enough to send a #WM_REPAINT to the external program?
If so, you can achieve this easyly by using UpdateWindow_(handle).
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Post Reply