|
|
Thanks Jakob
Regards,
Vighnesh N. Ambekar
Vighnesh N. Ambekar
|
|
|
|
|
i want the idea or suggitions for migrating tha Oracle Data to Sql Server for this i need what are the pre-cautions i need to take .Plz provide information.If forwarded any Need full links greatfull to u. my basic coding part in C# thats why i posted in this board.
Thanks in advance
mahesh
|
|
|
|
|
hi all,
am using .net 2.0 and i am wanting to get a list of all open programs on the system, like in task mgr applications tab.
how can i acheive this pls? i dont want to get all the hidden windows and controls just the active (maximised or minimised) windows (application that are available), the parent windows if you will, not all the children that are returned from EnumChildWindows.
once i get this i can get a handle to that window
kind regards,
g00fy
|
|
|
|
|
|
that returns running processes
i just windows. i have some code that is close, i will post it when perfected.
kind regards,
g00fy
|
|
|
|
|
ok as promised and after trawling the windows api, always an excellent read.
i have this, which works nicely for my own screenshot app that is loaded with useful things.
i plan to add this to the explorer context menu so u can choose which window to capture or you can capture a region using a selection rectangle on the screen.
enough of that here is the code
of course, anyone using this will need to dllimport the requried functions
btw the reason it was failing was because i was using GeWindowText() instead of sending WM_GETTEXT.
public static Window[] EnumerateTopWindows()
{
ArrayList windowList = new ArrayList();
IntPtr hWnd = IntPtr.Zero;
Window window = null;
hWnd = GetActiveWindow();
hWnd = GetWindow(hWnd, GW_HWNDFIRST);
while (hWnd != IntPtr.Zero)
{
if (IsWindow(hWnd) && IsWindowVisible(hWnd))
{
IntPtr parentWin = GetParent(hWnd);
if ((parentWin == IntPtr.Zero))
{
string text = GetText(hWnd);
int length = text.Length;
if (length > 0)
{
if (text != "Tray" && text != "Start" && text != "Task Manager" && text != "Program Manager")
{
window = new Window();
window.Handle = hWnd;
window.Text = text;
windowList.Add(window);
}
}
}
}
hWnd = GetWindow(hWnd, GW_HWNDNEXT);
}
return (Window[])windowList.ToArray(typeof(Window));
}
private static string GetText(IntPtr hWnd)
{
int cap = 1048576;
StringBuilder buffer = new StringBuilder(cap);
SendMessage(hWnd.ToInt32(), WM_GETTEXT, cap, buffer);
return Convert.ToString(buffer);
}
kind regards,
g00fy
|
|
|
|
|
I am not sure my code,Is it right?
public class Macro_RemoveExcelDefaultGridLines
{
///
/// Excel Macro : Remove Microsoft Excel's Default Grid Lines
///
private static string _Name = "RemoveDefaultGrid";
private static string _Body =""
+ " Sub RemoveDefaultGrid()\n"
+ " Cells.Select\n"
+ " With ActiveWindow\n"
+ " .DisplayGridlines = False\n"
+ " .DisplayZeros = False\n"
+ " End With\n"
+ "End Sub\n";
public static string Name
{
get{return _Name;}
}
public static string Body
{
get{ return _Body;}
}
}
|
|
|
|
|
Just try it directly in Excel, and see what you get.
Best regards, Alexey.
|
|
|
|
|
My Excel macro is test in excel,my mean is i am not sure my c# class,I use static private variable and property,I think there is somthing wrong.
|
|
|
|
|
Old Gun wrote: I use static private variable and property,I think there is somthing wrong.
Looks like all Ok. Try this, and if you'll get trobles, change properties to functions, or make them non-static.
Best regards, Alexey.
|
|
|
|
|
I see nothing wrong with the code. Why do you think that there is something wrong with it?
If the class is only supposed to be a container for those static properties, you should make it sealed so that it can't be inherited, and make an empty private constructor to override the default empty public constructor, so that it's obvious that one should not create instances of the class.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks alexey N and Guffa,Both of you helped me.
|
|
|
|
|
Hi,Guffa,I can't understand "make an empty private constructor to override the default empty public constructor, so that it's obvious that one should not create instances of the class. ",Can you give me more tips?
|
|
|
|
|
how can i detect when a windows was added to the view. i mean for example how can we undrestand that a messagebox appear in a program. is there an api function that list all windows always?
|
|
|
|
|
Hello,
I have a Win Form name Settings where user can inout int value and save. And this form is a child form of the MainForm. now, I want that, whenever user enters new value in the child form and click Save Button, The MainForm should read the new saved XML (created by child) and turn a timer on with new interval.
I tried the following code,
MainForm myParent = this.Owner as MainForm ;
myParent.updateTimer(); // updateTimer is a public method in MainForm who read the XML file and update accordingly.
Now, i get an error message, "Object refrence is not set to an instance of an object."
I am wondering that, the same piece of code is working some other place and its not working some place. (Even in the same file. ) Can you give me any clue please.
thanks.
|
|
|
|
|
I'm pretty sure that "this.Owner" is null on this step. Either you forgot to set Owner property of your child form, either you show child form through ShowDialog function without argument. Check this out first.
____________________________________________
Robin Panther http://www.robinland.com
|
|
|
|
|
I have a website that allows users to upload files to the server. However, I would like to be able to display the progress of the upload in some sort of progress bar. So my question is, how do i get the percentage of the upload that is complete?
Any help is apreciated 
|
|
|
|
|
Hi there,
you just do a quick search from this site, I believe you will have what you need. below is just one of them...Web Progress Bar
<< >>
|
|
|
|
|
Hi,
I have a datadridview control in Windows form (C#). In that DataGridView, I have a Date Column (DateTime Class). Now, when An user enters an invalid entry like (abcd/aa.etc) then An Exception is thrown with a messagebox. At the bottom of that message box, it is said that, if you want to replace this message, handle DataError Event. Now Where can I put the code ( try catch ) block to handle this dataError Event.
Thanks
Emran
|
|
|
|
|
I paint on Graphics object and i need to "pain" or change color of one, small pixel - and i have no idea how to do it. Drawing one-pixel-long lines don't work (lines don't show) - others Rectangles or Polygons don't work (they are too big or not visible) - any ideas? :/
Ideal compilator compiling comments without code...
|
|
|
|
|
If all else fails...
Create a 1x1 bitmap:
Bitmap bmp = new Bitmap();
bmp.SetPixel(0, 0, myColor);
and draw the bitmap on the Graphics:
myGraphics.DrawImageUnscaled(bmp, myPoint);
... but there's probably a more efficient way.
--
I've killed again, haven't I?
|
|
|
|
|
I think about creating bitmap from Graphics, use SetPixel and recreate Grahics object, but i can't while use Graphics object in OnPaint event...
Ideal compilator compiling comments without code...
|
|
|
|
|
Hi
I want to add a row with the value in the first and only column to be "oo", tried:
DataGridViewRow rw = new DataGridViewRow();<br />
....<br />
rw.SetValues("oo");<br />
dataGridView1.Rows.Add(rw);
This doesn't seem to work. What've I done wrong?
cheers
|
|
|
|
|
Your DataGridViewRow has no idea where to put "oo". You need to set the row schema from the DataGridView to which you intend to add the row. If you've defined your single column in your DataGridView definition, then it's cake:
DataGridViewRow rw = new DataGridViewRow();
....
rw.CreateCells(dataGridView1);
rw.SetValues("oo");
dataGridView1.Rows.Add(rw);
--
I've killed again, haven't I?
|
|
|
|