|
Are bhai yahan be code nahi dete he.... bahat bure log he.
|
|
|
|
|
sitnet wrote: Please write for me one sample DFS code.
This isn't the way this site works. You seem to be mistaking us for rentacoder. Here's how it works - you work out what you need to do, you type in some code and we help you with the bits you can't get. We don't write assignments for you.
|
|
|
|
|
<br />
var visitor = new PathCollectingVisitor();<br />
graph.DepthFirstTraversal(visitor, start);<br />
|
|
|
|
|
Hi everyone, I'm developing an application that has a full control on another windows application.
Let me tell you about my story. I have an windows application(lets say "App A") which is very difficult for blind users because its GUI is so bad that the blind cannot use it even though they have a screen reader , but I cannot modify it at all since I don't have the source code of App A. So I decided to develop another windows application in C#(lets say "App B") which is easier to use. App B's task is only to get inputs from a user and then send those inputs to App A for processing. You may wonder why I have to send inputs to App A, why doesn't App B do everything by itself. The reason is that App B isn't able to do the main process as App A can since I don't have App A's code so I don't know how to do the main process.
Now I can send many commands by App B to App A via "SetForegroundWindow" and "SendKey" method, so I can order to click any button in App A or fill any textbox in App A and so on. But the problem is that I don't know how to grab the outputs which App A returned(all outputs are just text).
My current solution is to send "Ctrl C" to grab the output texts of App A and then use "Clipboard" to bring them into App B, but I think there must be a better solution than using "Ctrl C" and "clipboard". I had searched for the better solution, then I found many applications that can grab all the texts in any windows application. Unfortunately, they are for sale not for free, but I don't want to buy them, I want to grab text in another application by myself.
So, does anyone know how to grab texts which are displayed on another windows application ?
Please tell me, thank you very much.
|
|
|
|
|
Most of it can be done using some WinAPI calls. For grabbing text, you can use the GetWindowText[^] API call. This should work fine for button captions, label texts and many other controls.
For controls like list boxes you might first need to get the items in that listbox, which can be done using SendMessage with the appropriate parameters. They're all documented in MSDN, so you may need to pick the ones that work with your application.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I've tried using GetWindowText and I found that it can only grab a text on Window Title, it cannot grab texts on button caption, label and so on. Do you have another solution ? By the way, thank you for your help
|
|
|
|
|
According to MSDN:
To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.
So you might try to do a SendMessage(Handle, WM_GETTEXT, ..., ...) to the other control.
If I remember correctly this has worked for me in the past.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
AxSHDocVw.AxWebBrowser axWebBrowser1;
I am making a web editor(wysiwyg editor).
My program has a toolStrip and axWebBrowser control
When I want to change the font of the webbrowser, select my comboBox on toolStrip, it make the font change but the FOCUS Remain in Font ComboBox.
I want give the focus to axWebBrowser programmically.
here is the code that executed when the ComboBox SelectedIndex changed
case 32:
doc1.execCommand("FontSize", false, (object) ((ToolStripComboBox)sender).SelectedItem.ToString().Split('(',')')[1]);
Win32.SetForegroundWindow(axWebBrowser1.Handle);
Win32.SetFocus(new System.Runtime.InteropServices.HandleRef(null, axWebBrowser1.Handle));
please take care of my question. thanks a lot.
|
|
|
|
|
Hello,
Have you tried:
axWebBrowser1.Focus();
It worked for me. Hope it helps.
Jason.
|
|
|
|
|
Hi All,
I'm using VS C# 08 EXPRESS EDITION / WINDOWS FORMS APP. Now, I would like to know if there is a way to publish my prject as a standalone application (where there is just one .EXE file THAT IS THE ACTUAL PROGRAM ITSELF) or where it publishes the project as JUST ON INSTALLATION FILE. I am really getting sick and tired of these files that VS produces (Application Files Folder, Setup.exe, Project Manifest file). I have had no luck in finding a solution to my problem. Can anybody please offer any advice/tutorial etc... i'd appreciate any help i can get on this thanks for reading.
regards,
j.t.
|
|
|
|
|
You always can, its the .exe in the bin\Debug\ folder...
|
|
|
|
|
You should rather compile in Release mode, and use the file in the bin\Release folder.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Oh.....That's.......Awesome! Thanks for that buddy!
You've made my day!
j.t.
|
|
|
|
|
A very strange exception. I have a DAL assembly, which is signed, that I'm using in my application. Everything compiles fine and runs in debug and release on my local machine. I can run the app outside of VS, no problems. Now when I move the app and all appropriate assemblies to a test machine I get a MissingMethodException. Using Reflector I've verified that the method does exist in the DAL assembly. If I do not sign the assembly everything to works fine. I don't understand the connection with signing the assembly. I know I'm missing something but can't see it. Anyone have some insight into this problem?
only two letters away from being an asset
|
|
|
|
|
Hi,
Not sure, but not really surprised either:
maybe the signed DLL ends up in the GAC, whereas the unsigned one is near your EXE, and one
of them is missing a method. When the EXE knows it looks for an unsigned one it checks its folder
first, and when you rebuild based on a signed DLL I guess it looks in the GAC (first).
Hope this helps.
|
|
|
|
|
Good thought, but all assemblies are local. I used xcopy to deploy them to the test machine which is a VM so I'm certain (99% at least) that the assemblies aren't on the machine to begin with.
only two letters away from being an asset
|
|
|
|
|
I am developing a software that needs to know when the PASTE EVENT (through the context menu or ctrl+V) happens (only for files / directories). More or less, something like it happens with TeraCopy or Copy Handler. When you copy and then paste, it is TeraCopy thats handles the pastings.
I know more or less how to capture the COPY EVENT, you only have to set a ClipboardViewer and you catch all global COPY EVENTS (in fact is called: WM_DRAWCLIPBOARD). You can learn this here: http://www.radsoftware.com.au/articles/clipboardmonitor.aspx But the ClipBoardViewer does not provide you with the ability to catch the PASTE EVENT.
This software must not only work for ctrl+v, but also when you click on the option of paste in the context menu (right click).
|
|
|
|
|
Are you looking for WM_PASTE ?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I think WM_PASTE does not occur when you copy a file or directory. So I think this is not the solution.
I know I need a hook and perhaps written in C++ but I don't know how to do it.
Perhaps using EasyHook or madcodehook libraries, but this is
difficult for me, I would need some help.
|
|
|
|
|
I think for this you'll need to have a look at shell32.dll, probably SHChangeNotify[^] and on MSDN[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Could you supply any code? I am really clumsy with hooks.
|
|
|
|
|
Hi All,
I am writing a web browser application using Visual Studio 08 Express Edition C#. Windows Forms Application... But, one of the hardest problems is that I have founf almost ZERO support for the tabControl. And yes, I've checked MSDN. I need to let the user open new tabs, and have a new web browser control placed inside that newely created tab.
Then I want the user to be able to use the navigation buttons (back forward etc) for each of the web browser controls within the tabs. But, I cannot do this, I also want to be able to use any web browser command for every tab there is. I have tested every code sample i've found and nothing works. Can somebody please help me? Any advice/samp code/tutorials etc would be GREATTLY APPRECIATED!
thanks,
jt.
|
|
|
|
|
Hello there,
I don't know what you tried before, maybe if you post your codes here we can help you better.
I think this will help you.
Assume you have a menuStrip and have an Open command which should opens a text file into RTB (Each Tab has a RTB).
void mnuOpen_Click (object sender, EventArgs e)
{
TabPage tp = tabControl.SelectedTab;
tp.Controls["RTB"].Text = strng.Format("Open clicked in tab no.{0}", (tabControl.SelectedIndex + 1).ToString());
}
Hope Helps
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Thank you so much for your quick reply!
Following, is the code for my Web Browser. It simple creates a new Tab, adds a page and a new WebBrowser in it:
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
page.Controls.Add(wb);
I'm having trouble accessing each individual web browser control. I want to be able to also display the name of the website on the actual tab. Can't seem to do that though... I just got your email and am about to test your code Which I'm looking forward to...
Thanks,
jt.
|
|
|
|
|
Okay, I couldn't get the code to work. It compiles. But just doesn't work at runtime, nor does it bring up any errors. Weird. Thanks your your help though, I appreciate it.
Here's my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace JT_Explorer
{
public partial class Form1 : Form
{
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HTCAPTION = 0x2;
[DllImport("User32.dll")]
public static extern bool ReleaseCapture();
[DllImport("User32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
public Form1()
{
InitializeComponent();
}
private void Stop_Click(object sender, EventArgs e)
{
Status.Text = ("Operation aborted.");
}
private void AddressBar_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
page.Controls.Add(wb);
wb.Navigate(AddressBar.Text);
}
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.Close();
this.Dispose();
Environment.Exit(-1);
}
private void Like_MouseEnter(object sender, EventArgs e)
{
LikedList.Visible = true;
LikedList.BringToFront();
}
private void LikedList_MouseLeave(object sender, EventArgs e)
{
LikedList.Visible = false;
}
private void Tags_Click(object sender, EventArgs e)
{
MessageBox.Show("Disabled.");
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.Hide();
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 15);
}
}
private void pictureBox3_Click(object sender, EventArgs e)
{
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
page.Controls.Add(wb);
TabPage tp = tabControl1.SelectedTab;
tp.Controls["wb"].Text = string.Format("kjh", (tabControl1.SelectedIndex + 1).ToString());
}
private void pictureBox2_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab.Dispose();
}
private void Back_Click(object sender, EventArgs e)
{
WebBrowser wb = tabControl1.SelectedTab.Controls[0] as WebBrowser;
wb.GoBack();
}
private void Forward_Click(object sender, EventArgs e)
{
WebBrowser wb = tabControl1.SelectedTab.Controls[0] as WebBrowser;
wb.GoForward();
}
}
}
|
|
|
|
|