forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Force a window to redraw itself?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Apr 30, 2009 4:48 am    Post subject: Force a window to redraw itself? Reply with quote

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
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Thu Apr 30, 2009 12:50 pm    Post subject: Reply with quote

Sending an f5 keystroke has worked for some windows for me, but not all...

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Apr 30, 2009 2:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Apr 30, 2009 3:52 pm    Post subject: Reply with quote

Thanks. Doesn't seem to want to work on the VDS IDE though Sad

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Apr 30, 2009 4:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Apr 30, 2009 6:17 pm    Post subject: Reply with quote

#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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri May 01, 2009 2:14 pm    Post subject: Reply with quote

Got any code I can play with?
If its top secret that's ok Wink

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri May 01, 2009 5:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sat May 02, 2009 4:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun May 03, 2009 12:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun May 03, 2009 12:30 am    Post subject: Reply with quote

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 Smile

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sun May 03, 2009 12:30 pm    Post subject: Reply with quote

Glad it works.
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Sun May 01, 2011 10:18 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group