topbanner_forum
  *

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]
1
PatchMyPC (FREEWARE)

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!

Download: https://patchmypc.co...ome-updater-download
Supported Applications: https://patchmypc.co...r-supported-products

2020-03-25 13_02_53-Patch My PC Updater 4.1.0.4.png

2020-03-25 13_05_24-Patch My PC Updater 4.1.0.4.png

2
N.A.N.Y. 2020 / NANY 2020 - Ducky (A Simple Dock)
« on: December 16, 2019, 01:14 AM »
Application NameDucky
Version1.0.0.0
Short Description A simple dock.
Supported OSes   Windows 7, 8, or 10
Download   https://mega.nz/#!iJ...GqiTUAMkLr-ZJR-UPPdU
VirusTotalhttps://www.virustot...efb0097d2f/detection
Author   Lohengrin Percival

Description
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
1.0.0.0 - Initial release

2019-12-16 10_07_55-.png

3
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);
  3. PostMessage(-1, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);

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

Description
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.

Bonus
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;
  4.  
  5. public class DisplayManager
  6. {
  7.     private const int SC_MONITORPOWER = 0xF170;
  8.     private const uint WM_SYSCOMMAND = 0x0112;
  9.  
  10.     [DllImport("user32.dll")]
  11.     static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
  12.  
  13.     public enum MonitorState
  14.     {
  15.         On = -1,
  16.         Off = 2,
  17.         Standby = 1
  18.     }
  19.  
  20.     public void SetMonitorState(MonitorState state)
  21.     {
  22.         SendMessage(new Form().Handle, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)state);
  23.     }
  24. }

History
1.0.0.0 - Initial release

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

Pages: [1]