End of text in asociated Notepad
End of text in asociated Notepad
Using the RunProgram(GetCurrentDirectory () + B$ + ".txt") , I open the associated Notepad.exe. I would like it to open at the end of the text (so that the end of the text can be seen immediately). Is it possible to arrange?
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
- RSBasic
- Moderator
- Posts: 1218
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: End of text in asociated Notepad
Do you mean like this?
Instead of FindWindow_() you can also use EnumWindows_().
Code: Select all
EnableExplicit
Define Handle
RunProgram("notepad.exe", "D:\HTMLCode.txt", "", 0) ; <<< Change path
Delay(500)
Handle = FindWindow_("notepad", 0)
If Handle
Handle = FindWindowEx_(Handle, 0, "Edit", 0)
If Handle
SendMessage_(Handle, #EM_SETSEL, $fffffff, $fffffff)
SendMessage_(Handle, #EM_SCROLL, #SB_BOTTOM, 0)
EndIf
EndIf
Re: End of text in asociated Notepad
I am impressed! So fast and so perfect answer. Thank you.RSBasic wrote:Do you mean like this?
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
Re: End of text in asociated Notepad
There is a very old function in NotePad, it's ability to serve as a log or memo.
To do this, you must:
- Write .LOG on the first line (and nothing else) (yes dot log)
- Save the file with the extension .log
At each opening, the notepad add the date and time and positions the cursor at the end (and not at the beginning).
Try:
(This is not relevant, but may be useful)
To do this, you must:
- Write .LOG on the first line (and nothing else) (yes dot log)
- Save the file with the extension .log
At each opening, the notepad add the date and time and positions the cursor at the end (and not at the beginning).
Try:
Code: Select all
C:\>echo .LOG > "LogFile.log"
C:\>notepad LogFile.log
Write something, save and open again
- VB6_to_PBx
- Enthusiast
- Posts: 625
- Joined: Mon May 09, 2011 9:36 am
Re: End of text in asociated Notepad
thanks Marc56us , for this nice Trick !Marc56us wrote:There is a very old function in NotePad, it's ability to serve as a log or memo.
To do this, you must:
- Write .LOG on the first line (and nothing else) (yes dot log)
- Save the file with the extension .log
At each opening, the notepad add the date and time and positions the cursor at the end (and not at the beginning).
Try:(This is not relevant, but may be useful)Code: Select all
C:\>echo .LOG > "LogFile.log" C:\>notepad LogFile.log Write something, save and open again
PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
Re: End of text in asociated Notepad
That's a really nice trick. I will use it in my NotePad reminder. Thanks.Marc56us wrote:There is a very old function in NotePad, it's ability to serve as a log or memo.............
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!