Author | Message | Time |
---|---|---|
mentalCo. | Sorry for posting so much. IS there a way to scroll a rich text box without calling focus() first? | October 27, 2004, 3:55 PM |
Myndfyr | To make my window's custom scrolling setup (like WoW's): [img]http://www.armabot.net/pub/armabot-rtf-scroll.jpg[/img] I just checked through my code and found: [code] #region imports [DllImport("user32.dll")] private static extern bool GetScrollInfo( IntPtr hwnd, ScrollBarTypes fnBar, ref SCROLLINFO lpsi ); [DllImport("user32.dll")] private static extern int SetScrollInfo( IntPtr hwnd, ScrollBarTypes fnBar, ref SCROLLINFO lpsi, bool fRedraw); #endregion [/code] Might want to check those out on MSDN. In fact, here is SetScrollInfo. Actually, it looks like I didn't use that. Looks like I used SendMessage: [code] private void btnUpAll_Click(object sender, System.EventArgs e) { Exports.SendMessage( this.rtbChat.Handle, (uint)EditBoxMessages.EM_Scroll, ScrollBarCommands.SB_Top, 0); OnScrollerFocused(this.btnUpAll); this.m_fAutoScroll = false; } private void btnUp_Click(object sender, System.EventArgs e) { Exports.SendMessage( this.rtbChat.Handle, (uint)EditBoxMessages.EM_Scroll, ScrollBarCommands.SB_LineUp, 0); OnScrollerFocused(this.btnUp); this.m_fAutoScroll = false; } [/code] In the Exports class, I had: [code] /// <summary> /// <para>The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the specified window and does not return until the window procedure has processed the message. </para> /// <para>To send a message and return immediately, use the SendMessageCallback or SendNotifyMessage function. To post a message to a thread's message queue and return immediately, use the PostMessage or PostThreadMessage function.</para> /// </summary> /// <param name="hWnd">[in] Handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.</param> /// <param name="Msg">[in] Specifies the message to be sent.</param> /// <param name="wParam">[in] Specifies additional message-specific information.</param> /// <param name="lParam">[in] Specifies additional message-specific information.</param> /// <returns>The return value specifies the result of the message processing; it depends on the message sent.</returns> [DllImport("user32.dll")] public static extern int SendMessage( IntPtr hWnd, uint Msg, uint wParam, uint lParam ); [/code] | October 27, 2004, 7:04 PM |
mentalCo. | How do you use sendmessage in vb.net? edit: heres the solution: http://www.devcity.net/forums/topic.asp?tid=55822 | October 28, 2004, 12:08 PM |