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 


API for removing scrollbars from Tables?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sat Oct 17, 2009 3:33 am    Post subject: API for removing scrollbars from Tables? Reply with quote

Hi All,

Is anyone aware of a way to remove horizontal and vertical scrollbars from a Table element? Perhaps an API? I have checked out some of the dsu's but have not found anything that works for me...

I need a way to remove the scrollbars and then add them again.

Thanks!

- Boo
Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sat Oct 17, 2009 11:48 pm    Post subject: Reply with quote

Here is some api code that is part of a DSU I wrote a while back.

Code:
 #DEFINE COMMAND,tScroll
 #DEFINE FUNCTION,tScroll

:tScroll
  #IMPORTANT: All values for Vertical scroll positioning are expressed in lines(normal is 16 pixels)
  #           and values for Horizontal scroll positioning are expressed in pixels.
  %X = -1
  LOADLIB user32.dll
#******************************FUNCTIONS***************************#
  REM @tScroll(<table>,<param>,(option))
  # <param> can be either H (horizontal) or V (vertical). <option> can be S (size), M (nMax)
  If @equal(%2,H)@equal(%2,V)@equal(%2,S)
   %h = @strdel(@winexists(~%1),1)
    %6 = @BINARY(DWORD,28)@BINARY(DWORD,@sum($1,$2,$4,$10))@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)
    if @equal(%2,H)
      %X = @lib(user32.dll,GetScrollInfo,INT:,DWORD:%h,INT:0,@addr("%6"))
      If @unequal(@sum(@val(@substr(%6,13,16)),1),@val(@substr(%6,17,20)))
        %X = @val(@substr(%6,25,28))
      end
      FREELIB user32.dll
    elsif @equal(%2,V)
      %X = @lib(user32.dll,GetScrollInfo,INT:,DWORD:%h,INT:1,@addr("%6"))
      If @unequal(@sum(@val(@substr(%6,13,16)),1),@val(@substr(%6,17,20)))
       %X = @val(@substr(%6,25,28))
      end
      FREELIB user32.dll
    elsif @equal(%2,S)
     %s = @regread(HCU,"Control Panel\Desktop\WindowMetrics",ScrollWidth)
     %X = @div(%s,-15)
    else
    %X = Err!
    end
    %s = @regread(HCU,"Control Panel\Desktop\WindowMetrics",ScrollWidth)
    if @equal(%3,M)
     %X = %X|@val(@substr(%6,17,20))
    end
    if @equal(%3,S)
     %X = %X|@div(%s,-15)
    end
    if @equal(%3,M)
     %X = %X|@val(@substr(%6,17,20))
    end
    if @equal(%3,S)
     %X = %X|@div(%s,-15)
    end
    exit %X
   end
   
#*******************************COMMANDS***************************#

  %h = @strdel(@winexists(~%2),1)
 
  REM tScroll ENABLE,<table>,<param>
  # <param> can be either "H" (horizontal) or "V" (vertical) or "BOTH".
  if @equal(%1,ENABLE)
   if @equal(%3,H)
    %X = @lib(user32.dll,EnableScrollBar,BOOL:,DWORD:%h,INT:0,$0)
   elsif @equal(%3,V)
    %X = @lib(user32.dll,EnableScrollBar,BOOL:,DWORD:%h,INT:1,$0)
   elsif elsif @equal(%3,BOTH)
    %X = @lib(user32.dll,EnableScrollBar,BOOL:,DWORD:%h,INT:3,$0)
   end
   FREELIB user32.dll
   exit
  end
 
  REM tScroll DISABLE,<table>,<param>
  # <param> can be either "H" (horizontal) or "V" (vertical) or "BOTH".
  if @equal(%1,DISABLE)
   if @equal(%3,H)
    %X = @lib(user32.dll,EnableScrollBar,BOOL:,DWORD:%h,INT:0,$3)
   elsif @equal(%3,V)
    %X = @lib(user32.dll,EnableScrollBar,BOOL:,DWORD:%h,INT:1,$3)
   elsif @equal(%3,BOTH)
    %X = @lib(user32.dll,EnableScrollBar,BOOL:,DWORD:%h,INT:3,$3)
   end
   FREELIB user32.dll
   exit
  end
 
  REM tScroll SHOW,<table>,<param>
  # <param> can be either "H" (horizontal) or "V" (vertical) or "BOTH".
  if @equal(%1,SHOW)
   if @equal(%3,H)
    %X = @lib(user32.dll,ShowScrollBar,BOOL:,DWORD:%h,INT:0,1)
   elsif @equal(%3,V)
    %X = @lib(user32.dll,ShowScrollBar,BOOL:,DWORD:%h,INT:1,1)
   elsif @equal(%3,BOTH)
    %X = @lib(user32.dll,ShowScrollBar,BOOL:,DWORD:%h,INT:3,1)
   end
   FREELIB user32.dll
   exit
  end
 
  REM tScroll HIDE,<table>,<param>
  # <param> can be either "H" (horizontal) or "V" (vertical) or "BOTH".
  if @equal(%1,HIDE)
   if @equal(%3,H)
    %X = @lib(user32.dll,ShowScrollBar,BOOL:,DWORD:%h,INT:0,0)
   elsif @equal(%3,V)
    %X = @lib(user32.dll,ShowScrollBar,BOOL:,DWORD:%h,INT:1,0)
   elsif @equal(%3,BOTH)
    %X = @lib(user32.dll,ShowScrollBar,BOOL:,DWORD:%h,INT:3,0)
   end
   FREELIB user32.dll
   exit
  end
 
  REM tScroll SETPOS,<table>,<param>,<position>
  # <param> can be either "H" (horizontal) or "V" (vertical).
  if @equal(%1,SETPOS)
  %6 = @BINARY(DWORD,28)@BINARY(DWORD,@sum($4))@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)
   if @equal(%3,H)
    %X = @lib(user32.dll,SetScrollInfo,INT:,DWORD:%h,INT:0,%6)
    %X = @Sendmsg(~%2,4116,%4,0)
   elsif @equal(%3,V)
    %X = @lib(user32.dll,SetScrollInfo,INT:,DWORD:%h,INT:1,%6)
    %X = @Sendmsg(~%2,4116,0,@prod(%4,16))
   end
   FREELIB user32.dll
   exit
  end


Last edited by Aslan on Mon Oct 26, 2009 1:56 am; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Mon Oct 19, 2009 8:49 pm    Post subject: Reply with quote

Thanks Aslan. Not exactly what I was looking for, but good to know! Wink
Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Oct 21, 2009 1:01 am    Post subject: Reply with quote

Boo,
I modified the script above to add SHOW and HIDE options.

I haven't had a change to test it yet so let me know if it works for you.

Update: I've had a chance to test it and it works Smile
Back to top
View user's profile Send private message Send e-mail
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Thu Feb 11, 2010 1:35 pm    Post subject: Reply with quote

Can you post an example on how to use this comand/functions?
Because im trying whitout luk...
Thanks a lot!!!
Back to top
View user's profile Send private message
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