View previous topic :: View next topic |
Author |
Message |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Thu Apr 30, 2009 4:48 am Post subject: Force a window to redraw itself? |
|
|
I've been looking through source codes and the api help file, even searched the forum here, but nothing jumping out at me yet on this one.
Does anyone know if it's possible from VDS to force another non-VDS window to refresh itself?
Thanks in advance,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Hooligan VDS Developer
Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Thu Apr 30, 2009 12:50 pm Post subject: |
|
|
Sending an f5 keystroke has worked for some windows for me, but not all...
Hooligan _________________ Hooligan
Why be normal? |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Apr 30, 2009 2:37 pm Post subject: |
|
|
Quote: | The UpdateWindow function updates the client area of the specified window by sending a WM_PAINT message to the window if the window's update region is not empty. The function sends a WM_PAINT message directly to the window procedure of the specified window, bypassing the application queue. If the update region is empty, no message is sent. |
Code: | %%window = @winexists(#MozillaUIWindowClass)
if %%window
%%hwnd = @strdel(%%window,1,1)
else
warn Unable to get window handle.
exit
end
loadlib user32.dll
%P = @lib(user32,UpdateWindow,BOOL:,INT:%%hwnd)
if %P
info Successfully sent UpdateWindow to %%hwnd
else
warn Unable to send UpdateWindow to %%hwnd
end |
_________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Thu Apr 30, 2009 3:52 pm Post subject: |
|
|
Thanks. Doesn't seem to want to work on the VDS IDE though
Trying to make a addon tool for VDS and it needs to send text to the editor window. Was trying to avoid the typing affect by using the sendmsg's to lock the redraw and then unlock it. But doing that on the VDS editor does lock it, but when you unlock it, it doesn't refresh.
Guess I'll just skip the extra stuff and let put up with the typing affect. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Apr 30, 2009 4:02 pm Post subject: |
|
|
You sent it to the IDE's #TSyntaxMemo window?
It'd probably be the only #TSyntaxMemo class on your system to test it, but I would step through the IDE's child windows for a working version. _________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Thu Apr 30, 2009 6:17 pm Post subject: |
|
|
#TSyntaxMemo doesn't seem to want to cooperate at all, but #TMainWin cooperates. But neither respond to the api call to refresh.
I've since cut the code out and just let the typing affect take place. The amount of data I send to the editor isn't a great deal at all anyway, so it shouldn't be an issue.
Thanks for the help though,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri May 01, 2009 2:14 pm Post subject: |
|
|
Got any code I can play with?
If its top secret that's ok _________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri May 01, 2009 5:07 pm Post subject: |
|
|
Code: | IF @winexists(#TmainWin)
rem %Z = @winexists(#TmainWin)
rem %A = @sendmsg(%Z,$0B,0,0)
WINDOW SEND,@winexists(#TmainWin),%%WrkDir
rem %A = @sendmsg(%Z,$0B,1,0)
ELSE
WARN "It doesn't seem that the VDS IDE is currently open."
END |
Just place whatever in %%WrkDir, and the code for locking redraw and unlocking is rem'd out right now.
I tried your code after the unlock message there.
But that's it, that's the code I was working with. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat May 02, 2009 4:15 pm Post subject: |
|
|
Does this work for you?
Code: |
%%WrkDir = C:\Program Files\VDS\Test
%%hwnd = @winexists(#TMainWin)
if @not(%%hwnd)
warn VDS IDE Not Open.
exit
end
REM Step through and find #TSyntaxMemo
while @unequal(%%class,TSyntaxMemo)
%%hwnd = @window(%%hwnd,CHILD)
%%class = @winclass(%%hwnd)
wend
WINDOW ACTIVATE,%%hwnd
%A = @sendmsg(%%hwnd,$0B,0,0)
WINDOW SEND,%%hwnd,%%WrkDir
%A = @sendmsg(%%hwnd,$0B,1,0)
exit
|
_________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun May 03, 2009 12:21 am Post subject: |
|
|
At the moment, that seems to do the job... Let me try it in my program and see if it still works with that.
BRB! _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun May 03, 2009 12:30 am Post subject: |
|
|
Works in my project, but I did find one thing, that is that you must activate the window prior to doing anything. If you don't, then the window will get stuck with an image of any other windows that may have been above it. Which is what I was experiencing in the first place and looking for a way to force the VDS IDE to redraw itself.
Many thanks for the help snarlingsheep _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sun May 03, 2009 12:30 pm Post subject: |
|
|
Glad it works. _________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Sun May 01, 2011 10:18 pm Post subject: |
|
|
Little late. Sorry.
Code: |
loadlib user32.dll
%P = @lib(user32,InvalidateRect,BOOL:,INT:%%hwnd,0,1)
%P = @lib(user32,UpdateWindow,BOOL:,INT:%%hwnd)
freelib user32.dll
|
|
|
Back to top |
|
|
|