Recommended Posts

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>

Example()

Func Example()
; Open the file for reading and store the handle to a variable.
Local $hFileOpen = FileOpen("test123.html",$FO_READ)
If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
Return False
EndIf

; Read the contents of the file using the handle returned by FileOpen.
Local $sFileRead = FileRead($hFileOpen)

; Close the handle returned by FileOpen.

Share on other sites

thanks so much my friend, seem you have a solution for every problem of mine

Share on other sites

You'r welcome !

Create an account

Register a new account

• Similar Content

• Hi, I thought I would never post a C/WinAPI related question in this forum ever, but here we are after a few years and me having learnt enough of C to write a basic console program
My issue is that I am trying to read my child process's stdout output but ReadFile never returns if the child exits or if it is killed... very strange , I have been trying to work my way around this. The options I can think of are:
Create a new thread and check for existance of the process constantly while reading Somehow make the pipe asynchronous (overlapped) so that I can read it in a non-blocking manner Fix ReadFile to return when the process ends Obviously I would prefer No. 3, I just want to make my program work. Here is my code if you guys want to take a look:

I appriciate the help of the WinAPI gurus here, thanks in advance!
• By jloyzaga
I am able to open notepad++ and open an xml file, select all the contents but I want to then click on the plugins menu item, select mime, and then select base 64.
This part eludes me can you help me please? - the plugin select etc
and then save as base64n.txt
sleep (200)
Send("{CTRLDOWN}a{CTRLUP}")
sleep (500)

ENTER select of plugin etc
save as XXXXXX.txt

• By oldtimer
If anyone has considered creating an interface for Notepad++ to support AutoIT, I think there would be a lot of interest.  I believe that Notepad++ is based on the same underlying editing engine as Scite.  I, for one, would be willing to pay for some of the Scite functionality for AutoIT to be ported to Notepad++.
Randy

• Just a word to the wise folks about trying to invoke notepad++.exe using the Run command: it won't work!
For some reason the Run command does not like the 2 +'s at the end of the filename.
I have tried and proved this by creating a stub that does nothing else but try to kick it off and it fails with a 0 handle and an @error of 1 until I remove the 2 +'s and then it fires it up nicely. This is, of course, only of use to me as other users who have installed Notepad++ won't want to rename the exe file as this will break the upgrade path.
This is most annoying as I use the full path to notepad++ in an ini file to allow users to choose their favourite editor when using my app and it defaults to Notepad (as it is designed to do) because it cannot "find" notepad++ (which was how I came to investigate the problem in the first place).
This didn't used to happen in earlier versions, any ideas Jon? It might even be the notepad++'s exe file used to not have the 2 +'s in but I have no way of finding this out.
• By Ontosy
I user notepad++ and "language help" plugin to display contestual help.
It work a small but annoying gap.
When it launch the AutoIt.chm it display searchead word but the index is empty with only "Merge" word.
Do it is a AutoIt.chm problem?
Do it is possible to solve?

×
×
• Create New...