Click here to Skip to main content
16,005,552 members
Home / Discussions / C#
   

C#

 
GeneralRe: Question about class communication Pin
S. Senthil Kumar2-Aug-05 7:05
S. Senthil Kumar2-Aug-05 7:05 
GeneralRe: Question about class communication Pin
nc3b2-Aug-05 7:54
nc3b2-Aug-05 7:54 
GeneraliTunes and Podcasting Pin
Al_Pennyworth2-Aug-05 5:17
Al_Pennyworth2-Aug-05 5:17 
GeneralRe: iTunes and Podcasting Pin
Anonymous2-Aug-05 6:33
Anonymous2-Aug-05 6:33 
GeneralRe: iTunes and Podcasting Pin
Anonymous3-Aug-05 5:00
Anonymous3-Aug-05 5:00 
GeneralRemainder in / operation Pin
zaboboa2-Aug-05 5:11
zaboboa2-Aug-05 5:11 
GeneralRe: Remainder in / operation Pin
Guffa2-Aug-05 5:41
Guffa2-Aug-05 5:41 
GeneralAppend Text to Notepad programatically Pin
Alomgir Miah2-Aug-05 3:53
Alomgir Miah2-Aug-05 3:53 
To write to Notepad from c# without creating a file I found the following code.
I need this because I dont have write permission on the client but I need to show
the extracted data in the Notepad.


Private Declare Ansi Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32
Private Const WM_SETTEXT As Integer = &HC

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hwnd As Integer = FindWindow(vbNullString, "Untitled - Notepad") '/// assuming you have notepad open.
Dim x As Integer = FindWindowEx(hwnd, 0, "Edit", vbNullString)
Dim strText As String = "some text"
If Not x = 0 Then
SendMessage(x, WM_SETTEXT, 256, strText)
End If
End Sub


My question is: Is there a way to append text to notepad instead of WM_SETTEXT. I need this because sometimes the data to be extracted is huge and WM_SETTEXT may not suffice.

Live Life King Size
Alomgir Miah
GeneralSorting an array Pin
livez2-Aug-05 3:22
livez2-Aug-05 3:22 
GeneralRe: Sorting an array Pin
J4amieC2-Aug-05 3:42
J4amieC2-Aug-05 3:42 
GeneralRe: Sorting an array Pin
Mohamad Al Husseiny2-Aug-05 3:44
Mohamad Al Husseiny2-Aug-05 3:44 
GeneralRe: Sorting an array Pin
livez2-Aug-05 3:49
livez2-Aug-05 3:49 
GeneralRe: Sorting an array Pin
Alomgir Miah2-Aug-05 3:59
Alomgir Miah2-Aug-05 3:59 
GeneralRe: Sorting an array Pin
Mohamad Al Husseiny2-Aug-05 4:08
Mohamad Al Husseiny2-Aug-05 4:08 
GeneralRe: Sorting an array Pin
livez2-Aug-05 4:23
livez2-Aug-05 4:23 
Generalplease help me ! Pin
song guo chun(chinese)2-Aug-05 2:59
song guo chun(chinese)2-Aug-05 2:59 
GeneralRe: please help me ! Pin
Mohamad Al Husseiny2-Aug-05 3:24
Mohamad Al Husseiny2-Aug-05 3:24 
GeneralRe: please help me ! Pin
song guo chun(chinese)3-Aug-05 4:18
song guo chun(chinese)3-Aug-05 4:18 
GeneralGoing to the parent using XMLTextReader Pin
Duncan Sample2-Aug-05 2:51
Duncan Sample2-Aug-05 2:51 
GeneralRe: Going to the parent using XMLTextReader Pin
Alomgir Miah2-Aug-05 3:09
Alomgir Miah2-Aug-05 3:09 
Generalabout Datagrid Template columns Pin
chandru_inbox2-Aug-05 2:03
chandru_inbox2-Aug-05 2:03 
GeneralRe: about Datagrid Template columns Pin
Alomgir Miah2-Aug-05 3:05
Alomgir Miah2-Aug-05 3:05 
GeneralZip and Unzip files or folders Pin
aparajita2-Aug-05 1:51
aparajita2-Aug-05 1:51 
GeneralRe: Zip and Unzip files or folders Pin
Christian Graus2-Aug-05 2:14
protectorChristian Graus2-Aug-05 2:14 
GeneralRe: Zip and Unzip files or folders Pin
S. Senthil Kumar2-Aug-05 2:55
S. Senthil Kumar2-Aug-05 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.