|
is there any API that can help me to do show and hide for desktop icons ?
|
|
|
|
|
What do you mean by "show" and "hide" desktop icons? What are you trying to do.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thx dave for ur interest
i will try explain it to u ,
in windowsXP right click on the "desktop" then "arrange icons by" sub menu then "show desktop icons"
i want to do the same functionality ,using C#
thats all
thx again for ur interest
|
|
|
|
|
OK, I looked at it. Why on earth would you ever want to do this? If you modified my desktop like that, I'd uninstall your app before the last icon disappeared off the desktop. If you were locking down a desktop, you could do thie same thing through policies.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Use the win API function, ShowWindow and pass the handle to the desktop and 0 to the second parameter to hide the icons. 1 to show them again. Here's a sample console app.
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication14
{
class Program
{
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
static void Main(string[] args)
{
IntPtr handle = new IntPtr(65722);
ShowWindow(handle, 0);
}
}
/\ |_ E X E GG
|
|
|
|
|
thx eggie5
ur code was very helpfull, i tried it , it works good , i got my dektop window handle from spy++ and but it the code
but i want to got the desktop window handle dynamically,
so i used the function "GetDesktopWindow" in "user32.dll"
but it didnt work , so i discovered that i have to get another window handle inside the desktop,
so i tried to use "EnumChildWindows" in "user32.dll" , but till now i still have problems to get the right window handle
|
|
|
|
|
That's a very reasonable request and I don't know why I didn't implement it in the first place. I must be a slacker. Anyways, to implement the "dynamic" desktop handle recovery you speak of, we need to introduce a new Window API function, FindWindow . Consider the following example:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication15
{
class Program
{
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
static void Main(string[] args)
{
IntPtr handle = FindWindow(null, "PROGRAM MANAGER");
ShowWindow(handle, 0);
}
}
}
We get the handle to the desktop by using a null parameter and "PROGRAM MANAGER" for the second parameter of the FindWindow function. Don't ask me how I figured it out. Anyways, that should work.
Additionally, if you have a "Show Desktop" button in your taskbar you will notice some cool clashing between your program and windows, because I think that "Show Desktop" button calls ShowWindow somewhere....
Let me know if this works for you...
/\ |_ E X E GG
|
|
|
|
|
thx again
it works but i wonder why these arguments and what if i want to use the same function to open another windows, how can i get the right arguments, i will search for this and till u about the results
some clashs happend with another modules that i use for setting active desktop but any way i will continue use it and try to search more about it and learn more
thx again for ur help and interest
|
|
|
|
|
How an image is rotated at some sapcific angle?
|
|
|
|
|
Create a matrix and apply it to the Transform property on the graphics object.
Matrix matrix = new Matrix();
matrix.Rotate(45); // 45 Degrees
g.Transform = matrix;
// Now draw your image
My Blog ^
|
|
|
|
|
How could i create a Matrix?
please give me the syntex that how to declare and use matrix class and what should be added to the header
|
|
|
|
|
norm.net already showed you how to use the matrix class
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
what header should be add to use Matrix class
|
|
|
|
|
Hint: Google is your friend
This concept may be alien to you, but people are not here to do your work for you, you need to put some effort in yourself too! You have been provided with a VERY helpful hint which answers your quention entirely. I understand you simply want to know what namespace to import. As I do not know this from memory I went to google and typed Matrix Class[^]. Lo and behold 4th result is the MSDN documentation - Matrix Class[^].
Im sure you can click on one of these links to find its namespace.
|
|
|
|
|
1.How to get Audio & Video Stream data using Directshow?
2.How to send,replay this data on network?
shumyla
|
|
|
|
|
I have some old datafiles that need to be read at high speeds. They all use C strings and the file format can't be changed otherwise compatibility is lost with the closed source applications that write the files. How can I do this?
|
|
|
|
|
How can i transfer same format?
i send file on network but on client side not recieved same format.
i used Myobj class
[Serializable]
public class MyObject
{
public int size;
public byte[] buffer=null;
public string str="hello string";
public MyObject()
{
}
Server send data on network as
public void senddata(string fname)
{
MyObject obj=new MyObject();
//Create a file stream from an existing file.
FileInfo fi=new FileInfo(fname);
FileStream fs=fi.OpenRead();
//Read 100 bytes into an array from the specified file.
// int nBytes;
byte[] ByteArray=new byte[(int)fs.Length];
obj.size=(int)fs.Length;
obj.buffer=ByteArray;
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(st.BaseStream, obj);
st.BaseStream.Flush();
}
& on client side receieved data as
public void receivedata()
{
MyObject obj=new MyObject();
IFormatter formatter = new BinaryFormatter();
obj =(MyObject)formatter.Deserialize(at.BaseStream);
Encoding ascii = Encoding.ASCII;
Encoding unicode = Encoding.Unicode;
byte[] ByteArray=new byte[obj.size];
byte[] asciiBytes = Encoding.Convert(ascii, unicode, obj.buffer);
// at.BaseStream.Read(ByteArray, 0, 11);
FileStream fs1=File.Create("c:\\clock1.avi");
fs1.Write(obj.buffer,0,obj.size);
fs1.Close();
ptr(obj.size.ToString());
ptr(obj.str);
}
kindly tell default encoding technique or any other solution
from which we receieve same format on server & client side
Rashaida
|
|
|
|
|
How would I look at what tables, queries and forms are in an Access DB using C#. I can "select" from a table, but how do I look at the database objects, "Alltables", Allreports etc.
|
|
|
|
|
I’d like to remove HTML-formatting from a string. Any tip of an easy way to accomplish that?
_____________________________
...and justice for all
APe
|
|
|
|
|
Sample code
IDataObject iData = Clipboard.GetDataObject();
if(iData.GetDataPresent(DataFormats.Html))
{
string a = (String)iData.GetData(DataFormats.Text);
}
Serdar YILMAZ
Senior Developer
|
|
|
|
|
Tnx, I'll try it...
_____________________________
...and justice for all
APe
|
|
|
|
|
Look into regular expressions. That is all I can say. I must go now.
/\ |_ E X E GG
|
|
|
|
|
Hi, one of my project uses log4net. I add reference to log4net assembly (which is installed in GAC). I built the project and encountered no problem. However, when I run it console app, I keep getting:
<br />
log4net:ERROR XmlHierarchyConfigurator: Could not create Appender [rollingFile]<br />
of type [log4net.Appender.RollingFileAppender,log4net]. Reported error follows.<br />
System.IO.FileNotFoundException: File or assembly name log4net, or one of its dependencies, was not found.<br />
File name: "log4net"<br />
... bunch of stuff...<br />
LOG: Policy not being applied to reference at this time (private, custom, partia<br />
l, or location-based assembly bind).<br />
LOG: Post-policy reference: log4net<br />
LOG: Attempting download of new URL file:ng/bin/log4net.DLL.<br />
LOG: Attempting download of new URL file:ng/bin/log4net/log4net.DLL.<br />
LOG: Attempting download of new URL file:ng/bin/log4net.EXE.<br />
LOG: Attempting download of new URL file:ng/bin/log4net/log4net.EXE.<br />
I resolved the problem by changing Copy Local from False (which is default for GAC's assemblies) to True
Any idea why this is happenning? I have another console application which references log4net also, but does not requires "Copy Local" = True.
Thanks in advance!
Norman Fung
|
|
|
|
|
we are doing project "Video conferencing".In which the file is send on the network perfectly,But when we recieve the file on the client side,File size and data is perfectly recieved but format is not showing.plz kindly tell me the default encoding technique which show exact format on client side.
I m waiting for ur positive response.
best regards
shumyla
|
|
|
|
|
How can I convert a string of bits to a byte[] array.
Example "01010001" to a Byte[] array (not as an UTF or ASCII byte encoded ). I guess it would be false true false true false false flase true .....and then converted to a Byte Array but I figure out how to do it.
I figured out how to convert a Byte[] array to a string of bits using:
public string GetStrinRepresentation(Byte[] allBytes)
{
BitArray myBits = new BitArray(allBytes);
string tempStr=null;
string tempStr2=null;
for (int j=0; j <= myBits.Length-1; j++ )
{
/* if bit is true print "1" if false print "0" */
if (myBits[j])
{
tempStr2 = tempStr;
tempStr = "1" + tempStr2;
}
else
{
tempStr2 = tempStr;
tempStr = "0" + tempStr2;
}
}
return tempStr;
}
But I cant figure out how to do the opposite
Help Please?
Gordsh
|
|
|
|