Hello all
I'm trying to use the scrollwindowex api however I have the same problem as
this guy had. There is an answer here in the reply. I just need some help
converting it to VB.Net
[color=blue]
>Thanks Peter, it works. I have another question for you. What does the
>clip rectangle passed on the 5th argument does?
>
>Thanks
>Tony
>
>
>"Peter Huang [MSFT]" <v-phuang@online.m icrosoft.com> wrote in message
>news:VQ757BURD HA.1720@cpmsftn gxa09.phx.gbl.. .[color=green]
>> Hi Tony,
>>
>> I consult the MSDN and find that the RECT structure required by the ?
>> °ScrollWindowEx ¡± API is different from the class ¡°Rectangle¡±. I think
>> you may declare your ¡°ScrollWindowE x¡± API as follows.
>> public class win32
>> {
>> [DllImport("user 32.dll")]
>> public static extern int ScrollWindowEx(
>> IntPtr hWnd,
>> int dx,
>> int dy,
>> [MarshalAs(Unman agedType.Struct )] ref Rectangle prcScroll,
>> [MarshalAs(Unman agedType.Struct )] ref Rectangle prcClip,
>> IntPtr hrgnUpdate,
>> [MarshalAs(Unman agedType.Struct )] out Rectangle prcUpdate,
>> [MarshalAs(Unman agedType.U4)] int flags);
>>
>> }
>> Then you may invoke the API as below.
>> private void button1_Click(o bject sender, System.EventArg s e)
>> {
>> Rectangle rt = new Rectangle();
>> Rectangle rtout = new Rectangle(0,0,1 0,10);
>> Rectangle rtin = new
>> Rectangle(20,20 ,richTextBox1.W idth,richTextBo x1.He ight);
>> int rr=win32.Scroll WindowEx(richTe xtBox1.Handle,0 ,10,r ef rtin,ref
>> rt,IntPtr.Zero, out rtout,0);
>> System.Console. WriteLine(rr.To String());
>> }
>>
>> Hope this will help.
>>
>> Best regards,
>> Peter Huang
>>
>> Regards,
>>
>> Peter Huang
>> =============
>> This posting is provided "AS IS" with no warranties, and confers no[/color]
>rights.[color=green]
>>
>> --------------------[color=darkred]
>> >From: "Tony" <engineliu@hotm ail.com>
>> >Subject: Calling the ScrollWindowEx API
>> >Date: Fri, 4 Jul 2003 08:45:32 +0800
>> >Lines: 21
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.3790.0
>> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>> >Message-ID: <ee1WWWcQDHA.28 32@TK2MSFTNGP10 .phx.gbl>
>> >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
>> >NNTP-Posting-Host: cm203-168-247-148.hkcable.com .hk 203.168.247.148
>> >Path: cpmsftngxa09.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTN GP10.phx.gbl
>> >Xref: cpmsftngxa09.ph x.gbl[/color][/color][/color]
microsoft.publi c.dotnet.langua ges.csharp:3051 9[color=blue][color=green][color=darkred]
>> >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
>> >
>> >Hi, I am having problem to scroll only a partion of a window using the
>> >ScrollWindow Ex api function. The code is below and any help is pleased.
>> >Thanks in advance.
>> >
>> >
>> >[DllImport("user 32.dll")]
>> >private extern int ScrollWindowEx (IntPtr handle, int dx, int dy,[/color][/color]
>Rectangle[color=green][color=darkred]
>> >lprcScroll , Rectangle lprcClip, IntPtr hrgnUpdate, out Rectangle
>> >lprcUpdate, int fuScroll);
>> >
>> >Rectangle rt;
>> >
>> >// This works
>> >ScrollWindowEx (Handle, 0, 30, Rectangle.Empty , Rectangle.Empty ,[/color]
>> IntPtr.Zero,[color=darkred]
>> >out rt, 0);
>> >
>> >// This doesn't work
>> >ScrollWindowEx (Handle, 0, 30, new Rectangle(20, 20, ClientSize.Widt h,
>> >ClientSize.Hei ght), Rectangle.Empty , IntPtr.Zero, out rt, 0);[/color][/color][/color]
URL: http://www.pcreview.co.uk/forums/thread-1349023.php
I have the same problem
This works:
ScrollWindowEx( Handle, 0, 30, Rectangle.Empty , Rectangle.Empty , IntPtr.Zero,
Rectangle.Empty , 0)
This doesn't work
ScrollWindowEx( Handle, 0, 30, new Rectangle(20, 20, ClientSize.Widt h,
ClientSize.Heig ht), Rectangle.Empty , IntPtr.Zero, rectangle.empty , 0)
Many Thanks
Scott
I'm trying to use the scrollwindowex api however I have the same problem as
this guy had. There is an answer here in the reply. I just need some help
converting it to VB.Net
[color=blue]
>Thanks Peter, it works. I have another question for you. What does the
>clip rectangle passed on the 5th argument does?
>
>Thanks
>Tony
>
>
>"Peter Huang [MSFT]" <v-phuang@online.m icrosoft.com> wrote in message
>news:VQ757BURD HA.1720@cpmsftn gxa09.phx.gbl.. .[color=green]
>> Hi Tony,
>>
>> I consult the MSDN and find that the RECT structure required by the ?
>> °ScrollWindowEx ¡± API is different from the class ¡°Rectangle¡±. I think
>> you may declare your ¡°ScrollWindowE x¡± API as follows.
>> public class win32
>> {
>> [DllImport("user 32.dll")]
>> public static extern int ScrollWindowEx(
>> IntPtr hWnd,
>> int dx,
>> int dy,
>> [MarshalAs(Unman agedType.Struct )] ref Rectangle prcScroll,
>> [MarshalAs(Unman agedType.Struct )] ref Rectangle prcClip,
>> IntPtr hrgnUpdate,
>> [MarshalAs(Unman agedType.Struct )] out Rectangle prcUpdate,
>> [MarshalAs(Unman agedType.U4)] int flags);
>>
>> }
>> Then you may invoke the API as below.
>> private void button1_Click(o bject sender, System.EventArg s e)
>> {
>> Rectangle rt = new Rectangle();
>> Rectangle rtout = new Rectangle(0,0,1 0,10);
>> Rectangle rtin = new
>> Rectangle(20,20 ,richTextBox1.W idth,richTextBo x1.He ight);
>> int rr=win32.Scroll WindowEx(richTe xtBox1.Handle,0 ,10,r ef rtin,ref
>> rt,IntPtr.Zero, out rtout,0);
>> System.Console. WriteLine(rr.To String());
>> }
>>
>> Hope this will help.
>>
>> Best regards,
>> Peter Huang
>>
>> Regards,
>>
>> Peter Huang
>> =============
>> This posting is provided "AS IS" with no warranties, and confers no[/color]
>rights.[color=green]
>>
>> --------------------[color=darkred]
>> >From: "Tony" <engineliu@hotm ail.com>
>> >Subject: Calling the ScrollWindowEx API
>> >Date: Fri, 4 Jul 2003 08:45:32 +0800
>> >Lines: 21
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.3790.0
>> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>> >Message-ID: <ee1WWWcQDHA.28 32@TK2MSFTNGP10 .phx.gbl>
>> >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
>> >NNTP-Posting-Host: cm203-168-247-148.hkcable.com .hk 203.168.247.148
>> >Path: cpmsftngxa09.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTN GP10.phx.gbl
>> >Xref: cpmsftngxa09.ph x.gbl[/color][/color][/color]
microsoft.publi c.dotnet.langua ges.csharp:3051 9[color=blue][color=green][color=darkred]
>> >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
>> >
>> >Hi, I am having problem to scroll only a partion of a window using the
>> >ScrollWindow Ex api function. The code is below and any help is pleased.
>> >Thanks in advance.
>> >
>> >
>> >[DllImport("user 32.dll")]
>> >private extern int ScrollWindowEx (IntPtr handle, int dx, int dy,[/color][/color]
>Rectangle[color=green][color=darkred]
>> >lprcScroll , Rectangle lprcClip, IntPtr hrgnUpdate, out Rectangle
>> >lprcUpdate, int fuScroll);
>> >
>> >Rectangle rt;
>> >
>> >// This works
>> >ScrollWindowEx (Handle, 0, 30, Rectangle.Empty , Rectangle.Empty ,[/color]
>> IntPtr.Zero,[color=darkred]
>> >out rt, 0);
>> >
>> >// This doesn't work
>> >ScrollWindowEx (Handle, 0, 30, new Rectangle(20, 20, ClientSize.Widt h,
>> >ClientSize.Hei ght), Rectangle.Empty , IntPtr.Zero, out rt, 0);[/color][/color][/color]
URL: http://www.pcreview.co.uk/forums/thread-1349023.php
I have the same problem
This works:
ScrollWindowEx( Handle, 0, 30, Rectangle.Empty , Rectangle.Empty , IntPtr.Zero,
Rectangle.Empty , 0)
This doesn't work
ScrollWindowEx( Handle, 0, 30, new Rectangle(20, 20, ClientSize.Widt h,
ClientSize.Heig ht), Rectangle.Empty , IntPtr.Zero, rectangle.empty , 0)
Many Thanks
Scott
Comment