avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday November 26, 2020, 1:53 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - GrumpyCoder [ switch to compact view ]

Pages: [1]

Patch My PC Home Updater is a free, easy-to-use, portable program that keeps over 300 common third-party applications up-to-date on your PC. Let us take the tedious work out of installing and keeping your apps up-to-date to and stay more secure!

Supported Applications:

2020-03-25 13_02_53-Patch My PC Updater

2020-03-25 13_05_24-Patch My PC Updater

N.A.N.Y. 2020 / NANY 2020 - Ducky (A Simple Dock)
« on: December 16, 2019, 01:14 AM »
Application NameDucky
Short Description A simple dock.
Supported OSes   Windows 7, 8, or 10
Author   Lohengrin Percival

This is a simple dock. Drag and drop any executable or shortcut on the main window and it will be added as a button which you can use to launch it later.
Right-click the button if you want to remove it. You can move on the window horizontally by dragging it from the small orange stripe on the right.
Also, you can right-click on it (orange stripe) to show the settings window.

History - Initial release

2019-12-16 10_07_55-.png

N.A.N.Y. 2019 / Re: NANY 2019 - DisplayOff
« on: December 07, 2018, 03:18 AM »
Welcome to the DonationCoder site, SwanKnight, and thank you for your NANY contribution.   :up:   :D

Thank you.

Thanks for sharing this. I have tested it and by reading your source i see that you do not trigger system, just override a powerstate.
This action kinda confuse my Windows own powersetting. (if system goes sleep mode ScreenSaver -> ScreenOff, then automatic start background jobs, those wont executed anymore with your method)

The whole purpose of this code is turn off the display and nothing else.
Correct me if I'm wrong, but you want the PC to be also in a idle state? Frankly, I'm not sure how to even test for that.

Perhaps this article could be helpful. It goes in details about how the code works and some other API calls.

Someone suggested using PostMessage instead of SendMessage, but frankly I'm not sure if it'll make a difference or not.

Code: C# [Select]
  1. [DllImport("user32.dll")]
  2. static extern IntPtr PostMessage(int hWnd, int msg, int wParam, int lParam);

N.A.N.Y. 2019 / NANY 2019 - DisplayOff
« on: December 04, 2018, 10:32 PM »
Application NameDisplayOff
Short Description Turns off the display and terminates itself.
Supported OSes   Windows 7, 8, or 10
Download   https://www.dropbox....2e92l/
Author   Lohengrin Percival

I needed a way to manually turn off the monitor without having to use the physical power button, so I made this.
It doesn't put the PC to sleep, it just turns off the display the same way Windows does, then terminates itself and moving the mouse or pressing any key on the keyboard will turn the display back on.

Because the application is so simple, I decided to share the code as well.

Code: C# [Select]
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Windows.Forms;
  5. public class DisplayManager
  6. {
  7.     private const int SC_MONITORPOWER = 0xF170;
  8.     private const uint WM_SYSCOMMAND = 0x0112;
  10.     [DllImport("user32.dll")]
  11.     static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
  13.     public enum MonitorState
  14.     {
  15.         On = -1,
  16.         Off = 2,
  17.         Standby = 1
  18.     }
  20.     public void SetMonitorState(MonitorState state)
  21.     {
  22.         SendMessage(new Form().Handle, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)state);
  23.     }
  24. }

History - Initial release

PS: I couldn't find the template, so I copied c.gingerich format.

Pages: [1]