Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

DragenGimp

@DragenGimp
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • detect if application is opened on start-up or via user?
    D DragenGimp

    Hi, I've been absent from my computer for a couple of days, but I seem to have fixed the problem. I still have no idea why it was crashing, but I simply added this code:

    this.ShowInTaskbar = false;

    before I called up the minimise function and it seems to stop it from crashing. It's a fix, but I'd still like to know why it was crashing in the first place if anyone figures it out! Thanks

    C# tutorial question

  • detect if application is opened on start-up or via user?
    D DragenGimp

    Thanks. What happens is it just stops working and it brings up an unhandled error: object was in a zombie state now I've figured out that it doesn't crash until it reaches this line:

    this.WindowState = FormWindowState.Minimized;

    now I've got a check on resizing:

    	void MainFormResize(object sender, EventArgs e)
    	{
    		if(this.WindowState == FormWindowState.Minimized){
    			this.ShowInTaskbar = false;
    			notifyIcon1.Visible = true;
    		}else{
    			this.ShowInTaskbar = true;
    			notifyIcon1.Visible = false;
    			fetch\_iniData("data.ini", true);
    		}
    	}
    

    For some reason it is the:

    this.ShowInTaskbar = false;

    That is causing it to crash... I can't see why though. The strange thing is that it's calling up the same function that is called on a button press, which works fine.. so why it works then and not when the application loads is beyond me:confused:

    C# tutorial question

  • detect if application is opened on start-up or via user?
    D DragenGimp

    Okay, I've pretty much got it working (I've booted up my laptop to test it on). I realised that I should surround the app name in brackets:

    rkStartup.SetValue("app name", "\""+Application.ExecutablePath.ToString()+"\""+" /startup");

    and it does run on start-up and does what it's supposed to do, but then it crashes :^) It's just a 'program has stopped responding message'.. So I'm looking into that now.

    C# tutorial question

  • detect if application is opened on start-up or via user?
    D DragenGimp

    Thanks! That sounds brilliant. I'm setting the application in the startup registry key like this:

    rkStartup.SetValue("app name", Application.ExecutablePath.ToString());

    can I just change it to this:

    rkStartup.SetValue("app name", Application.ExecutablePath.ToString()+" /startup");

    My computers old and I'm not particularly keen on restarting it to check as it will take forever ;) Thanks!

    C# tutorial question

  • detect if application is opened on start-up or via user?
    D DragenGimp

    Hi, I've got a program which runs on computer start-up. Is there some way to detect how the program has been opened? For example; If the user opens the program manually (clicking on the program .exe file), it creates a messagebox that says 'foo'. Whereas if the program is opened by the computer at start-up it outputs a messagebox that says 'bar'. something like:

    if(openedby == user){
    MessageBox.Show("foo");
    }else{
    MessageBox.Show("bar");
    }

    Just a simple example with, hopefully, a simple answer! Thanks

    C# tutorial question

  • changing desktop colour doesn't work
    D DragenGimp

    okay, after looking into it, it seems that I need to use a combination of the api, and registry keys. I've got it working wonderfully! Thanks you again for the gentle nudge in the right direction :)

    C# windows-admin question

  • changing desktop colour doesn't work
    D DragenGimp

    Thanks, after turning my computer on this morning the background colour has changed, so it seems as though it is working, just not picking up the changes until a reboot.. I thought I should be able to do it through the registry keys as with changing the wallpaper (Which I'm already doing)? I'll have a look at SetSysColors and see where I get. Thanks

    C# windows-admin question

  • changing desktop colour doesn't work
    D DragenGimp

    Hi, I'm trying to change the background colour of my desktop. Here's the code I'm using:

    		RegistryKey rkWallColor = Registry.CurrentUser.OpenSubKey("Control Panel\\\\Colors", true);
    		rkWallColor.SetValue("Background", "0 0 64");
    		rkWallColor.Close();
    

    I'm sure that I'm doing it right, but the desktop colour wont change. I've checked the registry key and it has been changed. Am I accessing the wrong key? I'm using windows xp. Can anyone see what I'm doing wrong? Thanks

    C# windows-admin question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups