|
I want to hide windowxp taskbar from C#.net.
Who can help me?
pls...
|
|
|
|
|
|
Hi kyawsoe;
The only way I know how to do this is by using unmanaged code. The two functions you need to call are FindWindow and SetWindowPos which are found in user32.
Here is some code to do it.
Import the two dll's [DllImport("user32.dll",EntryPoint="FindWindow",CharSet=CharSet.Unicode)]
static extern IntPtr MyFindWindow(string _WindowClassName, string _WindowName);
[DllImport ("user32.dll",EntryPoint="SetWindowPos",CharSet=CharSet.Unicode)]
static extern bool MySetWindowPos (IntPtr hWnd, Int32 hWndInsertAfter,
Int32 X, Int32 Y, Int32 cx, Int32 cy, uint uFlags);
Define some variables
private IntPtr hTaskWindow; // Handle to task window
private const uint TOGGLE_HIDEWINDOW = 0x80;
private const uint TOGGLE_UNHIDEWINDOW = 0x40;
You can place this in form load event or somewhere appropriate. It is the handle to the task bar
hTaskWindow = MyFindWindow("Shell_traywnd", "");
Now when you want to hide the task bar execute this statement
MySetWindowPos(hTaskWindow, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW);
Or when you want to un-hide the task bar execute this statement
MySetWindowPos(hTaskWindow, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW);
That's it.
I hope that is was of some help.
-Fernando Soto
|
|
|
|
|
Ok, now that I have access to my data I need to display it in another aspx page. How do I do this?
What I am trying to do is use one of my frames to display different bits of informtion depending on what the user is doing.
|
|
|
|
|
You would be answerded if you ask this in the asp.net forums.
|
|
|
|
|
Hello,
How can i block Pop-Ups in a AxBrowser Component? has a way to do this?
Thanks.
|
|
|
|
|
|
|
|
Man, the other topic wasn't well written nor well understood :\, so i'm still without answser!
The articles I found didn't helped me to find out how to block Pop-ups directly
|
|
|
|
|
Lol o.o
I got it
the answer:
NewWindow Event
private void web_NewWindow(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e)<br />
{<br />
e.cancel = true;<br />
}
Thanks
|
|
|
|
|
Being an intermediate programmer, I'm having a hard time understanding the documentation that is out there regarding this topic.
Let's say I have two objects, derived from ClassA and ClassB. The lifecycle of Class B is as follows:
-ClassA instantiates an instance of ClassB, and places this object into, say, a hashtable.
-ClassB does its thing for a while, but then becomes useless.
-ClassA removes ClassB from the hashtable. Now, there is no reference to that object within ClassA.
What happens to ClassB? Is it still floating out there in memory? Do I need to tell ClassA to actually destroy the ClassB object, or does the GC already know that ClassA no longer refers to ClassB, and therefore destroys it automatically?
Thanks for your help.
|
|
|
|
|
tantiboh wrote:
Is it still floating out there in memory?
Yes, for an indeterminate amount of time, until the GC puts the memory back into the general pool ("collects" it).
tantiboh wrote:
Do I need to tell ClassA to actually destroy the ClassB object
No. Not unless ClassB was using some non-managed resources.
does the GC already know that ClassA no longer refers to ClassB, and therefore destroys it automatically?
Yes.
It's hard to get ones arms around this, coming from C++. There's a lot of good articles out there. Try googling on "Understanding .NET Garbage Collection".
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
I'm using a System.Timers.Timer object. How can I get (or calculate an estimate for) the amount of time remaining on the timer? The estimate wouldn't have to be any more accurate than a few dozen milliseconds.
It's an ASP project, so System.Windows.Forms.Timer is not available.
Thanks for you help.
|
|
|
|
|
tantiboh wrote:
How can I get (or calculate an estimate for) the amount of time remaining on the timer?
Here's an idea: derive your own timer that hooks the Elapsed event. Whenever the timer fires, do an intervalStartTicks=DateTime.Ticks or something.
Have a method in your derived class called "RemainingTime", or something like that, that gives you Interval - DateTime.Ticks - intervalStartTicks, doing the appropriate unit conversions.
You might also want to provide your own Start method that sets the intervalStartTicks as well.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Hi everybody!
In Java such a piece of code
<br />
javax.swing.JFrame frame = null;<br />
try<br />
{<br />
frame = Class.forName("javax.swing.JFrame");<br />
}<br />
catch (Exception e) {}<br />
would create a new JFrame object (of course if the string provided isn't a correct name exceptions are thrown).
Is there s similar mechanism in C#? Becouse if there is it would let me ommit many string.Equals() and is calls and make the code a whole lot easier to read.
|
|
|
|
|
Look at System.Activator.CreateInstance, or you can do the same if you already have a reference to an assembly.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
All Happy Now!
We have an existing ASP.NET app (C# backend) that was originally written with weakly named backend objects, distributed to our customer's via traditional "XCOPY" (actually InstallShield, but just dropping files in the right location), so that all of the necessary DLL's are installed in the /bin directory of the default website. This works fine for just one app.
Now, we are in the process of adding additional applications to our existing one, and in order to do that, we are strong-naming our components and trying to install them to the GAC, so that they can be globally referenced. I have successfully strong-named all of our components, and can put them into the GAC without issue as well. However, when I remove the /bin directory after having placed the components in the GAC, I get "Object Not Found" errors when trying to run the app.
Is there something I need to change in the way my .DLLs reference each other, so that the app will search the GAC when loading?
This is somewhat urgent as we are midway through the design process and starting to reconfigure our existing code. If our distribution plans are misinformed, we need to know now so we can lay a better path.
Thanks for any help we can get!
|
|
|
|
|
This doesn't directly answer your question, but I wouldn't put assemblies into the GAC during development. This can be a real pain, because you have to specifically tell gacutil to uninstall the assembly first or force it to re-install over an existing install:
gacutil /f /i myassembly.dll
But this fails if you've installed the assembly with MSI, because it can only be uninstalled using MSI!
It's easier to add things to the GAC as part of installation and test the installation separately--NOT on the development platform. Use VirtualPC or something to ensure a clean, reproducable install environment.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Thanks, but distribution is what I'm trying to test at this point. We've already got the development environment running and compiling together with the strong-named assemblies. It's when I try to test how the application works with its core dlls in the GAC that I'm running into trouble.
One thing that I'm doing that may not be right is I'm using the Windows Explorer add-on to install the dlls to the GAC, not GACUtil. I wouldn't think that's the problem, because I get the same failures when I use the InstallShield distribution. So I figured it has something to do with how we reference the DLLs.
Thanks for looking and responding!
Kerry
|
|
|
|
|
|
I imagine this topic has been resolved many times, but I beg for your help.
I am trying to run the most simple Remoting example and simply it refuses to work in my computer.
Why? I don't know but this is really bother me.
You can see one example that also can not run in my computer following the link:
http://www.codeproject.com/csharp/RemotingChatSample.asp
Could you please tell me what is my problem.
Regards
Ewing
|
|
|
|
|
Hi;
If you are running this accross a network, have you check to make sure that no firewall are blooking the connection? if you are running accross a network try running it on the same machine, localhost and see if you have the same problem.
-Fernando
|
|
|
|
|
i am connecting with sqlserver database ,then i need to acces that user which is in my textbox ,but no user comming from it.
code is as follows:
sqlConnString="server= your server; database= ;user id=;password=;";
sqlConn = new SqlConnection(sqlConnString);
sqlConn.Open();
sqlCmd = new SqlCommand(“select username,password from table where username=@textbox1.text”);
sqlDataAdapter da = new SqlDataAdapter();
da= cmd.executeReader()
If da.read()
{
responser.redirect(“loginsuccess.aspx”)
}
else
{
response.write(“invalid login.aspx”)
}
+++++++++++++++++++++++++++
error is this
System.Data.SqlClient.SqlException: Must declare the variable '@TextBox1'. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at ASP.UserInfo_aspx.Page_Load()
|
|
|
|
|
cishi_us wrote:
Must declare the variable '@TextBox1'
Read up on how to use the SqlParameter object. Also, just use "@TextBox1", not "@TextBox1.Text".
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|