|
Right click on the service property. Show the LogOn Tab, and check the "allow service to interact with desktop".
How low can you go ? (MS retrofuck)
|
|
|
|
|
thanks for reply.
but sir i right click the service(project) property.but i could not find LogOn Tab so that i could not check "allow service to interact with desktop".
how to do?
r00d0034@yahoo.com
|
|
|
|
|
i got it thanks.
r00d0034@yahoo.com
|
|
|
|
|
Please remove the now useless posts on this board.
How low can you go ? (enculage MS)
|
|
|
|
|
can it be done programatically?
i want when i install my service that check box automatically checked.
how to do that.
r00d0034@yahoo.com
|
|
|
|
|
You've got the Windows API here[^].
How low can you go ? (MS rant)
|
|
|
|
|
i have study that SERVICE_INTERACTIVE_PROCESS.
but question here is that i have created service in
csharp i have not to creat it again and i want to do that thing too.
is there any easy way?
r00d0034@yahoo.com
|
|
|
|
|
There is no API to do that with .NET
In fact there are .NET APIs but they are not public.
You have two options :
- change the appropriate registry key for this service (see in HKLM\System\CurrentControlSet\Services\"servicename"\Type).
- use interop to call the native WIN32 CreateService method. This should be something like this :
[DllImport("advapi32.dll", CharSet=CharSet.Auto)]
public extern static IntPtr CreateService(IntPtr databaseHandle, string serviceName, string displayName, int access, int serviceType, int startType, int errorControl, string binaryPath, string loadOrderGroup, IntPtr pTagId, string dependencies, string servicesStartName, string password);
you should pass the numerical value of "interactive process" for the serviceType parameter.
How low can you go ? (MS rant)
|
|
|
|
|
thanks for reply.
you want to say that i call that function in my already created service in csharp if yes?
where i have to call that function in my code?
r00d0034@yahoo.com
|
|
|
|
|
The answer is obvious.
How low can you go ? (MS rant)
|
|
|
|
|
How can I expose a COM object from a .Net Windows Application?
|
|
|
|
|
Add it to the toolbox and drag it onto the designer window Does all the necesarry steps for you.
Hope this helps
"There are no stupid question's, just stupid people."
|
|
|
|
|
But the COM object doesn't display anything. It'll only have some methods that I want to access from COM.
|
|
|
|
|
It will add it to the project, just try it! You will see what I mean then. [edit] Or reference it I mean, Ooops! [/edit]
"There are no stupid question's, just stupid people."
|
|
|
|
|
On the toolbox I can only add controls.
Let me explain what I want to do:
I have a .Net windows app. In that app I have a class, let's say:
public class MyClass
{
int callMe()
{
return 3;
}
}
I want to make this class (and the callMe function) accessible from a MFC application. How do I do it?
|
|
|
|
|
kozureokami wrote:
I have a .Net windows app. In that app I have a class,
kozureokami wrote:
I want to make this class (and the callMe function) accessible from a MFC application. How do I do it?
Look up CCW on MSDN
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
This one[^] is for you.
How low can you go ? (MS retrofuck)
|
|
|
|
|
I need to import functions frol UxTheme.dll, Windows XP's visual styles dll. Several of the functions have const parameters, and C# does not allow the use of the const keyword in function parameter definitions. I'm wondering if anyone knows how to import a function with constant parameters into a C# class.
[DllImport("shell32.dll", CharSet=CharSet.Auto)]
public static extern int DrawThemeBackgroundEx(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, const IntPtr pRect, const IntPtr pOptions);
|
|
|
|
|
Jon Rista wrote:
[DllImport("shell32.dll", CharSet=CharSet.Auto)]
Dont you mean [DllImport("UxTheme.dll", CharSet=CharSet.Auto)] ? Sorry I dont have docs on UxTheme.dll
"There are no stupid question's, just stupid people."
|
|
|
|
|
Doh!
Yeah, meant uxtheme.dll. I just finished working on a file importing a bunch of shell32.dll stuff. Wasn't out of "shell32" mode yet.
|
|
|
|
|
BTW, having shell32.dll in there wasn't the problem. I had it correct in my code. I'm still having the original problem.
|
|
|
|
|
Does the function definition really need that const keyword? Have you tried it, without it? What are the results?
"There are no stupid question's, just stupid people."
|
|
|
|
|
This program should show all the installed fonts in their typeface but it doesn't show anything instead whats wrong?
using System;
using System.Drawing;
using System.Drawing.Text;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace FontViewer
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabPage1});
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(624, 353);
this.tabControl1.TabIndex = 2;
//
// tabPage1
//
this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.listView1});
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(616, 327);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Installed Fonts";
//
// listView1
//
this.listView1.CausesValidation = false;
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader2});
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Scrollable = ((bool)(configurationAppSettings.GetValue("listView1.Scrollable", typeof(bool))));
this.listView1.Size = new System.Drawing.Size(616, 327);
this.listView1.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.listView1.TabIndex = 1;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeader2
//
this.columnHeader2.Text = "Names";
this.columnHeader2.Width = 595;
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem3});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2});
this.menuItem1.Text = "File";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Shortcut = System.Windows.Forms.Shortcut.CtrlQ;
this.menuItem2.Text = "Exit";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "About";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// columnHeader1
//
this.columnHeader1.Width = 612;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(624, 353);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabControl1});
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "Leons Font Program";
this.Load += new System.EventHandler(this.Form1_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
Graphics grfx = CreateGraphics();
Color c = Color.Black;
Brush brush = new SolidBrush(c);
float y = 0;
FontFamily[] aff = FontFamily.Families;
foreach (FontFamily ff in aff)
{
if(ff.IsStyleAvailable(FontStyle.Regular))
{
Font font = new Font(ff, 12);
grfx.DrawString(ff.Name, font, brush, 0, y);
y += font.GetHeight(grfx);
}
}
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
MessageBox.Show("Made By Leon Radley, 2002");
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
}
}
Cheers
|
|
|
|
|
I *think* your problem is that you are doing the drawing on the load event which actually occurs before the form is displayed.
Try taking the stuff in the draw event and putting it in the paint event instead and see if that works.
|
|
|
|
|
I understand how to access functions from a DLL that is not a COM DLL. However, I would like to know how I can access the classes from a NON-COM DLL.
A tutorial, or sample code would be great, or at worse a tool that created a .NET wrapper for you.
Thanks
Coding is a way of life. It's in the air we breath. It pumps through our veines. Without it we soon crumble to dust. - Rodney S. Foley
|
|
|
|