|
Dear friend, need a help
I have a mdi form and i want to open child form into tabcontrol so i can use that form simutenously by clicking on tab pages.
if its possible please help me soon
thnx
|
|
|
|
|
Can anyone tell me through code in C#,i have drawn roads in form of spline curves using paint brush,now i want to load this bitmap image in C# windows application and then
by reading the pixels of each line in bitmap image to store the piece wise spline curves equations in linked list,as a copy and erasing all the lines after storing these lines in linked list,so that if i click near the line in bitmap image ,that particular line will display .
I will be very thankfull to you.
|
|
|
|
|
Anyone know how to reboot the pc that the application is running on using code?
Cheers
Kev
|
|
|
|
|
|
That should do the trick:
clickedy
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That's great, i can get the pc to log the user off no problems but im still having problems rebooting it. I know why, i dont know how to set the privileges for the current process.
The calling process must have the SE_SHUTDOWN_NAME privilege
I'm reading through the MSDN docs trying to figure it out but the only one i've found so far is written using C++ code, and the classes are not the same in C#. If you could help me set the privileges that would be great!
Cheers
Kev
|
|
|
|
|
I'd suggest you taking a look at www.pinvoke.net and convert the appropriate API calls by yourself.
This should help you a bit.
I've not done this in C# myself yet.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Got it sorted now, thanks.
Found an article that had already converted the API calls to C# and used them.
Cheers
Kev
|
|
|
|
|
HI,
can you give me the code of Rebooting
regards
sanjeev
email: sanjeevsinghh@gmail.com
|
|
|
|
|
Here's some code for converting the functions you need to reboot with.
[DllImport("user32.dll")]
private static extern bool ExitWindowsEx(uint uFlags, uint dwReason);
[StructLayout(LayoutKind.Sequential, Pack=1)]
internal struct TokPriv1Luid
{
public int Count;
public long Luid;
public int Attr;
}
[DllImport("kernel32.dll", ExactSpelling=true) ]
internal static extern IntPtr GetCurrentProcess();
[DllImport("advapi32.dll", ExactSpelling=true, SetLastError=true) ]
internal static extern bool OpenProcessToken( IntPtr h, int acc, ref IntPtr phtok );
[DllImport("advapi32.dll", SetLastError=true) ]
internal static extern bool LookupPrivilegeValue( string host, string name, ref long pluid );
[DllImport("advapi32.dll", ExactSpelling=true, SetLastError=true) ]
internal static extern bool AdjustTokenPrivileges( IntPtr htok, bool disall,
ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen );
Then you just need to call ExitWindowsEx, see above for links tyo the MSDN documentation for it.
Kev
|
|
|
|
|
Look at the win API function ExitWindowEx.
/\ |_ E X E GG
|
|
|
|
|
I have a console utility I'd like to interact with and get it's output.
I can send in a list of commands into it via < like this:
myapp < commmands.txt
also I can do:
myapp "command1 asdf" "command2 asdf" "command3 asdf 223"
and so on..
What feature would I use to send commands into it and what would I use to read it's output ?
thanks,
H
|
|
|
|
|
|
Let's say I'm interacting with the utility "dir"
i'd like to do as my command:
"dir " + strMyDir
and then read the output from this command and parse it to my likeing
|
|
|
|
|
|
Yes, thanks.
|
|
|
|
|
Hi,
When I call InternetDial function from WinInet.dll I don’t want from system to show me modal dialog box with values from default internet connection. For example when I uncheck all the option in Dialing options in properties of my default dial-up connection and double click on my default dial-up connection I haven’t seen any modal dialog box. Computer starts to call other site immediately.
From my program I want to produce same behavior as mention before.
Thanks,
|
|
|
|
|
I would to handle Paint windows messages for textbox paint event.
Invact i would to avoid to draw the classic white background with an image myown.
How can i do?
|
|
|
|
|
Hi all.
I'm using MDI Forms in my project. Control boxes of child forms are false. But when i make the window states of child forms Maximized, althoug they are false, control boxes of child forms are shown on the MainMenu. I don't wan't them to be shown. What can I do?
Thanks all...
|
|
|
|
|
hello,please help me by letting me know which algorithm you have used for motion detection using c# which was done by taha zayed.hoping you will mail me fast,its very urgent.thanking you
shamna
shamna_a@rediffmail.com
|
|
|
|
|
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
|
|
|
|