|
OriginalGriff wrote: Then - not to put too fine a point on it - you are an idiot.
I did the same, years ago. Some coworker wondered why his CD-tray kept opening and closing on its own[^] while he was working. It's hard not to burst from laughing if someone looks for an exorcist.
OriginalGriff wrote:
If you are in a corporate environment, you could end up with a dressing down, disciplinary action, possibly being fired. Any corporate environment says that you should lock your PC if you leave the station. If you don't, then don't blame me for using the keyboard for reminding you of company-policy.
OriginalGriff wrote: If you want to know how to create such things, you need to visit a hacking site: Gag-applications are a very long way from hacking, and his source doesn't look like something to hijack a computer. Remember this one[^]? I'll bet you recognize it when you hover the link
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
omg, guys you never had an idea to make a prank on your college and send them harmless app to annoy them because its a part of joke or smth? im really sorry for you if you don't have this kind of relations on your working place , you know job is not only about being serious and doing the apps and writing codes for working purpose only.But thanks for reply and answer
|
|
|
|
|
The first ever computer virus started out as a prank: The 30-year-old prank that became the first computer virus • The Register[^]
ILOVEYOU[^] was "accidentally" released - and cost an estimated $15 billion dollars worldwide (and the authors only escaped prison because they lived in the Philippines which had no laws against harming computers - they do now).
When young idiots do things they don't fully understand, they don't always realise - or even consider - the impact their actions will have. Often they don't even intend it to do what it does. Doesn't matter - intent is not the criteria, effect is.
Think about it:
Would you like it if you are slaving away to finish a project before the submission deadline and your computer started making impossible to continue?
Would your tutor accept "my mate f*cked my computer up" as a reasonable excuse for not handing it in?
Would you be a happy bunny if your mate messed up your computer?
I'm guessing here, but the answers are probably "no", "no", and "NO!".
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: The first ever computer virus started out as a prank So, you oppose taking a screenshot and setting that as the desktops background, because it could unleash powers equal to the tools stolen from the NSA?
OriginalGriff wrote: Would you be a happy bunny if your mate messed up your computer? Gag applications don't.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: Well written Gag applications don't.
FTFY
But given the skill level on show here - would you install a "gag app" from the OP on your computer and run it? I wouldn't ...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: But given the skill level on show here - would you install a "gag app" from the OP on your computer and run it? I wouldn't ... So, you agree that it is probably not some sophisticated virus?
If the gag-application errors out, what is the worst that is going to happen? The app crashing, probably. We help people with less skills that are working on production code with more impact. So yes, if I receive the code, I'd read a bit and run it on a test-PC.
I get more nervous if someone posts a question about software for hospitals; made me paranoid enough to opt out from one of their websites, based on the documentation I received.
You didn't answer the other question; are you familiar with the bit-recycler?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
No, it's not. But ... how many times in your career have you written code run it and gone "oh sh*t!" because it did something you really didn't mean it to? A db UPDATE with the wrong WHERE clause? Overwriting a file instead of appending it? Worse?
We all have. But if we muck up our PC that's one thing. Someone else's? Not the same at all.
And the lower the skill level, the more chance of error - you know that.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: We all have. But if we muck up our PC that's one thing. Someone else's? Not the same at all.
And the lower the skill level, the more chance of error - you know that. Dude, it is a nonsense-application. Every student starts somewhere. I have run many pieces of homework on this machine, but never did anything happen that caused damage.
Yes, I know the dangers of coding all to well, in my first year I created a bug that caused a machine to dump 3 cubic meters of quick-drying cement on the floor. The people that had to shovel it away were not amused.
A gag-application is usually not run on an important server, and even if he makes a mistake, I doubt it would be as destructive as a virus.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: I have run many pieces of homework on this machine, but never did anything happen that caused damage. I was working on a project at my last employment some years ago and managed to disable one of my drives completely, with a fairly unsophisticated MFC app. Had it been the C drive I would have been most displeased.
|
|
|
|
|
That's why we don't work on production environments.
Doesn't mean that people should stop writing code "because" they may make a mistake
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I never suggested they should.
|
|
|
|
|
So he really does hates fast typists!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You could try putting this at the top of your file:
#pragma warning disable 1060
Or you can add this attribute to the method prototype:
SuppressUnmanagedCodeSecurityAttribute
Or, you could simply obey the warning and create an appropriate class and put the interop methods in it.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
modified 12-Mar-18 13:33pm.
|
|
|
|
|
|
I prefer to put all of my interop stuff into their own class. I think this warning started showing up in VS2017 (I've never seen it in VS2013).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I'm starting to plan out a project and I need some help with ideas.
Situation: my company uses a software managed by a third party company. I do not know exactly how this works but the link to this program looks like "113.444.767.123/bin/some file". This is started though iexplorer then switches over from the iexplorer process to a different process (I have the name).
We recently had then create a test company for training purposes. I can make two separate desktop icons easy enough. But once the program is running, if both the training and real companies are running at the same time, it is hard to determine the difference.
I want to change the taskbat icon, and pop a message balloon when the user switches between the two.
First problem, windows will use the desktop icon before the app icon, so I'm going to create a bootloader app that is launched from the desktop, it will open my real app and kill itself. Now I will have access to change the taskbar icon through code.
Second problem, I can't just call the process the company program and follow the returned processId because the original iexplorer ID calls the other program, thus changing ID's.
My thoughts: when I start the process from my program I start a loop the constantly calls getProcesses and loops through each one until the actual program process name is found. Once found I'll have the ID off the correct process and can match up icons based on that.
Third problem monitoring what process is active to change the icons.
My thoughts were to use TPL tasks, start a new async task that runs a loop to get the ForgroundWindowGetID and compare it to the list of IDs for the program I'm tracking. This is were in a little murky, can I send the ID back to my main program to handle the icons and balloons while still keeping the async task running, or do I need to stop the async task when the ID changes, then restart the task?
|
|
|
|
|
Use virtual machines; or get another physical machine.
None of this makes sense because what you're "planning" now is a throw-away.
I can create simulators; but the "real" thing is often cheaper (and VM's are "real" enough).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Couldn't you start your app with a parameter indicating whether it's the real company or the training company, and if it's the training company, change the icon of the main form in the app?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Not really, my app actually starts a 3rd party software. Once the 3rd party is running I want my app to be able to "watch" the 3rd party for which one was in focus. I was "hoping" and event would be thrown in Windows when a widow went in focus, but it doesn't look so.
What I've done so far (have not had time to do much) was to create two projects in one solution, the first one being a simple command line app that just calls the GUI. Now, since windows is not using the desktop shortcut icon, I can change the app icon and it is reflected on the team bar.
My plan for following windows is, on the open button event, the app calls the 3rd party program (actually a link to a server), starts a timer, on the tick event, loads all the precesses into a list and loops through list search for the process name to show up, once it finds it, adds the ID to a list and stops the timer, starts an async task that gets the ID number of the active window, if the active window is in the process list, displays the correct icon.
|
|
|
|
|
Prod vs test user decisons based on the color of a task bar icon.
Sounds like Hawaii all over again.
(Some people are color blind).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Gerry Schmitz wrote: (Some people are color blind). Actually, quite a few, including me.
Roughly 1 in 10 males are red/green colorblind (US statistic).
Females are rarely colorblind.
(A sex-linked trait, recessive on X chromosome.)
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
To me, "some" means one, all, or anything in between
In this case, you plan for any number.
(I think when I did have a "test" environment, I would change the entire background if there was any chance there would be any confusion).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
This is probably a very dumb question but i am just starting to learn programming and i´m stuck.
In the following code i have made two methods , one for button moving up and another one for button moving down. I know i should be able to put them into one method using parameters but i don´t understand that concept yet. Can anyone help me understand how to do that?
public partial class MainWindow : Window
{
Verdieping etage;
public MainWindow()
{
InitializeComponent();
Verdieping etage = (Verdieping)0;
lblHuidigeVerdieping.Content = etage.ToString();
}
enum Verdieping: sbyte
{
kelder =-1,
gelijksvloers,
een,
twee,
drie
}
void WijzigVerdiepingUp()
{
etage++;
lblHuidigeVerdieping.Content = etage.ToString();
}
void WijzigVerdiepDown()
{
etage--;
lblHuidigeVerdieping.Content = etage.ToString();
}
private void btnUp_Click(object sender, RoutedEventArgs e)
{
WijzigVerdiepingUp();
}
private void btnDown_Click(object sender, RoutedEventArgs e)
{
WijzigVerdiepDown();
}
}
|
|
|
|
|
Try:
const int Up = 1;
const int Down = -1;
void WijzigVerdieping(int direction = Up)
{
etage += direction;
lblHuidigeVerdieping.Content = etage.ToString();
}
private void btnUp_Click(object sender, RoutedEventArgs e)
{
WijzigVerdieping();
}
private void btnDown_Click(object sender, RoutedEventArgs e)
{
WijzigVerdiep(Down);
}
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Even though we haven´t seen constants yet , and we have to make it work without them, i tried your code and it says
Operator '+=' cannot be applied to operands of type 'Mainwindow.Verdieping' and 'int'.
Thank you for your swift answer , i ll just wait till next class and ask the teacher if he can explain me the concept
|
|
|
|
|