Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to create a windows short-cut and place it in autostart-folder?

ColacXColacX Posts: 141Member
How to create a windows short-cut and place it in autostart-folder?
How to send key commands that simultates the user pressing tab or delete?
How to disable key commands from the user?

I wrote this enoying code that turns the screen black and on close starts another blackscreen so closing it will only open more blackscreens XD

Thanks in Pre-Advance.
//ColacX
[code]
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "darkmain.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
Form1 = new TForm1(Application);
Form1->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift,
int X, int Y)
{
SetCursorPos(10,10);
}
//---------------------------------------------------------------------------
[/code]

Comments

  • caspert_ghostcaspert_ghost Posts: 53Member
    : How to create a windows short-cut and place it in autostart-folder?
    : How to send key commands that simultates the user pressing tab or
    : delete?
    : How to disable key commands from the user?
    :
    : I wrote this enoying code that turns the screen black and on close
    : starts another blackscreen so closing it will only open more
    : blackscreens XD
    :
    : Thanks in Pre-Advance.
    : //ColacX
    : [code]:
    : //---------------------------------------------------------------------------
    : #include
    : #pragma hdrstop
    : #include "darkmain.h"
    : //---------------------------------------------------------------------------
    : #pragma package(smart_init)
    : #pragma resource "*.dfm"
    : TForm1 *Form1;
    : //---------------------------------------------------------------------------
    : __fastcall TForm1::TForm1(TComponent* Owner)
    : : TForm(Owner)
    : {
    : }
    : //---------------------------------------------------------------------------
    :
    : void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
    : {
    : Form1 = new TForm1(Application);
    : Form1->ShowModal();
    : }
    : //---------------------------------------------------------------------------
    : void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift,
    : int X, int Y)
    : {
    : SetCursorPos(10,10);
    : }
    : //---------------------------------------------------------------------------
    : [/code]:
    :
    why would you create a program that only shows a black screen?
    anyways to create a startup program you simply add your exe. as a task.

    Start -->Control Panel -->Scheduled Tasks and create a new task add your exe as a startup program.

    Nothing (I mean ABSOLUTLY nothing) can prevent a person from stoping this task. simply boot in safe mode and remove it from the starup programs.
  • ColacXColacX Posts: 141Member
    Honestly this is just an anoying thing harmless thing. Kinda like a trojan. So I'd wan't it the sent .exe file to add it self to the startup. Like msnmsgr does.

    I was thinking of using a shortcut and moving it to the autostart folder but I don't know what's written inside a shourtcut and what's it's extension.
  • zibadianzibadian Posts: 6,349Member
    : Honestly this is just an anoying thing harmless thing. Kinda like a
    : trojan. So I'd wan't it the sent .exe file to add it self to the
    : startup. Like msnmsgr does.
    :
    : I was thinking of using a shortcut and moving it to the autostart
    : folder but I don't know what's written inside a shourtcut and what's
    : it's extension.
    :
    Here you go:
    http://delphi.about.com/od/windowsshellapi/a/create_lnk.htm
    Found it using "shortcut windows api" in google.
  • ColacXColacX Posts: 141Member
    : http://delphi.about.com/od/windowsshellapi/a/create_lnk.htm

    Ehum not solved how would it look like in C++?
    My Pascal is rather rusty. Also my Delphi Compiler is in C++ so it doesn't take Pascal codes.
  • zibadianzibadian Posts: 6,349Member
    : : http://delphi.about.com/od/windowsshellapi/a/create_lnk.htm
    :
    : Ehum not solved how would it look like in C++?
    : My Pascal is rather rusty. Also my Delphi Compiler is in C++ so it
    : doesn't take Pascal codes.

    Why then did you ask it on the Delphi board and not one of the many C++ boards?
Sign In or Register to comment.