|
PaulC1972 wrote: Don't cross post, people consider it rude
Talking to yourself???
I guess the OP deleted their post.
|
|
|
|
|
I have to create a control really transparent, it is just a bounding box with handles.
I want show it insiede a panel and i want to see trought the background of the bounding box.
How?
|
|
|
|
|
|
I am at a cross roads with a program I am writing at the moment. I dont know which way to proceed. The information desired is held within File Types under Folder Options in My Computer. I have been tempted to pursue a registry programming approach however. Reading the article on shell extensions and the namespace I would love to be able to glean the information from this method. I have made some inroads into this by setting up the structure:
[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public IntPtr iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
class ExtenManager
{
public const uint SHGFI_ICON = 0x000000100;
public const uint SHGFI_DISPLAYNAME = 0x000000200;
public const uint SHGFI_TYPENAME = 0x000000400;
public const uint SHGFI_ATTRIBUTES = 0x000000800;
public const uint SHGFI_ICONLOCATION = 0x000001000;
public const uint SHGFI_EXETYPE = 0x000002000;
public const uint SHGFI_SYSICONINDEX = 0x000004000;
public const uint SHGFI_LINKOVERLAY = 0x000008000;
public const uint SHGFI_SELECTED = 0x000010000;
public const uint SHGFI_ATTR_SPECIFIED = 0x000020000;
public const uint SHGFI_LARGEICON = 0x000000000;
public const uint SHGFI_SMALLICON = 0x000000001;
public const uint SHGFI_OPENICON = 0x000000002;
public const uint SHGFI_SHELLICONSIZE = 0x000000004;
public const uint SHGFI_PIDL = 0x000000008;
public const uint SHGFI_USEFILEATTRIBUTES = 0x000000010;
public const uint SHGFI_ADDOVERLAYS = 0x000000020;
public const uint SHGFI_OVERLAYINDEX = 0x000000040;
public const uint ILD_TRANSPARENT = 0x1;
[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath,
uint dwFileAttributes,
ref SHFILEINFO psfi,
uint cbSizeFileInfo,
uint uFlags);
}
And Calling it respectively with:
RunningApps.Items.Clear();
IntPtr hTypeInfo; // The Handle To The System FileType List
string fName; // 'the file name to get icon from
SHFILEINFO shinfo = new SHFILEINFO();
// Get All FileExtenstions
foreach (string file in System.IO.Directory.GetFiles("C:\\", "*.*"))
{
hTypeInfo = ExtenManager.SHGetFileInfo(file, 0, ref shinfo,
(uint)Marshal.SizeOF(shinfo), ExtenManager.SHGFI_TYPENAME | ExtenManager.SHGFI_USEFILEATTRIBUTES);
RunningApps.Items.Add(shinfo.szTypeName + " " + shinfo.szDisplayName);
}
Forgive the formatting, This give me the TypeName information which can be found in my computer but is all!. Is it possible to access all the File Extensions along with their information via a call to the shell32 API in My Computer / Folder Options / File Types. Could it be done through PIDL's and if so could someone please help me out!!
<div class="ForumSig"></div>
-- modified at 21:52 Sunday 23rd July, 2006
|
|
|
|
|
Hello People,
I've got an question. I'm working on a program and developed a function. The only thing I can't find the way to call it properly.
This is the function:
private void Stopcontact_Selected(string sender, System.Windows.Forms.PictureBox e)
{
string path = @"C:\C#\DOMO\niks.jpg";
if(licht.Checked)
{
path = @"C:\C#\DOMO\lamp_uit.jpg";
}
else if(gordijn.Checked)
{
path = @"C:\C#\DOMO\gordijn_open.jpg";
}
else
{
path = @"C:\C#\DOMO\niks.jpg";
}
e.Image = Image.FromFile (path);
}
There are multiple images that calls to this function. The hard part is, i can't find the way to send it back to the right image (the one that calls it).
Sorry for my crappy explenation but i'm not so good in english and formuling my questions.
Trick
|
|
|
|
|
What do you mean by 'call it properly' ?
The variable names make me think you started with an event and changed the types of the variables being passed in. That doesn't work. How are you trying to call this code ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The way for me to call it is:
this.Stopcontact22.Click += new System.EventHandler(this.Stopcontact_Selected);
this don't work and i don't know the exact way to call it
|
|
|
|
|
This can't work because for it to work, you need to put the signature back as it was, object sender and EventArgs ea. When you change the argument types, it ceases to be an event handler. You need to find another way to do what you're doing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The method that you use to handle the event has to have the same data types for the parameters as the delegate definition. You can't make up your own parameters and expect the event to guess what you are trying to do.
The first parameter is of type object, and is a reference to the control that caused the event. Type cast the reference to the actual data type of the control to access it's members.
---
b { font-weight: normal; }
|
|
|
|
|
|
Activate the port forwarding in router.
For example:
internal : 10.0.0.5 (port 5000)
external : 200.200.200.200 (port 5000)
if the port forwarding is activated, then
the packet to 200.200.200.200(5000) will
be forwarded to 10.0.0.5(5000).
Good luck...
|
|
|
|
|
I dont know much about Routers. I got this complaint when I tried to connect to a computer behind the router.
Please tell me a little bit proceedure to do so.
One more thing, If this is really needed then who other network programs like Yahoo, MSN, eMule work without configuration.
Please guide me in this regard,
Best Regards,
rizwanSharp;
|
|
|
|
|
You must check the manual of your router. The most router has a web configuration. It is easy to configure something like that. Just put your internal IP, put the port, activate and save. That's all.
MSN or Yahoo work through a uPnP protocol. You don't need to activate port forwarding for that.
|
|
|
|
|
uPnP I want to do the same Any Guidance ????
I dont want to force 1000's of clients of my system to configure their routers and imagine if some of them are public properties then how you cna cofigure them ???
Please some more help.
Best Regards,
rizwanSharp;
-- modified at 14:27 Sunday 23rd July, 2006
|
|
|
|
|
That's what I tell you is a normal configuration in a simple router like DSL router.
If you have a 1000 of clients, that means your network is a company network. You
must do more than port forwarding. I don't have any experience like that. Probably
you must change your routing configuration.
|
|
|
|
|
Hmmm OK I check it. And what about Proxy Case?
Any clue if I want to connect to a coputer which is Behind a Proxy server in a LAN but I'm on internet???
Best Regards,
Thanks Alot!!!
rizwanSharp;
|
|
|
|
|
Proxa means : hide your IP, show the IP from proxy.
That means, what you want, is against the concept from proxy.
|
|
|
|
|
hi,
I have written a program of linked list using data structure
but compiler showing following errors
1-> The code has no effect.
2-> statement missing.
3-> Unreachable code.
4-> expression syntax.
Anybody can tell me what can i do for remove these errors from the program.
arun
|
|
|
|
|
Can you share the code?
rizwanSharp;
|
|
|
|
|
Hi!
1->Remove the code since it has no effect
2->Insert the missing statement
3->Remove the code since it's never reached
4->Correct the syntax (count your brackets, for example)
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
arun.m wrote: Anybody can tell me what can i do for remove these errors from the program.
Well, I have an ISP, but I don't have ESP, so I guess you need to post the code. Then I need to ask, what are you writing it for ? If for a class, fair enough. But don't USE your linked list, use the containers built into the framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
I Want To create an IVR (Interactive Voice Response) Application in C#
can anybody help me to find some source code or guide me to write that.
thanks
|
|
|
|
|
Hi,
I have the following code, which works perfect, when I makes af DataGridView with drag and drop (the code pass over the FakturaId to the new form, so I can make a select on this)
System.Data.DataRowView SelectedRowView;
fakturasystemDataSet.FakturaRow SelectedRow;
SelectedRowView = (System.Data.DataRowView)fakturaBindingSource.Current;
SelectedRow = (fakturasystemDataSet.FakturaRow)SelectedRowView.Row;
FakturaVis FakturaVisForm = new FakturaVis();
FakturaVisForm.LoadFakturaVis(SelectedRow.FakturaID);
FakturaVisForm.Show();
But now I have made my own dataset and adapter and I have some problems with the above code. I don't know, how I get the FakturaRow in intellisense (how I get this into the code, where I instansiate the dataset and the adapter)?
Is my dsView the same as, the system generated fakturaBindingSource?
My code where I instansiate the dataset and the adapters:
private void loadKundeFaktura()
{
//create a connection string to the access database
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;
User Id=;Password=;
Data Source=" + myDB);
// Create the DataSet
ds = new DataSet("KundeFaktura");
// Fill the Dataset with Kunder, map Default Tablename
// "Table" to "Kunder".
da1 = new OleDbDataAdapter("SELECT KundeId, Navn, Adresse, Postnr, Byen,
Telefonnr, Mobilnr, EmailAdr, Noter FROM Kunder", cn);
da1.TableMappings.Add("Table", "Kunder");
da1.Fill(ds);
// Fill the Dataset with Faktura, map Default Tablename
// "Table" to "Faktura". ORDER BY FakturaID DESC
da2 = new OleDbDataAdapter("SELECT FakturaID, KundeID, Dato, BetalingsDato,
Betalt FROM Faktura ORDER BY FakturaID DESC", cn);
da2.TableMappings.Add("Table", "Faktura");
da2.Fill(ds);
// Establish the Relationship "RelOrdDet"
// between Kunder ---< [Faktura]
System.Data.DataRelation relOrdDet;
System.Data.DataColumn colMaster2;
System.Data.DataColumn colDetail2;
colMaster2 = ds.Tables["Kunder"].Columns["KundeId"];
colDetail2 = ds.Tables["Faktura"].Columns["KundeID"];
relOrdDet = new System.Data.DataRelation("RelOrdDet", colMaster2,
colDetail2);
ds.Relations.Add(relOrdDet);
// The DataViewManager returned by the DefaultViewManager
// property allows you to create custom settings for each
// DataTable in the DataSet.
dsView = ds.DefaultViewManager;
// Databinding for the Grid's
dgrKunder.DataSource = dsView;
dgrKunder.DataMember = "Kunder";
dgrFaktura.DataSource = dsView;
dgrFaktura.DataMember = "Kunder.RelOrdDet";
}
Kind regards,
simsen
|
|
|
|
|
I don't understand the question. Why do you need intellisense ? If you've passed the ID, you can request the data from the database, surely ? Otherwise, communication between forms typically happens with delegates, or is this ASP.NET ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It isn't ASP.NET.
I have to pass the Id to another form.
Normally I would do it this way: I drag and drop a datagridview (AND use the Visual Studios wizard to make the connection and so on) into form1 and then I use the below code1 on a button, to pass the id with it.
But my problem is (I'm a very newbee), I tried instead of using the wizard to make my own connection to the database and put data into the datagridview. See code2.
Now I don't know what I shall do, to pass the id over to form2. On form2 I have som fields, which i also get from the database - but I cann't get them, don't have have the id.
Kind regards,
simsen
Code1:
System.Data.DataRowView SelectedRowView;
fakturasystemDataSet.FakturaRow SelectedRow;
SelectedRowView = (System.Data.DataRowView)fakturaBindingSource.Current;
SelectedRow = (fakturasystemDataSet.FakturaRow)SelectedRowView.Row;
FakturaVis FakturaVisForm = new FakturaVis();
FakturaVisForm.LoadFakturaVis(SelectedRow.FakturaID);
FakturaVisForm.Show();
Code2
private void loadKundeFaktura()
{
//create a connection string to the access database
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;
User Id=password=;
Data Source=" + myDB);
// Create the DataSet
ds = new DataSet("KundeFaktura");
// Fill the Dataset with Kunder, map Default Tablename
// "Table" to "Kunder".
da1 = new OleDbDataAdapter("SELECT KundeId, Navn, Adresse, Postnr, Byen,
Telefonnr, Mobilnr, EmailAdr, Noter FROM Kunder", cn);
da1.TableMappings.Add("Table", "Kunder");
da1.Fill(ds);
// Fill the Dataset with Faktura, map Default Tablename
// "Table" to "Faktura". ORDER BY FakturaID DESC
da2 = new OleDbDataAdapter("SELECT FakturaID, KundeID, Dato, BetalingsDato,
Betalt FROM Faktura ORDER BY FakturaID DESC", cn);
da2.TableMappings.Add("Table", "Faktura");
da2.Fill(ds);
// Establish the Relationship "RelOrdDet"
// between Kunder ---< [Faktura]
System.Data.DataRelation relOrdDet;
System.Data.DataColumn colMaster2;
System.Data.DataColumn colDetail2;
colMaster2 = ds.Tables["Kunder"].Columns["KundeId"];
colDetail2 = ds.Tables["Faktura"].Columns["KundeID"];
relOrdDet = new System.Data.DataRelation("RelOrdDet", colMaster2,
colDetail2);
ds.Relations.Add(relOrdDet);
// The DataViewManager returned by the DefaultViewManager
// property allows you to create custom settings for each
// DataTable in the DataSet.
dsView = ds.DefaultViewManager;
// Databinding for the Grid's
dgrKunder.DataSource = dsView;
dgrKunder.DataMember = "Kunder";
dgrFaktura.DataSource = dsView;
dgrFaktura.DataMember = "Kunder.RelOrdDet";
}
|
|
|
|
|