|
Often, having created some project (commercial software, shareware) developers have troubles with creation of protection of their products from hackers. So they create some protection themselves or look for ready-made tools for this purpose.
If you need to protect your software from crackers click here http://www.softcomplete.com to find more info
|
|
|
|
|
P*ss off Spammer!
There's no way your going to protect anything from a determined hacker anyway...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ban this idiot plz!
Yes, I program in VB, but only to feed my addiction to a warm place to sleep and food to eat!
Visit my Code Project blog (Mobile Audio project)[^]
|
|
|
|
|
Is it possible from C# to hide the windows taskbar?
And how do I change the DPI settings?
(I want to force 96 DPI, Small Fonts).
Thanks
Regards
Thomas
|
|
|
|
|
No, you can't hide the task bar. Start/Run "gpedit.msc" to open up the policy editor, then select User Configuration/Administrative Templates to see everything you can do to the Desktop/Start Menu/Task Bar/System/...
The settings for the video card shouldn't be messed with by your application. Changing these will affect all the users of a machine, not just one.
You would have to change these settings in the Registry first, then retart the machine for them to take effect. See HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current for the settings.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Actually, you can using by P/Invoking the SHAppBarMessage function and sending ABM_SETSTATE . You can turn on it's auto-hide feature, which Internet Explorer does when you switch to full-screen mode (which I love for certain purposes).
I agree about the DPI, though. Changing the resolution (when necessary, like for a full-screen game or kiosk) is one thing, but the DPI is another.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart:
I am new to windows programming.
Can you show me how to use the SHAppBarMessage function via P/Invoke?
Regards
Thomas
|
|
|
|
|
You should first read about P/Invoke. See Consuming Unmanaged DLL Functions[^] in the .NET Framework SDK. Just jumping into something without understanding is never a good idea.
You can P/Invoke the SHAppBarMessage like so:
[DllImport("shell32.dll")]
[return: MarshalAs(UnmanagedType.SysUInt)]
private static extern IntPtrSHAppBarMessage(
[MarshalAs(UnmanagedType.U4)] int dwMessage,
APPBARDATA data);
[StructLayout(LayoutKind.Sequential)]
public struct APPBARDATA
{
[MarshalAs(UnmanagedType.U4)] public int size;
public IntPtr handle;
[MarshalAs(UnmanagedType.SysUInt)] public IntPtr callbackMessage;
[MarshalAs(UnmanagedType.SysUInt)] public IntPtr edge;
public RECT rc;
public IntPtr lParam;
}
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
} In order to pass the right messages, read about the SHAppBarMessage[^] API.
There is also an example on CodeProject you can take a look at. Read C# does Shell, Part 3[^].
To get the HWND for the task bar, you'll need to also P/Invoke FindWindow and search for the window class "Shell_TrayWnd". That'll give you the IntPtr to assign to the APPBARDATA.handle field.
You can find more P/Invoke signatures for common Windows APIs at http://pinvoke.net[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Can someone kindly tell me how to get the date part(dd/mm/yyyy) and also time part (hh:mm:ss) from the DateTime object in C#
I have tried but I dont get the format as I want it
Tanx
ormore
|
|
|
|
|
See the documentation for the ToString method of DateTime class. It contains an example that demonstrates different ways of formatting a DateTime value.
www.troschuetz.de
|
|
|
|
|
There are already methods to do this for you, including ToShortDateString and ToLongTimeString , which are functionally equivalent to ToString("d", null) and ToString("T", null) , respectively.
If you look at DateTime.ToString , it shows you the format codes that are possible with the DateTime . For instance, using the format specifiers "d" and "T" will get you the date part in the dd/mm/yyyy format, and the time part in (hh:mm:ss) format, respectively. You should use these format specifiers instead of custom formatting when possible (and it is in your case) because diffirent cultures may format date and time parts differently, and using the pre-defined formats will take that into account when formatting.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
Is there an easy way to get a DateTime string with an ordinal suffix? (e.g., October 12th, 2004). The articles I have seen involve parsing the string and inserting the suffix manually.
Jon Sagara
If you've ever watched 6-year-olds playing soccer, that's what the mainstream media is like.
-- Jon Stewart
My Articles
|
|
|
|
|
Nope. You'd have to do exactly what the articles are describing. The Format method won't insert it for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That's crap. Oh well. Thanks for the response.
Jon Sagara
If you've ever watched 6-year-olds playing soccer, that's what the mainstream media is like.
-- Jon Stewart
My Articles
|
|
|
|
|
C'mon! What fun would the world be if it was mearly handed to you?!
Write the damn thing!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How does one find out the items that are checked in a CheckedListBox??
I tried the following but i get weird output.
private void checkedListBox_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)<br />
{<br />
CheckedListBox box = (CheckedListBox)sender;<br />
int numItems = box.Items.Count; <br />
this.debugArea("\r\n");<br />
for (int i=0; i < numItems; i++)<br />
{<br />
String name = box.Items[i].ToString();<br />
if (box.GetItemCheckState(i).Equals(CheckState.Checked))<br />
{<br />
checkValues[i] = true;<br />
this.debugArea(name+" True:"+i+"\r\n");<br />
}<br />
else if (box.GetItemCheckState(i).Equals(CheckState.Unchecked))<br />
{<br />
checkValues[i]=false;<br />
this.debugArea(name+" False:"+i+"\r\n");<br />
}<br />
else if (box.GetItemCheckState(i).Equals(CheckState.Indeterminate))<br />
{<br />
checkValues[i]=false;<br />
this.debugArea(name+" NA:"+i+"\r\n"); <br />
}<br />
} <br />
}
When the first value is checked I get -
Changed False
Created False:1
Deleted False:2
Renamed False:3
When I uncheck that same first value -
Changed True
Created False:1
Deleted False:2
Renamed False:3
what gives here -
|
|
|
|
|
Just enumerate the CheckedListBox.CheckedItems property.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Can we create array of delegates ? and then use them in our program.
Regards,
Asim
|
|
|
|
|
Why do you need it? There are multicast delegates in .NET.
Perhaps there is another solution to your problem if you describe it in more detail.
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
Yes you can, but as Serge mentioned, there are MulticastDelegate s, which are used for events handlers. This allows you to combine delegates via Delegate.Combine . In .NET, actually, all delegates are treated as MulticastDelegate s. I remember reading an article about its inclusion a few years ago.
If you want to just use a simple array, though, it's as simple as any other type:
delegate[] dels = new delegate[2];
dels[0] = new EventHandler(btn_Click);
dels[1] = new CancelEventHandler(form_Closing); Using Delegate.Combine is much better, though, especially since it allows you to invoke the entire list of delegates unlike this array for which you'd have to iterate and invoke each delegate yourself.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have problem in my application.
When ever I declare
using System.Net;
using System.Windows.Forms;
I am getting an error message like Net class not found or it is not name space or class
I am also getting similar error for the Windows.Forms
also.
Please let me how to solve this problem.
Thanks in Advance.
bbye
Practical Reality.
|
|
|
|
|
Sounds like you forgot to add references to the corresponding class libraries.
Go to the solution explorer, right-click on References, select "Add reference" and under the tab-page ".NET" double-click on the desired class libraries.
www.troschuetz.de
|
|
|
|
|
Hi,
I want to add a background image to treeView. I tried to override the background image or to use transparent color(the treeView is on a panel, so I put the image on the panel) but for that, I needed to set the ControlStyle to ControlStyle.UserPaint.
When I do that, I can see the background inage, but I can't see all the nodes in the tree..
Can anyone help?
Thanks
|
|
|
|
|
The reason the property was hidden is because it is not supported. The TreeView class, you see, encapsulates the Tree-View common contorl. Most of the controls in Windows Forms encapsulate Windows common controls. They handle messages and send messages as you would in VC++, MFC, etc.
The Tree-View common control does not support background images. If you want such support, you should take a look at a much better tree anyway, like UltraWinTree from Infragistics[^]. It supports drag and drop, multi-select, background images, multiple tree node images, Visual Styles, and has a great UI toolkit. It's a royalty-free control that is pretty cheap. You'll spend a hell of a lot more money in man-hours trying to reproduce even just a couple features that you're given in UltraWinTree.
There's also others, like XtraTree (something like that) from Developer Express[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'm trying to transfer an argument to a webmethod of type System.Version. The method is declared like
public string Something(System.Version version, string strText) {...}
but when a client (C# program) calls the method, I get the following type information for the parameters:
string MyWebservice.Something(some.strange.namespace.Version version, string strText)
- where I would expect
string MyWebservice.Something(System.Version version, string strText)
So I can't transfer a System.Version as first argument. What am I doing wrong ? Can't such types be transferred to a webservice ? Have I forgot to scope something with the correct namespace ?
The SOAP packet description that displays when accessing the .asmx file says something like
<something xmlns="the.namespace.here">
<strtext>string
<version>
Where I would expect
<something xmlns="the.namespace.here">
<strtext>string
<version>System.Version
Any help would be greatly appreciated.
Best regards
Jan Hansen
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|