|
Very competent answer!
hmmm, but in the same time i dont like your answer. Because i want to know what are the possibilities using it. What is used for most of the time? Is it even used anymore? I suppose, all the great softwares, like Visual studio's, 3dsmax, etc they all have at some point some naked plumbing win32 stuff in them that is not possible to make in any other high level languages. I am guessing here, big time. I am asking about all of these. I am not at all pertinent, im just a rookie (with high hopes in a greater, shinier future).
What is your goal? Why did you learn it in the first place? (i dont know if you know it, but if you do...) You can be as philosophical as you please (i am). Or direct as you can. (i do also)
modified 2-Jan-19 7:12am.
|
|
|
|
|
Do you want to learn dinosaur dentistry and be unemployable until Jurassic Park is a reality, or, do you want to be a general practitioner ?
Do you want to build your own car from parts, or fix one that is drive-able now ?
Anything's possible
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Hello,
If You use Visual Studio, when You extends from Interface, You can use Quick Action to implement the interface function.
Click the bulb icon (Ctrl+.), and choose Implement Interface..
[^]
[^]
Interface need to declare interface function(s) at the child, and the parent does not declare yet the body of interface function.
Regards
Toha
|
|
|
|
|
First of all, HNY2019 to codeproject comunity. You are doing a very good job!
I am learning how to use WindowsMediaPlayer control.
My (new) track bar is a fixed length (200px) Empty control with a Paint red rectangle inside it, that updates videoplayer Current time.
I am stuck at a strange point that i cant manage to see the solution.
I bet is a simple solution and i am too tired and foggy to see it right now.
The problem is the Maximum Length of the Movie. It is changing every time when i load a new movie, right so far? Now, my fixed track bar has 200px. How do i make 200px into 1600 int length?
So sorry for my bad english explanation.
Basically, i want to clone a videoPlayer trackbar.
Thank you.
|
|
|
|
|
You're not cloning anything. All you're doing is mapping a number range onto another number range, or a simple percentage. Your trackbar simply goes from 0 to 100%. This is grade school math.
At 200 pixels wide, each pixel represents 0.5%. When your video is playing, you get the percentage played by dividing the number of seconds played by the total number of seconds in the video. You'll get a number between 0 and 1, your percentage played.
|
|
|
|
|
i still dont get it.
put an example there too please.
|
|
|
|
|
It's simple. You played 1200 seconds of a 1600 second video. That's 1200/1600 = 0.75, or 75% of the video played.
Your trackbar is 200 pixels wide, for 100%, so each pixel represents 0.5%, or put another way, 2 pixels represents every 1%. So, you draw your marker 75 * 2 pixels over from it's start.
|
|
|
|
|
Thank you mister Dave Kreskowiak - very nice answer!
|
|
|
|
|
Simple: each pixel in your trackbar represents a variable amount of time: 0.5% of the total length of the movie.
So if your movie is 55 minutes and 37 seconds long, each pixel represents (55 * 60 + 37) * 0.005 == 16.685 seconds.
If your movie is 2 hours, 12 minutes, and 14 seconds long, then each pixel is (((2 * 60) + 12) * 60 + 14) * 0.005 == 39.67 seconds
Get the idea?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
ok i solve it.
I forgot a very old and very useful rule... heh.
All good now. Thank you.
modified 1-Jan-19 13:41pm.
|
|
|
|
|
You're welcome!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
another devil now - with progressBarX1_Click.
And...Resolved!
I wish i can Delete this thread. The "delete" link Button from the top, is showing this time(Haleluia), but is greyed out and I can not use it. Probably is a thing for those with money. I am thinking too much probably.
But seriously, this is a ... (my) fart thread, that i wish to smudge it.
modified 1-Jan-19 15:10pm.
|
|
|
|
|
No, it's simply that you can't delete any post with a response: it would leave the response "hanging in midair" with no support, screaming and wetting itself in terror (Posts are scared of heights, as I'm sure you know).
And of course you have no authority to delete other peoples posts, so you can't get rid of it!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi,
I have a WSDL provided by a third party supplier that i would like to use in my C# code however currently i'm struggling to find a way to use the WSDL.
I looked at their example and they're using ASMX file in the C# project in order to invoke the methods exposed by the service.
If i wanted to use methods available in the WSDL in the C# project, how do i import the WSDL into the project?
modified 31-Dec-18 9:13am.
|
|
|
|
|
The obvious answer is, talk to the supplier.
|
|
|
|
|
Yes thats right. Sorry i didn't make it clear.
What's the correct way of importing the WSDL into the C# project? Is it using Web Reference or Service Reference?
|
|
|
|
|
No, what Richard suggested was: "talk to the supplier"
I.e. the supplier of the WSDL, not a random website that probably isn't at all familiar with that particular service...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And a trivial Google (using part of your last sentence as the search string) would have told you anyway: importing the WSDL into the C - Google Search[^]
The top link is even expanded for you!
Quote: Start Visual Studio.
On the File menu, select New > Project. ...
In the New Project dialog box, enter the desired settings, then click OK.
In the Solution Explorer pane, right-click on References. ...
In the Add Web Reference dialog box, enter the URL to the web service's WSDL document.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Statistical program. Not a keyllogger. For me, to know how much of my life I waste by tapping without meaning into the keyboard;}}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StatisticChar
{
public partial class Form1 : Form
{
private GlobalKeyboardHook _globalKeyboardHook;
public void SetupKeyboardHooks()
{
_globalKeyboardHook = new GlobalKeyboardHook();
_globalKeyboardHook.KeyboardPressed += OnKeyPressed;
}
private void OnKeyPressed(object sender, GlobalKeyboardHookEventArgs e)
{
if (e.KeyboardState == GlobalKeyboardHook.KeyboardState.KeyDown)
{
var znak = $"{(char)e.KeyboardData.VirtualCode} {e.KeyboardData.VirtualCode}";
if ((e.KeyboardData.VirtualCode >= 112) && (e.KeyboardData.VirtualCode <= 123))
{
znak = "F" + (e.KeyboardData.VirtualCode - 111).ToString();
}
if ((e.KeyboardData.VirtualCode >= 96) && (e.KeyboardData.VirtualCode <= 105))
{
znak = (e.KeyboardData.VirtualCode - 96).ToString();
}
if (e.KeyboardData.VirtualCode == 144)
{
znak = "NumLock";
}
if (e.KeyboardData.VirtualCode == 111)
{
znak = "/";
}
if (e.KeyboardData.VirtualCode == 106)
{
znak = "*";
}
if (e.KeyboardData.VirtualCode == 109)
{
znak = "-";
}
if (e.KeyboardData.VirtualCode == 107)
{
znak = "+";
}
if (e.KeyboardData.VirtualCode == 107)
{
znak = ",";
}
if (e.KeyboardData.VirtualCode == 13)
{
znak = "ENTER";
}
if (e.KeyboardData.VirtualCode == 192)
{
znak = "`";
}
if (e.KeyboardData.VirtualCode == 9)
{
znak = "tabulator";
}
if (e.KeyboardData.VirtualCode == 20)
{
znak = "capslock";
}
if (e.KeyboardData.VirtualCode == 160)
{
znak = "LewyShift";
}
if (e.KeyboardData.VirtualCode == 162)
{
znak = "ctrl";
}
if (e.KeyboardData.VirtualCode == 91)
{
znak = "win";
}
if (e.KeyboardData.VirtualCode == 32)
{
znak = "spacja";
}
if (e.KeyboardData.VirtualCode == 37)
{
znak = "←";
}
if (e.KeyboardData.VirtualCode == 39)
{
znak = "→";
}
if (e.KeyboardData.VirtualCode == 38)
{
znak = "↑";
}
if (e.KeyboardData.VirtualCode == 40)
{
znak = "↓";
}
if (e.KeyboardData.VirtualCode == 8)
{
znak = "backup";
}
if (e.KeyboardData.VirtualCode == 161)
{
znak = "prawyShift";
}
if (e.KeyboardData.VirtualCode == 93)
{
znak = "ppm";
}
if (e.KeyboardData.VirtualCode == 45)
{
znak = "insert";
}
if (e.KeyboardData.VirtualCode == 44)
{
znak = "printscreen";
}
if (e.KeyboardData.VirtualCode == 19)
{
znak = "pause";
}
if (e.KeyboardData.VirtualCode == 166)
{
znak = "back";
}
if (e.KeyboardData.VirtualCode == 36)
{
znak = "home";
}
if (e.KeyboardData.VirtualCode == 35)
{
znak = "end";
}
if (e.KeyboardData.VirtualCode == 46)
{
znak = "delete";
}
if (e.KeyboardData.VirtualCode == 33)
{
znak = "pageUp";
}
if (e.KeyboardData.VirtualCode == 34)
{
znak = "pagDown";
}
if (e.KeyboardData.VirtualCode == 163)
{
znak = "PrawyCtrl";
}
if (e.KeyboardData.VirtualCode == 1)
{
znak = "LeftClick";
}
if (e.KeyboardData.VirtualCode == 2)
{
znak = "RightClick";
}
Statystyki[znak] = Statystyki.ContainsKey(znak) ? ++Statystyki[znak] : 1;
}
}
public new void Dispose()
{
base.Dispose();
_globalKeyboardHook?.Dispose();
}
private DateTime data_zbierania_statystyk;
private static readonly Dictionary<string, int> Statystyki = new Dictionary<string, int>();
public Form1()
{
_globalKeyboardHook = new GlobalKeyboardHook();
SetupKeyboardHooks();
var dt = DateTime.Now;
data_zbierania_statystyk = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 0);
Timer timer = new Timer
{
Interval = 1 * 10 * 1000
};
timer.Tick += new EventHandler(Timer_Tick);
timer.Start();
Timer timer2 = new Timer
{
Interval = 1000
};
timer2.Tick += new EventHandler(Timer2_Tick);
timer2.Start();
InitializeComponent();
}
private void Timer2_Tick(object sender, EventArgs e)
{
richTextBox1.Text = StatystykiJakoText();
}
void Timer_Tick(object sender, EventArgs e)
{
Saves();
}
void Saves()
{
var dt = DateTime.Now;
var now = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 0);
if (data_zbierania_statystyk < now)
{
data_zbierania_statystyk = now;
string sb = StatystykiJakoText();
string path = $@"O:\statystyki{dt.Year}-{dt.Month}-{dt.Day}.txt";
File.AppendAllText(path, sb);
richTextBox1.Text = "";
richTextBox1.Text = sb.ToString();
}
}
private string StatystykiJakoText()
{
var sb = new StringBuilder();
sb.Append(Environment.NewLine);
sb.Append($"Statystyki za dzień: {data_zbierania_statystyk}{Environment.NewLine}");
foreach (var literka in Statystyki)
{
sb.Append($"{literka.Key} - {literka.Value}{Environment.NewLine}");
}
return sb.ToString();
}
}
}
However, there is still a problem:
1. I do not catch every character, eg right alt, F Mode
2. Does not catch characters written in some programs, eg Notepad ++?
Is anyone able to say why this is happening and how to fix it?
3. How to handle shortcuts eg ctrl + c, ctrl + v?
4. How to protect against pressing the key, if we keep it and do not let it go?
modified 30-Dec-18 11:16am.
|
|
|
|
|
Quote: Statistical program. Not a keyllogger.
Quote:
namespace Keylogger
Um. I suspect it might be ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
it's just the name of the project in English.
in my own I had written: Program Statystyczny
|
|
|
|
|
Your namespace doesn't agree with you...
|
|
|
|
|
I have already corrected that there were no connections.
And the data is for me, for my needs;)
For proof I can show collections of other statistics such as mouse movement and data transmission over the network from the program: "KalendarzXP" or OmCounter (until computer work) - this is unfortunately programs of Polish programmers
|
|
|
|
|
You're not "counting"; you're "logging".
What do you take us for?
Stick to Mavis Beacon for your "stats".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|