Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


theguy

8 posts

Wannabe Geek


#193457 11-Mar-2016 17:46
Send private message

Hello,

 

So I planed a program in C# which works as a prank the point of it is that whatever key the user types it will make a random sound and play it. That is all done however in Console Program, so now after some research I found out that I need to make it an empty windows forms program with Visual Studio then add some C# lines to make it hide from the taskbar. Could someone plz help me. I'm stuck, If you could plz explain where to put the lines of code and everything. Thank you in advance. Also if u have a different more efficient way than to make it hide from the taskbar go ahead and let me know that would be awesome.


Filter this topic showing only the reply marked as answer Create new topic
slingynz
154 posts

Master Geek


  #1511515 11-Mar-2016 18:03
Send private message

Just create a service :)


 
 
 

GoodSync. Easily back up and sync your files with GoodSync. Simple and secure file backup and synchronisation software will ensure that your files are never lost (affiliate link).
roobarb
575 posts

Ultimate Geek

Trusted

  #1511520 11-Mar-2016 18:26
Send private message

You may have trouble getting access to the desktop to install the keyboard hook.

 

http://stackoverflow.com/questions/5815424/global-keyboard-hook-from-windows-service

 

You could try linking the application with /SUBSYSTEM:WINDOWS instead of /SUBSYSTEM:CONSOLE

 

This is also an excellent example of why Tim Sweeney is wrong and we need UWP.

 

 

 

 


theguy

8 posts

Wannabe Geek


  #1511947 12-Mar-2016 13:08
Send private message

slingynz:

 

Just create a service :)

 

 

 

 

Tried that already but didn't go as planed




theguy

8 posts

Wannabe Geek


  #1511948 12-Mar-2016 13:08
Send private message

roobarb:

 

You may have trouble getting access to the desktop to install the keyboard hook.

 

http://stackoverflow.com/questions/5815424/global-keyboard-hook-from-windows-service

 

You could try linking the application with /SUBSYSTEM:WINDOWS instead of /SUBSYSTEM:CONSOLE

 

This is also an excellent example of why Tim Sweeney is wrong and we need UWP.

 

 

 

 

 

 

 

 

Will get back to you after trying it :D might work


theguy

8 posts

Wannabe Geek


  #1514373 16-Mar-2016 12:46
Send private message

Progress,

 

SO I have made it windows forms application and managed to hide it. Now I need to hook the program to the system to tell the program that the user have pressed a keyboard key and play a sound.

 

Anyone got any ideas plz?

 

Kind Regards.

 

 


theguy

8 posts

Wannabe Geek


  #1514771 16-Mar-2016 22:34
Send private message

Ok it is done here is the solution for you guys!

 

For making it run in the background even though it wasn't focused I used what is known as "keyboard interrupt" more on this link: "http://www.codeproject.com/Articles/14485/Low-level-Windows-API-hooks-from-C-to-stop-unwante"

 

 

 

Then at:
public Form1()
{
InitializeComponent();
}

 

added two lines to make it hidden which are as followed:
public Form1()
{
InitializeComponent();
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
}

 

P.S because it will run in the background just make sure u comment out the section which adds the drawing. Will make sense when you try it.

 

If you have any questions let me know! This program was made to prank a teacher at my school, and I did get the OK from another teacher and it is finally done. I'm uploading the video on my YouTube channel OptonTech, if you are interested, http://www.goo.gl/bBucnd. stay tuned!


Filter this topic showing only the reply marked as answer Create new topic





News and reviews »

Synology Introduces BeeStation
Posted 23-Feb-2024 14:14


New One UI 6.1 Update Brings Galaxy AI to More Galaxy Devices
Posted 23-Feb-2024 10:50


Amazon Echo Hub Available in New Zealand
Posted 23-Feb-2024 10:40


InternetNZ Releases Internet Insights 2023
Posted 20-Feb-2024 10:31


Seagate Adds 24TB IronWolf Pro Hard Drives for Multi-user Commercial and Enterprise RAID Storage Solutions
Posted 19-Feb-2024 16:54


Seagate Skyhawk AI 24TB Elevates Edge Security Capacity and Performance
Posted 9-Feb-2024 17:18


GoPro Releases Quik Desktop App for macOS and Introduces Premium+ Subscription Tier
Posted 9-Feb-2024 17:14


Ring Introduces New Ring Battery Video Doorbell Pro
Posted 9-Feb-2024 16:51


Galaxy AI Transforms the new Galaxy S24 Series
Posted 18-Jan-2024 07:00


D-Link launches AI-Powered Aquila Pro M30 Wi-Fi 6 Mesh Systems
Posted 17-Jan-2024 20:02


Newest LG 4K Lifestyle Projector Doubles as Art Objet
Posted 9-Jan-2024 15:50


More LG Smart TV Owners Set To Enjoy the Latest webOS Upgrade
Posted 9-Jan-2024 15:45


Panasonic Announces the Z95A and Z93A With Fire TV Built In
Posted 9-Jan-2024 15:30


Amazon Echo Pop Review
Posted 8-Jan-2024 14:22


Samsung Tab S9 FE Review
Posted 17-Dec-2023 08:26









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.







GoodSync is the easiest file sync and backup for Windows and Mac