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 :)




roobarb
653 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 »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









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.