|
I have the window handle of another window (found it using findwindow)
Now I need to find that windows state.. ie. is it minimized or not?
I've spent ages messing with Getwindowlong, but i cant make anything of it. Can anyone help me out?
|
|
|
|
|
Are you trying to inter-op on GetWindowLong ? Hmm...
There is a static method Control.FromHandle that will return a Control object of the window handle. Because I'm paranoid, I would use Control.TopLevelControl which is a better shot at getting something that is Form object. If you can get the Form you can call Form.WindowState which will indicate if it is minimized, maximized, or normal.
At least I guess it would. I have never tried doing this on handle that is outside of the application.
|
|
|
|
|
cheers, ill try it out when ive got a spare hour or so
|
|
|
|
|
Hi
I extended a textbox control and created a property i.e
public enum myVarEnum {Apple,Mango,Peach};
protected myVarEnum myvar1;
public myVar MyProperty
{
get { return myvar1; }
set { myvar1 = value; }
}
Now when i use this extended control i am getting the property as a dropdown and i am able to select, the problem is the value i select doesnot persist..for example if i select "Mango" it goes back to the first one "Apple" after i build the solution. i guess its a small mistake plz help me overcome this...
Regards
Deepak.S
|
|
|
|
|
Hi!
Is there any elegant (and fast, have to run across >100MB of text!) way to perform a case-insensitive string replace?
String or StringBuilder don't allow me to specify the type of comparison (case sensitive or not) in their Replace() methods, with RegEx I can run into problems when the search string contains characters with special meaning in regular expressions.
Any pearls of wisdom?
TIA,
mav
|
|
|
|
|
Hello, can anyone help me with this ?
I have an Arraylist filled with User-objects (containing name and account info).
lstSource.DataSource = personList;<br />
lstSource.DataTextField = "firstName";<br />
lstSource.DataBind();
This works nice: see screenshot[^]
Now comes the problem, how do I retrieve the objects that I placed in the listbox? I mean something like:
user person = lstSource.SelectedItem;<br />
string name = person.Firstname;
or
user person = (user)lstSource.SelectedItem;<br />
string name = person.Firstname;
|
|
|
|
|
The items in the listbox are not user objects, and therefore cannot be extracted from the listbox. You could guess the user based on the information present in the ListViewItem.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
Hello,
I need to get audio level from the microphone in C# using MCI.
I found "status level" parameter using mciSendString method. But I can't run it. I need a sample code.
I want to use sound card microphone input like an A/D converter.
Thanks,
Ali
-
|
|
|
|
|
I have a C# windows program that consists of one main screen that is an mdi container for a few other screens.
On occassion when some of the child forms are being created and a external Lotus Notes new mail item messagebox pops up the program is interrupted, the windows handles are not created, and, subsequently the program becomes unusable.
Has anybody experienced this in the past and can provide some help?
Emma Potter
Software Engineer
|
|
|
|
|
Hi,
I have a custom control that i am writing that inherits from UserControl, this control needs to "do something" when a double click occurs on it.
Is there anyway to change the double click event to use something other than a "EventArgs" object so that the main form that the control sits on gets something usefule back when the control is double clicked.
What i'd like to be able to do is something like this...
DoubleClick(object sender, MyCustomEventArgs e)
Is this possible? The ways i have tried gie me "not matching delegate" errors.
Thanks
Si
|
|
|
|
|
Define your MyEventArgs class and inherit from EventArgs:
public class MyEventArgs : EventArgs
{
String _myString = String.Empty;
public MyEventArgs(String aString)
{
_myString = aString;
}
public string MyString
{
get { return _myString; }
set { _myString = value; }
}
}
In the user control, override the OnDoubleClick() method and "replace" the EventArgs with your own MyEventArgs:
protected override void OnDoubleClick(EventArgs e)
{
MyEventArgs args = new MyEventArgs("MyEventArgs");
base.OnDoubleClick(args);
}
In your main form, listen to the DoubleClick event and typecast the EventArgs back to MyEventArgs:
private void MyControlDoubleClicked(object sender, EventArgs e)
{
MyEventArgs args = (MyEventArgs)e;
MessageBox.Show(args.MyString);
}
hth
Claudio
Claudio's Website
|
|
|
|
|
Thanks, that does solve the problem in what seems the best way considering the limitations of the delegate.
I was just hoping i could avoid having to get the form to do a cast in its double click listener.
Si
|
|
|
|
|
The short answer: No
The long answer:
No, you can't send other parameters to that delegate, but you can create your own..
You can create your own doubleclick event by using the click event and track position and time between the clicks.. If you go for this solution, you should find a way to find out the double click rate on the computer...
|
|
|
|
|
_eulogy_ wrote:
The short answer: No
If you say no, what's wrong with my answer I already wrote before you? I tried it and it worked. Any drawbacks in my solution I didn't saw?
Claudio
Claudio's Website
|
|
|
|
|
You're absolutily right
I totally missed that solution
|
|
|
|
|
Hey!
Is there a way in Framework 2.0 to work against a devce connected to the USB port? like regular com ports or will we have to make a driver in C++ to make it work?
In this case we want to connect a Cell Phone to a program throw a USB connection.
Best Regards
Jimmy
|
|
|
|
|
Not through pure .NET, I'm afraid. You can use managed C++ and C# together to do this, search the web for more info.
Also, there are some C# serial port articles on codeproject; if you had a USB-to-Serial hardware, you'd be able to do this through managed code.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
I did some hardware programming with USB 2.0 using QuickUSB from Bitwise Systems.
/\ |_ E X E GG
|
|
|
|
|
We have a third party application that handles some SQL management (SQL Server 2000). We do not have the source code or any documentation on how this application works.
In this third-party application, a user has to log on with some credentials and the application checks with a database if the username and password is correct.
I don't know if this is possible, but what I would like to do, is to create an application that executes a certain list of commands on the database whenever someone tries to log on within the third-party application. Since I don't have the sourcecode to the third-party application I have to write another one that executes parallell to this one.
My question is if it's possible for my application to know that the third-party application is executing a certain Stored-Procedure or a command. Are there any events/messages that I could catch?
Any ideas would be appreciated ...
Thanks
// T
|
|
|
|
|
Hi i'm working on this control which exists of a
ParentControl -> containercontrol
ChildControls -> containercontrol
when i add the childcontrols to the parentcontrol the parentcontrol calculates the size of
the childcontrol all that works fine aswel in designer as in runtime
but when i add controls(eg button,...) with the designer in the child control they show good but when i click
the "build application" button the size of the controls in that childcontrol change they become much larger
(note i do set the anchor value but still the behaviour is abnormal)
i've been trying to find this problem for days now with no succes please if you have encountered the same problem or now a sollution pls let me know.
i attaches a sample of this behaviour you should.
build to see the behaviour
Sample
thx in advance.
|
|
|
|
|
|
did you look at the sample.
anchoring is not the problem here the problem is that the size changes when anchoring is set during build the size is back normal when you run the application.
if it where the anchoring i whould be glad but i also whould of found it by now then.
pls look at the sample if you want to help.
|
|
|
|
|
hi all
i am migrating to C# now , and kindly i have so many questions about using FCL instead of MFC
for example
how to Get and set desktop image in C#?
thx for ur interest in advance
|
|
|
|
|
This functionality is not exposed through the current .NET framework class library. Use P/Invoke to call the Win32 SystemParametersInfo API.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
Hi
I am Converting a Vb.net code to c#. But i can't find an alternative for
FileGet( 1, TecFile) in C#.
Please help me.
Thanks & Regards,
Rathish
|
|
|
|