Find out character at particular console location - c++

Is there any way to read a character from a specific location on the console? For example Read_Console_Char(10, 40);?

I don't know if there is a standard way to do this, but in Windows environment you can do that.
I've never read from arbitrary location, just writing to it with the use of SetConsoleCursorPosition and GetStdHandle. I Just looked on MSDN and there are related API's to get the contents, such as ReadConsoleOutput. Here is the link to it: ReadConsoleOutput example.
Hope that helps

Related

How to track the number of times my console application in C++14 has been launched?

I'm building a barebones Notepad-styled project (console-based, does not have a GUI as of now) and I'd like to track, display (and later use it in some ways) the number of times the console application has been launched. I don't know if this helps, but I'm building my console application on Windows 10, but I'd like it to run on Windows 7+ as well as on Linux distros such as Ubuntu and the like.
I prefer not storing the details in a file and then subsequently reading from it to maintain count. Please suggest a way or any other resource that details how to do this.
I'd put a strikethrough on my quote above, but SO doesn't have it apparently.
Note that this is my first time building such a project so I may not be familiar with advanced stuff... So, when you're answering please try to explain as is required for a not-so-experienced software developer.
Thanks & Have a great one!
Edit: It seems that the general advice is to use text files to protect portability and to account for the fact that if down-the-line, I need to store some extra info, the text file will come in super handy. In light of this, I'll focus my efforts on the text file.
Thanks to all for keeping my efforts from de-railing!
I prefer not storing the details in a file
In the comments, you wrote that the reason is security and you consider using a file as "over-kill" in this case.
Security can be solved easily - just encrypt the file. You can use a library like this to get it done.
In addition, since you are writing and reading to/from the file only once each time the application is opened/closed, and the file should take only small number of bytes to store such data, I think it's the right, portable solution.
If you still don't want to use a file, you can use windows registry to store the data, but this solution is not portable

Full list of functions, commands for MS Word from c++

I'm working with word through my c++ application. And I want to read some documentation about available opportunities. I see some piece of code of some paticular situations (to add a picture, to add text, to save file, to fill table) in forums, but I want to observe all functions.
Tell me where can I get such documentation or how to find it.
The full documentation can be found on MSDN: http://msdn.microsoft.com/en-us/library/ff841702

C++, console Application, reading files from directory

I have a directory and I want to read all the text files in it using C++ and having windows OS also using console application
I don't know the files' names or their number
thanks in advance
Take a look at Boost.Filesystem, especially the basic_directory_iterator.
If you want the C++ and portable way, follow the solution by #Space_C0wb0y and use boost.Filesystem, otherwise, if you want to get your hands dirty with the Windows APIs, you can use the FindFirstFile/FindNextFile/FindClose functions.
You can find here an example related to them.

How can I extract the current user's account picture?

I am trying to extract the current user's account picture in Windows 7, but I can't seem to figure out where it is located. I have found that the picture is sometimes written to the User's temp folder, but only after performing certain actions. It isn't always guaranteed to be there. Has anyone had any luck extracting this image? Thanks!
Update: I am trying to extract the image using C++, but help in any language would be a big step. :)
Whenever an API call needs the UserTile, it is copied to %TEMP%\%USERNAME%.bmp, which is usually C:\Users\username\AppData\Local\Temp\username.bmp.
But if you need to extract it directly from SAM, you can adapt the details from http://deployment.xtremeconsulting.com/2010/06/23/usertile-automation-part-1/, to make a program to read HKLM\SAM\SAM\Domains\Account\Users\????????\UserTile (in system context!), skip 12 bytes, read 4 bytes to uint, and read that uint number of bytes into a file.
Edit: I feel I should add that the API call that Explorer in Windows XP uses to get the icon, is an unnamed address in one of the logon DLL's (hence you can not call it yourself, since that address should change between versions), I can not remember which exact DLL at the moment.
It's described here under User Profile Tiles in Windows 7. It doesn't seem very encouraging.
I'm not sure about how you want to extract the picture. But if you just could use windows explorer, go to C:\Users\(your-username)\AppData\Local\Temp. The image file is named as (your-username).bmp
I got this from http://www.sevenforums.com/tutorials/5187-user-account-picture-change.html. I have checked it and it worked.

Programmatically monitor files on Windows

I'm looking for a way to monitor which processes are using (or attempting to access) a file over a duration of time. What are some good Windows APIs or tools to achieve this?
You could replace the file by a reparse point. The reparse point invokes a custom file system filter, which can redirect the access to anothe file. This is for instance how NTFS junctions work. If you let your file system filter handle reparse points in the same way, you can intercept all attempts by all processes to open the underlying file. It's a rather heavy-handed approach though, as it involves modifying the file system itself.
You can use the FileSystemWatcher.
Here's a nice tut.
http://www.geekpedia.com/tutorial173_File-monitoring-using-FileSystemWatcher.html
FileSystemWatcher is not suitable for determining the process.
There already was a different question. look here, this solution fits your needs.