C :: Inject HTML Into Firefox Process / IE?
Oct 24, 2013is this possible? How do i inject html into a process like firefox.exe or iexplore.exe? any tutorials/ starting point?
View 1 Repliesis this possible? How do i inject html into a process like firefox.exe or iexplore.exe? any tutorials/ starting point?
View 1 RepliesSo basically I have to write a C program that, when opening the html file in a browser, looks essentially like this: (Size, position, color of the shapes doesn't matter so long as I have one of each shape and the box surrounding them. Words up top dont matter either.)
This is what I have so far:
Code:
#include <stdio.h>
#include <stdlib.h>
#define FILENAME ("A4P1.html")
[code]....
Anyways i can get the individual shapes, but I don't know how to get all the shapes to appear at once..
I am making a web browser and I have successfully made it so it shows the actual html but I want to know how to run the html within the program. I am using mac so it can't be the #include "windows.h" stuff and preferably I would like it to be cross-platform.
View 3 Replies View RelatedThis time I need to generate random shapes (circles, rectangles, squares, and ellipses) with random attributes with C, to html.
I am able to create specific shapes with random attributes, but I am unsure how to have the function create a random shape...
Also, the function "box" is meant to create a black border around the shapes. It does this, but I do not know how to make it so that the other shapes do not show up along the lines of this "box."
I guess it appears that certain shapes are "layered" over top of others? ie. My circles/ellipses always show up on top of the rects/squares/box.Currently I have this:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NO_SHAPES 10
#define X_RANGE 797
#define Y_RANGE 397
[Code] .....
For this program i had to create an HTML with the cosine similarities. I got everything, i just need to color in the lowest and highest amount in the table, but I don't know how.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <cstdio>
using namespace std;
const int ARRAY_OF_ASCII_CODES_SIZE=256;
const int NUMBER_OF_FILES=8;
[Code] .....
I am trying to make a simple c++ program that will read some text in the html page. Here is the source of the html i want to read.
<html>
<body>
This is a test message.
</body>
</html>
My expected result in c++ in an string array like this:
This
is
a
test
message
I tried to look around and I came across a function called InternetReadFile but I can't find any example similar to what I want.
I have a program that converts document files to html , however there's a very strange issue with the program, it is only converting files that i open within the program using fstream i.e. ofstream out("test.doc"); now ill have to copy the contents from another document that i want to convert to this test file and it would convert but if i try converting a document that has not been implicitly created it would give me a garbage .html file.
#include <iostream>
#include <fstream>
#include <cassert>
#include <string>
#define tab " "
// file extensions that the program can handle
// you can add more extenssions if needed
using namespace std;
char *fileExt[] = {".doc", ".c", ".cpp"};
void convert_to_html(string fileName);
[Code] ....
I would like to be able to call c++ library from HTML page. So on HTML page I have area for some possible input (url, name, email, etc) and that info is passed to c++ and calculated info and may email someone; or pull info from text file and display on html page. Realizing PHP or something similar would be easier, I really want to make these calls from HTML pages. ???
View 2 Replies View RelatedI have an HTML5 form with a number of text boxes on it. I would like these textboxes populating with data retreived from an SQL database, using inline C#. I have a stored procedure that returns the data.
View 8 Replies View RelatedI need to know how to parse the html tag using xmlreader.
This is my input. How to parse this input html file
<html> <body> <p><b><i>Hello</b>World</i></p> </body> </html>
How can I read text from a webpage asynchronously,from within C++. After you first connect to the internet using usual means, you enter the string
e.g. "[URL] ...." and the C++ program reads the information: "<title>BBC Website</title><body>This is the BBC website...." from the internet.
Here I want to connect to website every 60 minutes and fetch only first 100 lines of the run.txt file as mentioned above. How can I do this using C++ and asynchronous winsock ???
Code:
#define WIN_OS
#define _DEBUG_PRINT(X) /* X */
//For commn
#include <iostream>
#include <string>
#include <stdlib.h>
#include <assert.h>
[Code] .....
I am trying to store the HTML codes for different characters in an array, but I am not sure how to do this, so that when using the keybd_event it can be plugged in.
If you try to do it with a string for storing the HTML code, you get this error.
string HTML[1];
HTML[0] = "A"; //A
keybd_event(HTML[0], 0, 0, 0);
I could do it in a very long if/else statement, but this would be much easier to call and get data from, and take up less space.
convert this file to an excel or ms access file?
View 10 Replies View RelatedI had a quick question about how to check the balance of brackets in an HTML file using a stack (pushing and popping). I understand pushing and popping. I get lost when it comes to the logic of having to actually check what is in the brackets, and making sure those are nested correctly.
So while
<title><b> THIS FILE </b> USES CORRECTLY NESTED TAGS </title>
is correct and
<title> <b> THIS FILE </title> IS </b> NOT NESTED CORRECTLY.
is incorrect;
How do I check for the actual tags inside the brackets, keeping in mind that there are single sided tags as well.
(ex. <img src="a.jpg"/>)
I want to:
1. Load HTML File (or take stuff from string)
2. display window with content of that html
so yeah, basically something like a browser, is there some lib that will just load html and do it for me? I dont need whole browser, I just need to show really simple html pages in my app....
Is it possible to fill a textbox on a webpage using the onkeydown html element in c# using the web control built in. i am totally aware of the normal methods of doing this but the normal methods have failed to work....
i am referring to this [URL] .....
1. Open a browser and navigate to a URL (manually)
I would like to do the following from a windows application:
2. I will click "Fill data" button from Windows screen,
3. We have to identify what are the browsers opened in the PC and which browser has correct URL
4. Once the correct browser is identified with the URL, we have to fill in data (received from scanner) in the html page opened in the browser.
How to achieve above functionality.
I am using CDHtmlDialog in my MFC application to create a UI with HTML, CSS & JavaScript.
In my project there's one dialog created from CDHtmlDialog and a corresponding HTML file for that dialog.
Now during run time i want to change the contents of the HTML file.
Not just the HTML part, i want to change the CSS & JavaScript too.
So basically what am trying to do is, change the entire content of the default HTML file.
Is this possible? If yes, how can i do that?
I created a MFC dialog using CDHtmlDialog and added a HTML page with many controls and one of them is a IMAGE tag. I got a default image loaded from the hard drive displayed in the HTML page. Up to this part, everything works fine.
Now what i want to do is, dynamically change the image based on the user click on one of the HTML buttons. I don't want this image source to be hard coded in the HTML nor the image source send from the MFC app.
What i want is for the MFC app to send the image data to the HTML in some (binary) format and then the page to display the image.
The possible option i was thinking of was to read the image file which is already in my hard drive as a binary file and send the binary data across to the HTML as a memory buffer, and then use JavaScript to decrypt this binary data and display the image.
Basically what i want is for the HTML page to display a image from the memory. how to do this?
I have to write a c++ program to read html code and do bunch of stuff. One thing that i have to do is to count the no of attributes and sort them in descenting out and print out only first 10 frequently used attributes. I counted them using maps and sorted them using multimaps but now dnt knw how to print only 10 elements
for(std::map<string, int>::iterator it = Element.begin(); it != Element.end(); ++it)
Elements.insert(pair<int, string>(it->second, it->first));
for(std::multimap<int, string>::reverse_iterator it = Elements.rbegin(); it != Elements.rend(); ++it) {
cout << "Element: " << it->second << " : " << it->first << endl;
}
This is how i did it . How to display only 10 elements and not all the elements.
I tried to do this with _spawnl(), but first of all I'm not sure how to properly ask for the path to iexplore.exe, as I'm sure it will change every time MS gets a whim to move it. I know there's a GetWindowsDirectory() call, but that's not where IE resides (its in "C:Program FilesInternet Exploreriexplore.exe" in XP, Lord know where on win 7 or 8).
Also, even temporarily hard coding the path to make it launch with spawnl(), I can't seem to get my html document to display. I know the path to that is right (since I put it there ).
char * pFile = "someFile.htm";
char * pCmd = "C:Program FilesInternet Exploreriexplore.exe";
int res = _spawnl(_P_NOWAIT, pCmd,pCmd, pFile, NULL); // also tried without specifying pCmd 2x
if (res == -1) MessageBox("Can't Open File.");
So my second question would be, how to you PROPERLY pass the file to view as an argument.
I am writing an MFC app in Visual Studio 2012 that will open a JPG file as binary and read all the contents to a CString.
I am able to read it to a std::Vector, but that doesn't work much as i need to pass all the binary content as a MFC CString to another function.
More Update:
Let me explain the problem a little more deeper.
I am trying to call a JavaScript (JS) function in a HTML page and then want to pass the binary date. The C++ function that calls the JS is given below.
bool CallJavaScript(const CString strFunc,CComVariant* pVarResult);
The 1st argument is the JS Function Name and 2nd is the one to pass the Binary Data. 1st argument works fine as i am able to call the JS fucntion called "LoadImage" without any problem. Problem is with 2nd argument that's supposed to take the Binary data of the JPG file.
If i try to pass a std::Vector or std::string then it will give me an error.
But it's happy if i pass CString. But then with CString there's a problem with NULL characters.
Actually my plan is to pass the binary of a JPG to a JS function and let it display the JPG in the HTML page.
Can i typecast a Vector or std::string to a CComVariant*?
I'm working on a CGI application. I'm trying to test my input with a switch statement and output the result with html tags to populate a web page. From within the switch, I've coded as follows:
HTML Code:
switch(mFunc) {
case 0:
cout << "<p><b>YOU ENTERED THE FOLLOWING TO BE CALCULATED:</b></p>" "<h2>"<< number1 <<"+" << number2 << "</h2>" << endl;
break;
case 1:
cout << "You've entered" << number1 <<"-" << number2 << "to be evaluated" << endl;
break;
I know that I'll need to put this in an html body with a content type as such:
HTML Code:
cout << "Content-type: text/html
";
cout << "<html><body>
";
Am I able to do that directly inside of the switch statement?
I have app that has while true on input listening to changes and then in some condition needs to open simple gtk app, and afterwards continue listening.
I thought that i could fork gtk part, and kill it when it is not needed.
But am not finding much examples on internet. 2 processes dont share data. Can child process start a gui app? And is this a good approach.
I am looking for a way to run a process form memory, without having any executable. The application will be kept inside a resource and will be extracted during run time. It should be then started as a new process. I couldn't find a solution that works also on x64
View 5 Replies View RelatedI need my Unix program to generate a directory with a format like this: "hinesro.<pid>". I have some code that mostly works, except for the directory ends up with a question mark on the end, like this: "hinesro.12345?". I need it to just display the directory without this question mark. Here is my code:
Code:
// Using headers sys/types.h, sys/stat.h, unistd.h, and stdio.h
int pid = getpid();
char prefix[] = "hinesro.";
char fileName[0];
sprintf(fileName, "%s%d
", prefix, pid);
[Code]...